diff --git a/.github/workflows/merge-main.yml b/.github/workflows/merge-main.yml index c27248e..ff03b21 100644 --- a/.github/workflows/merge-main.yml +++ b/.github/workflows/merge-main.yml @@ -11,6 +11,28 @@ concurrency: cancel-in-progress: true jobs: + vars: + name: Set Variables + runs-on: ubuntu-24.04 + timeout-minutes: 1 + steps: + # Get PR number for squash merges to main + - name: PR Number + id: pr + uses: bcgov/action-get-pr@v0.0.1 + - name: Metabase Version + id: metabase_version + run: | + appVersion=$(yq '.metabase.metabaseImage.tag' charts/nr-metabase/values.yaml) + echo "app version is $appVersion" + echo "app_version=$appVersion" >> "$GITHUB_OUTPUT" + - uses: shrink/actions-docker-registry-tag@v4 + with: + registry: ghcr.io + repository: ${{ github.repository }}/metabase + target: ${{ steps.pr.outputs.pr }} + tags: | + ${{ steps.metabase_version.outputs.app_version }} helm-release: runs-on: ubuntu-24.04 steps: diff --git a/.github/workflows/on-pr-main.yml b/.github/workflows/on-pr-main.yml index 7441429..c2c5c8b 100644 --- a/.github/workflows/on-pr-main.yml +++ b/.github/workflows/on-pr-main.yml @@ -58,8 +58,8 @@ jobs: repository: ${{ github.repository }}/metabase target: ${{ github.sha }} tags: | - pr-${{ github.event.number }} - ${{ needs.extract_version.outputs.app_version }} + ${{ github.event.number }} + @@ -85,4 +85,4 @@ jobs: oc project ${{ vars.oc_namespace }} # Deploy Helm Chart - helm upgrade --install --wait --atomic nr-metabase-${{ github.event.number }} --set-string global.secrets.databasePassword=${{ secrets.DB_PASSWORD}} --set-string global.zone="${{ github.event.number }}" --set-string metabase.image.tag=${{ github.sha }} --set namespace=${{ vars.oc_namespace }} --timeout 5m charts/nr-metabase --debug + helm upgrade --install --wait --atomic nr-metabase-${{ github.event.number }} --set-string global.secrets.databasePassword=${{ secrets.DB_PASSWORD}} --set-string global.zone="${{ github.event.number }}" --set-string metabase.metabaseImage.tag=${{ github.sha }} --set namespace=${{ vars.oc_namespace }} --timeout 5m charts/nr-metabase --debug diff --git a/charts/nr-metabase/values.yaml b/charts/nr-metabase/values.yaml index 6e8274f..6029189 100644 --- a/charts/nr-metabase/values.yaml +++ b/charts/nr-metabase/values.yaml @@ -50,7 +50,7 @@ database: fullnameOverride: "" deploymentStrategy: Recreate image: - repository: ghcr.io/bcgov/nr-containers/postgres + repository: artifacts.developer.gov.bc.ca/github-docker-remote/bcgov/nr-containers/postgres pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. tag: '15.10' @@ -74,8 +74,8 @@ database: persistence: enabled: true size: 740Mi - accessMode: ReadWriteMany - storageClass: netapp-file-standard + accessMode: ReadWriteOnce + storageClass: netapp-block-standard backup: enabled: true nameOverride: "" @@ -90,8 +90,8 @@ backup: - ReadWriteOnce mountPath: "/backups/" size: 256Mi #Volume space available for data, e.g. 512Mi, 2Gi. - storageClass: "netapp-block-standard" - schedule: "0 0 * * *" # cron job schedule + storageClass: "netapp-file-backup" + schedule: "0 0/4 * * *" # cron job schedule strategy: "rolling" # daily or rolling numBackups: 5 # The number of backup files to be retained. Used for the `daily` backup strategy. Ignored when using the `rolling` backup strategy. dailyBackups: 7 # The number of daily backup files to be retained. Used for the `rolling` backup strategy.