Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/publish-to-dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,23 @@ jobs:
echo "version=${GIT_HASH}-amd64" >> $GITHUB_OUTPUT
fi

- name: Build and push
- name: Build and push countryconfig image
uses: docker/build-push-action@v6
with:
push: true
context: .
tags: |
${{ secrets.DOCKERHUB_ACCOUNT}}/${{ secrets.DOCKERHUB_REPO }}:${{ steps.country_config.outputs.version }}

- name: Build and push metabase assets image
uses: docker/build-push-action@v6
with:
push: true
context: .
file: ./Dockerfile.metabase.assets
tags: |
${{ secrets.DOCKERHUB_ACCOUNT}}/${{ secrets.DOCKERHUB_REPO }}:${{ steps.country_config.outputs.version }}-assets

merge-manifest:
needs: [build]
runs-on: ubuntu-latest
Expand All @@ -98,11 +107,17 @@ jobs:
# Create manifest list based on whether ARM build exists
if [[ "$BUILD_ARM" == "true" ]]; then
MANIFEST_LIST="$REPO:$TAG-amd64 $REPO:$TAG-arm64"
ASSETS_MANIFEST_LIST="$REPO:$TAG-amd64-assets $REPO:$TAG-arm64-assets"
else
MANIFEST_LIST="$REPO:$TAG-amd64"
ASSETS_MANIFEST_LIST="$REPO:$TAG-amd64-assets"
fi

echo "[🔁 pushing ] $REPO:$TAG"
docker manifest create $REPO:$TAG \
$MANIFEST_LIST
docker manifest push $REPO:$TAG
echo "[🔁 pushing ] $REPO:$TAG-assets"
docker manifest create $REPO:$TAG-assets \
$ASSETS_MANIFEST_LIST
docker manifest push $REPO:$TAG-assets
9 changes: 9 additions & 0 deletions Dockerfile.metabase.assets
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM alpine:3.20

# Directory inside the assets image
WORKDIR /assets

# Copy assets
COPY infrastructure/metabase /assets/

RUN chmod +x /assets/*.sh
8 changes: 5 additions & 3 deletions infrastructure/metabase/run.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
#
# Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.

#!/bin/bash
SCRIPT_FULL_PATH=$(readlink -f $0)
SCRIPT_DIR=$(dirname "$SCRIPT_FULL_PATH")
echo "Running Metabase initialization script from ${SCRIPT_DIR}"

if [ -z "${OPENCRVS_METABASE_SITE_NAME}" ]; then
echo "Error: OPENCRVS_METABASE_SITE_NAME environment variable is not defined"
Expand Down Expand Up @@ -106,8 +108,8 @@ export OPENCRVS_METABASE_ADMIN_PASSWORD_SALT=$(uuidgen)
SALT_AND_PASSWORD=$OPENCRVS_METABASE_ADMIN_PASSWORD_SALT$OPENCRVS_METABASE_ADMIN_PASSWORD
export OPENCRVS_METABASE_ADMIN_PASSWORD_HASH=$(java -cp $METABASE_JAR clojure.main -e "(require 'metabase.util.password) (println (metabase.util.password/hash-bcrypt \"$SALT_AND_PASSWORD\"))" 2>/dev/null | tail -n 1)

source /initialize-database.sh
source /update-database.sh
source ${SCRIPT_DIR}/initialize-database.sh
source ${SCRIPT_DIR}/update-database.sh

echo "Starting metabase..."

Expand Down
Loading