From 5abcd4962ac1e083f7e00f20646e83a0f422aaf4 Mon Sep 17 00:00:00 2001 From: Ivan Polchenko <2119240+i5okie@users.noreply.github.com> Date: Mon, 24 Jun 2024 15:18:14 -0700 Subject: [PATCH 1/8] Add GitOps logic Signed-off-by: Ivan Polchenko <2119240+i5okie@users.noreply.github.com> --- .github/workflows/on_push_main.yaml | 67 ++++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/.github/workflows/on_push_main.yaml b/.github/workflows/on_push_main.yaml index bba0e107..8c5aaeee 100644 --- a/.github/workflows/on_push_main.yaml +++ b/.github/workflows/on_push_main.yaml @@ -14,6 +14,70 @@ jobs: ref: "main" platforms: "linux/amd64" + changed_files: + runs-on: ubuntu-latest + name: Test changed files + outputs: + any_changed: ${{ steps.chart-changes.outputs.any_changed }} + steps: + - uses: actions/checkout@v4 + - name: Check for changes in the charts folder + id: chart-changes + uses: tj-actions/changed-files@v44 + with: + files: charts/vc-authn-oidc/*.* + + argo_sync: + runs-on: ubuntu-latest + name: Update GitOps Repo to trigger ArgoCD Sync + needs: + - build + - changed_files + if: needs.changed_files.outputs.any_changed != 'true' + steps: + - uses: actions/checkout@v4 + - name: Set up Git + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + - name: Add SSH key + env: + DITP_GITOPS_REPO_SECRET: ${{ secrets.DITP_GITOPS_REPO_SECRET }} + run: | + mkdir -p ~/.ssh + echo "$DITP_GITOPS_REPO_SECRET" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + ssh-keyscan github.com >> ~/.ssh/known_hosts + - name: Clone gitops-repo + run: | + git clone git@github.com:bcgov-c/ministry-gitops-ditp.git + cd ministry-gitops-ditp + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + - name: Lookup latest chart + id: chart_version + run: | + helm repo add vc-authn-oidc https://bcgov.github.io/vc-authn-oidc + helm repo update + echo "::set output name=APP_VERSION::$(helm search repo vc-authn-oidc --version ^0.2 -ojson | jq '.[0].app_version')" + echo "::set output name=CHART_VERSION::$(helm search repo vc-authn-oidc --version ^0.2 -ojson | jq '.[0].version')" + - name: Update values + env: + APP_VERSION: ${{ steps.chart_version.outputs.APP_VERSION }} + CHART_VERSION: ${{ steps.chart_version.outputs.CHART_VERSION }} + IMAGE_TAG: ${{ needs.build_acapy.outputs.image_version }} + run: | + cd ministry-gitops-ditp + yq e -i '.appVersion = $APP_VERSION' services/vc-authn-oidc/charts/dev/Chart.yaml + yq e -i '.version = $CHART_VERSION' services/vc-authn-oidc/charts/dev/Chart.yaml + yq e -i '.vc-authn-oidc.acapy.image.tag = $IMAGE_TAG' services/vc-authn-oidc/charts/dev/values.yaml + - name: Commit and push changes + run: | + cd ministry-gitops-ditp + git add services/vc-authn-oidc/charts/dev/values.yaml services/vc-authn-oidc/charts/dev/Chart.yaml + git commit -m "Update chart version and image tags" + git push origin main + # Build vc-authn deploy: name: Deploy VC-AuthN to Dev @@ -21,7 +85,8 @@ jobs: runs-on: ubuntu-latest needs: - build - if: ${{ always() && !(contains(needs.*.result, 'failed')) && (github.repository_owner == 'bcgov') }} + - changed_files + if: ${{ needs.changed_files.outputs.any_changed == 'true' && !(contains(needs.*.result, 'failed')) && (github.repository_owner == 'bcgov') }} steps: - uses: actions/checkout@v4 From 8d89953190ec8dd63ff6914566e2b86fc164431a Mon Sep 17 00:00:00 2001 From: Ivan Polchenko <2119240+i5okie@users.noreply.github.com> Date: Mon, 24 Jun 2024 15:18:40 -0700 Subject: [PATCH 2/8] Add GitOps update logic to releases Signed-off-by: Ivan Polchenko <2119240+i5okie@users.noreply.github.com> --- .github/workflows/chart_release.yaml | 55 ++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/.github/workflows/chart_release.yaml b/.github/workflows/chart_release.yaml index b427540d..1957cfa6 100644 --- a/.github/workflows/chart_release.yaml +++ b/.github/workflows/chart_release.yaml @@ -27,3 +27,58 @@ jobs: config: .github/actions/chart_releaser/cr.yaml env: CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + + gitops_update: + runs-on: ubuntu-latest + name: Update GitOps Repo + needs: + - chart-release + steps: + - uses: actions/checkout@v4 + - name: Set up Git + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + - name: Add SSH key + env: + DITP_GITOPS_REPO_SECRET: ${{ secrets.DITP_GITOPS_REPO_SECRET }} + run: | + mkdir -p ~/.ssh + echo "$DITP_GITOPS_REPO_SECRET" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + ssh-keyscan github.com >> ~/.ssh/known_hosts + - name: Clone gitops-repo + run: | + git clone git@github.com:bcgov-c/ministry-gitops-ditp.git + cd ministry-gitops-ditp + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + - name: Lookup latest chart + id: chart_version + run: | + helm repo add vc-authn-oidc https://bcgov.github.io/vc-authn-oidc + helm repo update + echo "::set output name=APP_VERSION::$(helm search repo vc-authn-oidc --version ^0.2 -ojson | jq '.[0].app_version')" + echo "::set output name=CHART_VERSION::$(helm search repo vc-authn-oidc --version ^0.2 -ojson | jq '.[0].version')" + - name: Update test + env: + APP_VERSION: ${{ steps.chart_version.outputs.APP_VERSION }} + CHART_VERSION: ${{ steps.chart_version.outputs.CHART_VERSION }} + run: | + cd ministry-gitops-ditp + yq e -i '.appVersion = $APP_VERSION' services/vc-authn-oidc/charts/test/Chart.yaml + yq e -i '.version = $CHART_VERSION' services/vc-authn-oidc/charts/test/Chart.yaml + - name: Update prod + env: + APP_VERSION: ${{ steps.chart_version.outputs.APP_VERSION }} + CHART_VERSION: ${{ steps.chart_version.outputs.CHART_VERSION }} + run: | + cd ministry-gitops-ditp + yq e -i '.appVersion = $APP_VERSION' services/vc-authn-oidc/charts/prod/Chart.yaml + yq e -i '.version = $CHART_VERSION' services/vc-authn-oidc/charts/prod/Chart.yaml + - name: Commit and push changes + run: | + cd ministry-gitops-ditp + git add services/vc-authn-oidc/charts/test/Chart.yaml services/vc-authn-oidc/charts/prod/Chart.yaml + git commit -m "Update chart version" + git push origin main From 896c6e194aac86d4404af60d480c17afbd84cd2c Mon Sep 17 00:00:00 2001 From: Ivan Polchenko <2119240+i5okie@users.noreply.github.com> Date: Thu, 27 Jun 2024 09:41:16 -0700 Subject: [PATCH 3/8] remove --version flag Signed-off-by: Ivan Polchenko <2119240+i5okie@users.noreply.github.com> --- .github/workflows/chart_release.yaml | 4 ++-- .github/workflows/on_push_main.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/chart_release.yaml b/.github/workflows/chart_release.yaml index 1957cfa6..58e4aa6c 100644 --- a/.github/workflows/chart_release.yaml +++ b/.github/workflows/chart_release.yaml @@ -58,8 +58,8 @@ jobs: run: | helm repo add vc-authn-oidc https://bcgov.github.io/vc-authn-oidc helm repo update - echo "::set output name=APP_VERSION::$(helm search repo vc-authn-oidc --version ^0.2 -ojson | jq '.[0].app_version')" - echo "::set output name=CHART_VERSION::$(helm search repo vc-authn-oidc --version ^0.2 -ojson | jq '.[0].version')" + echo "::set output name=APP_VERSION::$(helm search repo vc-authn-oidc -ojson | jq '.[0].app_version')" + echo "::set output name=CHART_VERSION::$(helm search repo vc-authn-oidc -ojson | jq '.[0].version')" - name: Update test env: APP_VERSION: ${{ steps.chart_version.outputs.APP_VERSION }} diff --git a/.github/workflows/on_push_main.yaml b/.github/workflows/on_push_main.yaml index 8c5aaeee..fd6e914f 100644 --- a/.github/workflows/on_push_main.yaml +++ b/.github/workflows/on_push_main.yaml @@ -59,8 +59,8 @@ jobs: run: | helm repo add vc-authn-oidc https://bcgov.github.io/vc-authn-oidc helm repo update - echo "::set output name=APP_VERSION::$(helm search repo vc-authn-oidc --version ^0.2 -ojson | jq '.[0].app_version')" - echo "::set output name=CHART_VERSION::$(helm search repo vc-authn-oidc --version ^0.2 -ojson | jq '.[0].version')" + echo "::set output name=APP_VERSION::$(helm search repo vc-authn-oidc -ojson | jq '.[0].app_version')" + echo "::set output name=CHART_VERSION::$(helm search repo vc-authn-oidc -ojson | jq '.[0].version')" - name: Update values env: APP_VERSION: ${{ steps.chart_version.outputs.APP_VERSION }} From 95bbcc9e7fc51c98c908dedafffb1baf74a1f09a Mon Sep 17 00:00:00 2001 From: Ivan Polchenko <2119240+i5okie@users.noreply.github.com> Date: Tue, 23 Jul 2024 16:55:17 -0700 Subject: [PATCH 4/8] Update and Fix workflows Signed-off-by: Ivan Polchenko <2119240+i5okie@users.noreply.github.com> --- .github/workflows/chart_release.yaml | 61 +++++++----- .github/workflows/on_push_main.yaml | 137 +++++++++++++++++---------- 2 files changed, 125 insertions(+), 73 deletions(-) diff --git a/.github/workflows/chart_release.yaml b/.github/workflows/chart_release.yaml index 58e4aa6c..265c2bc3 100644 --- a/.github/workflows/chart_release.yaml +++ b/.github/workflows/chart_release.yaml @@ -7,7 +7,7 @@ on: jobs: chart-release: - name: Create chart release + name: Create and Publish Chart Release runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -28,31 +28,28 @@ jobs: env: CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - gitops_update: + update-configs-and-sync: runs-on: ubuntu-latest - name: Update GitOps Repo + name: Update Configs and Sync needs: - chart-release steps: - uses: actions/checkout@v4 + - name: Set up Git run: | git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" - - name: Add SSH key - env: - DITP_GITOPS_REPO_SECRET: ${{ secrets.DITP_GITOPS_REPO_SECRET }} - run: | - mkdir -p ~/.ssh - echo "$DITP_GITOPS_REPO_SECRET" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - ssh-keyscan github.com >> ~/.ssh/known_hosts - - name: Clone gitops-repo - run: | - git clone git@github.com:bcgov-c/ministry-gitops-ditp.git - cd ministry-gitops-ditp - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" + + - name: Checkout services directory from the trust-over-ip-configurations repo + uses: actions/checkout@v4 + with: + repository: bcgov/trust-over-ip-configurations + ssh-key: ${{ secrets.DITP_CONFIGS_REPO_SECRET }} + sparse-checkout: | + services + path: trust-over-ip-configurations + - name: Lookup latest chart id: chart_version run: | @@ -60,25 +57,45 @@ jobs: helm repo update echo "::set output name=APP_VERSION::$(helm search repo vc-authn-oidc -ojson | jq '.[0].app_version')" echo "::set output name=CHART_VERSION::$(helm search repo vc-authn-oidc -ojson | jq '.[0].version')" + - name: Update test env: APP_VERSION: ${{ steps.chart_version.outputs.APP_VERSION }} CHART_VERSION: ${{ steps.chart_version.outputs.CHART_VERSION }} run: | - cd ministry-gitops-ditp + cd trust-over-ip-configurations yq e -i '.appVersion = $APP_VERSION' services/vc-authn-oidc/charts/test/Chart.yaml yq e -i '.version = $CHART_VERSION' services/vc-authn-oidc/charts/test/Chart.yaml + - name: Update prod env: APP_VERSION: ${{ steps.chart_version.outputs.APP_VERSION }} CHART_VERSION: ${{ steps.chart_version.outputs.CHART_VERSION }} run: | - cd ministry-gitops-ditp + cd trust-over-ip-configurations yq e -i '.appVersion = $APP_VERSION' services/vc-authn-oidc/charts/prod/Chart.yaml yq e -i '.version = $CHART_VERSION' services/vc-authn-oidc/charts/prod/Chart.yaml - - name: Commit and push changes + + - name: Commit and Push to trust-over-ip-configurations Repo run: | - cd ministry-gitops-ditp + cd trust-over-ip-configurations git add services/vc-authn-oidc/charts/test/Chart.yaml services/vc-authn-oidc/charts/prod/Chart.yaml - git commit -m "Update chart version" + git commit -m "Update chart and app versions" || echo "No changes to commit" git push origin main + + - name: Trigger and wait for GitOps sync workflow + uses: convictional/trigger-workflow-and-wait@v1.6.5 + id: workflow-trigger + with: + owner: bcgov + repo: trust-over-ip-configurations + github_token: ${{ secrets.DITP_CONFIGS_REPO_TOKEN }} + workflow_file_name: gitops_sync.yaml + + - name: Trigger ArgoCD Sync of e79518-test-vc-authn-oidc + uses: OpsVerseIO/argocd-sync@0.2.0 + with: + address: gitops-shared.apps.silver.devops.gov.bc.ca + token: ${{ secrets.DITP_GITOPS_ARGO_SECRET}} + action: sync + appName: "e79518-test-vc-authn-oidc" diff --git a/.github/workflows/on_push_main.yaml b/.github/workflows/on_push_main.yaml index fd6e914f..66edb6d4 100644 --- a/.github/workflows/on_push_main.yaml +++ b/.github/workflows/on_push_main.yaml @@ -1,4 +1,4 @@ -name: Build & Deploy Development +name: Build, Update Config, and Deploy Development on: workflow_dispatch: push: @@ -14,83 +14,118 @@ jobs: ref: "main" platforms: "linux/amd64" - changed_files: + check_helm_changes: runs-on: ubuntu-latest - name: Test changed files + name: Check for Helm Chart changes outputs: - any_changed: ${{ steps.chart-changes.outputs.any_changed }} + helm_changed: ${{ steps.list-changed.outputs.changed }} steps: - uses: actions/checkout@v4 - - name: Check for changes in the charts folder - id: chart-changes - uses: tj-actions/changed-files@v44 - with: - files: charts/vc-authn-oidc/*.* + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.6.1 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }}) + if [[ -n "$changed" ]]; then + echo "changed=true" >> "$GITHUB_OUTPUT" - argo_sync: + update_configs_repo: runs-on: ubuntu-latest - name: Update GitOps Repo to trigger ArgoCD Sync + name: Update Configurations Repo needs: - build - - changed_files - if: needs.changed_files.outputs.any_changed != 'true' + - check_helm_changes steps: - uses: actions/checkout@v4 - - name: Set up Git - run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "github-actions[bot]@users.noreply.github.com" - - name: Add SSH key - env: - DITP_GITOPS_REPO_SECRET: ${{ secrets.DITP_GITOPS_REPO_SECRET }} - run: | - mkdir -p ~/.ssh - echo "$DITP_GITOPS_REPO_SECRET" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - ssh-keyscan github.com >> ~/.ssh/known_hosts - - name: Clone gitops-repo - run: | - git clone git@github.com:bcgov-c/ministry-gitops-ditp.git - cd ministry-gitops-ditp - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - - name: Lookup latest chart + + - name: Checkout services directory from the trust-over-ip-configurations repo + uses: actions/checkout@v4 + with: + repository: bcgov/trust-over-ip-configurations + ssh-key: ${{ secrets.DITP_CONFIGS_REPO_SECRET }} + sparse-checkout: | + services + path: trust-over-ip-configurations + + - name: Lookup Helm Chart and App versions id: chart_version run: | helm repo add vc-authn-oidc https://bcgov.github.io/vc-authn-oidc helm repo update - echo "::set output name=APP_VERSION::$(helm search repo vc-authn-oidc -ojson | jq '.[0].app_version')" - echo "::set output name=CHART_VERSION::$(helm search repo vc-authn-oidc -ojson | jq '.[0].version')" - - name: Update values + echo "PUBLISHED_APP_VERSION=$(helm search repo vc-authn-oidc -ojson | jq -r '.[0].app_version')" >> $GITHUB_OUTPUT + echo "PUBLISHED_CHART_VERSION=$(helm search repo vc-authn-oidc -ojson | jq -r '.[0].version')" >> $GITHUB_OUTPUT + echo "LOCAL_APP_VERSION=$(yq e .appVersion charts/vc-authn-oidc/Chart.yaml)" >> $GITHUB_OUTPUT + echo "LOCAL_CHART_VERSION=$(yq e .version charts/vc-authn-oidc/Chart.yaml)" >> $GITHUB_OUTPUT + + - name: Update versions env: - APP_VERSION: ${{ steps.chart_version.outputs.APP_VERSION }} - CHART_VERSION: ${{ steps.chart_version.outputs.CHART_VERSION }} - IMAGE_TAG: ${{ needs.build_acapy.outputs.image_version }} + IMAGE_TAG: ${{ needs.build.outputs.image_version }} run: | - cd ministry-gitops-ditp + cd trust-over-ip-configurations + if [[ "${{ needs.check_helm_changes.outputs.helm_changed }}" == "true" ]]; then + APP_VERSION="${{ steps.chart_version.outputs.LOCAL_APP_VERSION }}" + CHART_VERSION="${{ steps.chart_version.outputs.LOCAL_CHART_VERSION }}" + else + APP_VERSION="${{ steps.chart_version.outputs.PUBLISHED_APP_VERSION }}" + CHART_VERSION="${{ steps.chart_version.outputs.PUBLISHED_CHART_VERSION }}" + fi + yq e -i '.appVersion = $APP_VERSION' services/vc-authn-oidc/charts/dev/Chart.yaml yq e -i '.version = $CHART_VERSION' services/vc-authn-oidc/charts/dev/Chart.yaml - yq e -i '.vc-authn-oidc.acapy.image.tag = $IMAGE_TAG' services/vc-authn-oidc/charts/dev/values.yaml - - name: Commit and push changes + yq e -i '.dependencies[0].version = $CHART_VERSION' services/vc-authn-oidc/charts/dev/Chart.yaml + yq e -i '.vc-authn-oidc.image.tag = $IMAGE_TAG' services/vc-authn-oidc/charts/dev/values.yaml + + - name: Commit and Push to trust-over-ip-configurations Repo run: | - cd ministry-gitops-ditp + cd trust-over-ip-configurations + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" git add services/vc-authn-oidc/charts/dev/values.yaml services/vc-authn-oidc/charts/dev/Chart.yaml - git commit -m "Update chart version and image tags" + git commit -m "Update chart version and image tag" || echo "No changes to commit" git push origin main + - uses: convictional/trigger-workflow-and-wait@v1.6.5 + id: workflow-trigger + with: + owner: bcgov + repo: trust-over-ip-configurations + github_token: ${{ secrets.DITP_CONFIGS_REPO_TOKEN }} + workflow_file_name: gitops_sync.yaml + + - name: Trigger ArgoCD Sync of e79518-test-vc-authn-oidc + uses: OpsVerseIO/argocd-sync@0.2.0 + if: needs.check_helm_changes.outputs.helm_changed != 'true' && steps.workflow-trigger.outputs.conclusion == 'success' + with: + address: gitops-shared.apps.silver.devops.gov.bc.ca + token: ${{ secrets.DITP_GITOPS_ARGO_SECRET}} + action: sync + appName: "e79518-test-vc-authn-oidc" + # Build vc-authn - deploy: + deploy_dev: name: Deploy VC-AuthN to Dev environment: dev runs-on: ubuntu-latest needs: - build - - changed_files - if: ${{ needs.changed_files.outputs.any_changed == 'true' && !(contains(needs.*.result, 'failed')) && (github.repository_owner == 'bcgov') }} + - check_helm_changes + if: ${{ needs.check_helm_changes.outputs.helm_changed == 'true' && contains(needs.*.result, 'success') && !(contains(needs.*.result, 'failure')) && (github.repository_owner == 'bcgov') }} steps: - uses: actions/checkout@v4 + - name: Checkout services directory from the trust-over-ip-configurations repo + uses: actions/checkout@v4 + with: + repository: bcgov/trust-over-ip-configurations + ssh-key: ${{ secrets.DITP_CONFIGS_REPO_SECRET }} + sparse-checkout: | + services + path: trust-over-ip-configurations + - name: Authenticate and set context uses: redhat-actions/oc-login@v1 with: @@ -98,12 +133,12 @@ jobs: openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} namespace: ${{ secrets.OPENSHIFT_NAMESPACE }} - - name: VC-Authn Dev Helm + - name: Deploy VC-Authn-OIDC to Development run: | - helm upgrade --install vc-authn-oidc \ - -f https://raw.githubusercontent.com/bcgov/trust-over-ip-configurations/main/helm-values/vc-authn-oidc/dev.yaml \ - --set image.tag=${{ needs.build.outputs.image_version }} \ - ./charts/vc-authn-oidc --wait + cp trust-over-ip-configurations/services/vc-authn-oidc/charts/dev/values.yaml ./dev-values.yaml + yq e -i 'del(.traction) | . *= load("trust-over-ip-configurations/services/vc-authn-oidc/charts/dev/values.yaml").vc-authn-oidc' ./dev-values.yaml + helm upgrade --install vc-authn-oidc -f ./dev-values.yaml --set image.tag=${{ needs.build.outputs.image_version }} ./charts/vc-authn-oidc --wait + - name: Restart Deployments run: | oc rollout restart deployment/vc-authn-oidc-agent From 2b1c77a24f883a82b470e96c57ea966cb21a87be Mon Sep 17 00:00:00 2001 From: Ivan Polchenko <2119240+i5okie@users.noreply.github.com> Date: Tue, 23 Jul 2024 16:58:04 -0700 Subject: [PATCH 5/8] Fix command Signed-off-by: Ivan Polchenko <2119240+i5okie@users.noreply.github.com> --- .github/workflows/on_push_main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/on_push_main.yaml b/.github/workflows/on_push_main.yaml index 66edb6d4..be34d516 100644 --- a/.github/workflows/on_push_main.yaml +++ b/.github/workflows/on_push_main.yaml @@ -136,7 +136,7 @@ jobs: - name: Deploy VC-Authn-OIDC to Development run: | cp trust-over-ip-configurations/services/vc-authn-oidc/charts/dev/values.yaml ./dev-values.yaml - yq e -i 'del(.traction) | . *= load("trust-over-ip-configurations/services/vc-authn-oidc/charts/dev/values.yaml").vc-authn-oidc' ./dev-values.yaml + yq e -i 'del(.vc-authn-oidc) | . *= load("trust-over-ip-configurations/services/vc-authn-oidc/charts/dev/values.yaml").vc-authn-oidc' ./dev-values.yaml helm upgrade --install vc-authn-oidc -f ./dev-values.yaml --set image.tag=${{ needs.build.outputs.image_version }} ./charts/vc-authn-oidc --wait - name: Restart Deployments From 9b03ca15297005982ca16b0a87ce989b49771847 Mon Sep 17 00:00:00 2001 From: Ivan Polchenko <2119240+i5okie@users.noreply.github.com> Date: Wed, 24 Jul 2024 12:54:42 -0700 Subject: [PATCH 6/8] fix env variable interpolation Signed-off-by: Ivan Polchenko <2119240+i5okie@users.noreply.github.com> --- .github/workflows/chart_release.yaml | 8 ++++---- .github/workflows/on_push_main.yaml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/chart_release.yaml b/.github/workflows/chart_release.yaml index 265c2bc3..8d74f8af 100644 --- a/.github/workflows/chart_release.yaml +++ b/.github/workflows/chart_release.yaml @@ -64,8 +64,8 @@ jobs: CHART_VERSION: ${{ steps.chart_version.outputs.CHART_VERSION }} run: | cd trust-over-ip-configurations - yq e -i '.appVersion = $APP_VERSION' services/vc-authn-oidc/charts/test/Chart.yaml - yq e -i '.version = $CHART_VERSION' services/vc-authn-oidc/charts/test/Chart.yaml + yq e -i '.appVersion = env(APP_VERSION)' services/vc-authn-oidc/charts/test/Chart.yaml + yq e -i '.version = env(CHART_VERSION)' services/vc-authn-oidc/charts/test/Chart.yaml - name: Update prod env: @@ -73,8 +73,8 @@ jobs: CHART_VERSION: ${{ steps.chart_version.outputs.CHART_VERSION }} run: | cd trust-over-ip-configurations - yq e -i '.appVersion = $APP_VERSION' services/vc-authn-oidc/charts/prod/Chart.yaml - yq e -i '.version = $CHART_VERSION' services/vc-authn-oidc/charts/prod/Chart.yaml + yq e -i '.appVersion = env(APP_VERSION)' services/vc-authn-oidc/charts/prod/Chart.yaml + yq e -i '.version = env(CHART_VERSION)' services/vc-authn-oidc/charts/prod/Chart.yaml - name: Commit and Push to trust-over-ip-configurations Repo run: | diff --git a/.github/workflows/on_push_main.yaml b/.github/workflows/on_push_main.yaml index be34d516..8b942fa6 100644 --- a/.github/workflows/on_push_main.yaml +++ b/.github/workflows/on_push_main.yaml @@ -73,10 +73,10 @@ jobs: CHART_VERSION="${{ steps.chart_version.outputs.PUBLISHED_CHART_VERSION }}" fi - yq e -i '.appVersion = $APP_VERSION' services/vc-authn-oidc/charts/dev/Chart.yaml - yq e -i '.version = $CHART_VERSION' services/vc-authn-oidc/charts/dev/Chart.yaml - yq e -i '.dependencies[0].version = $CHART_VERSION' services/vc-authn-oidc/charts/dev/Chart.yaml - yq e -i '.vc-authn-oidc.image.tag = $IMAGE_TAG' services/vc-authn-oidc/charts/dev/values.yaml + yq e -i '.appVersion = env(APP_VERSION)' services/vc-authn-oidc/charts/dev/Chart.yaml + yq e -i '.version = env(CHART_VERSION)' services/vc-authn-oidc/charts/dev/Chart.yaml + yq e -i '.dependencies[0].version = env(CHART_VERSION)' services/vc-authn-oidc/charts/dev/Chart.yaml + yq e -i '.vc-authn-oidc.image.tag = env(IMAGE_TAG)' services/vc-authn-oidc/charts/dev/values.yaml - name: Commit and Push to trust-over-ip-configurations Repo run: | From b87e5250e831a0805aa5e1036b352f0f76cdcec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emiliano=20Su=C3=B1=C3=A9?= Date: Thu, 25 Jul 2024 15:29:18 -0700 Subject: [PATCH 7/8] Add CANdy prod ledger to local Docker environment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Emiliano Suñé --- docker/agent/config/ledgers.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docker/agent/config/ledgers.yaml b/docker/agent/config/ledgers.yaml index 3ca1f0d3..de607514 100644 --- a/docker/agent/config/ledgers.yaml +++ b/docker/agent/config/ledgers.yaml @@ -1,5 +1,6 @@ - id: BCovrinTest is_production: true + is_write: true genesis_url: "http://test.bcovrin.vonx.io/genesis" # - id: SovrinStagingNet # is_production: true @@ -9,5 +10,7 @@ genesis_url: "https://raw.githubusercontent.com/ICCS-ISAC/dtrust-reconu/main/CANdy/dev/pool_transactions_genesis" - id: CANdyTest is_production: true - is_write: true genesis_url: "https://raw.githubusercontent.com/ICCS-ISAC/dtrust-reconu/main/CANdy/test/pool_transactions_genesis" +- id: CANdyProd + is_production: true + genesis_url: "https://raw.githubusercontent.com/ICCS-ISAC/dtrust-reconu/main/CANdy/prod/pool_transactions_genesis" From 03af0b1b0568bb144e87b5497eb36ef1897712c1 Mon Sep 17 00:00:00 2001 From: Ivan Polchenko <2119240+i5okie@users.noreply.github.com> Date: Fri, 26 Jul 2024 01:05:07 -0700 Subject: [PATCH 8/8] Fix environment variable setting Signed-off-by: Ivan Polchenko <2119240+i5okie@users.noreply.github.com> --- .github/workflows/chart_release.yaml | 4 ++-- .github/workflows/on_push_main.yaml | 22 ++++++++++------------ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.github/workflows/chart_release.yaml b/.github/workflows/chart_release.yaml index 8d74f8af..c964a71b 100644 --- a/.github/workflows/chart_release.yaml +++ b/.github/workflows/chart_release.yaml @@ -55,8 +55,8 @@ jobs: run: | helm repo add vc-authn-oidc https://bcgov.github.io/vc-authn-oidc helm repo update - echo "::set output name=APP_VERSION::$(helm search repo vc-authn-oidc -ojson | jq '.[0].app_version')" - echo "::set output name=CHART_VERSION::$(helm search repo vc-authn-oidc -ojson | jq '.[0].version')" + echo "APP_VERSION=$(helm search repo vc-authn-oidc -ojson | jq '.[0].app_version')" >> $GITHUB_OUTPUT + echo "CHART_VERSION=$(helm search repo vc-authn-oidc -ojson | jq '.[0].version')" >> $GITHUB_OUTPUT - name: Update test env: diff --git a/.github/workflows/on_push_main.yaml b/.github/workflows/on_push_main.yaml index 8b942fa6..2be55240 100644 --- a/.github/workflows/on_push_main.yaml +++ b/.github/workflows/on_push_main.yaml @@ -55,29 +55,27 @@ jobs: run: | helm repo add vc-authn-oidc https://bcgov.github.io/vc-authn-oidc helm repo update - echo "PUBLISHED_APP_VERSION=$(helm search repo vc-authn-oidc -ojson | jq -r '.[0].app_version')" >> $GITHUB_OUTPUT - echo "PUBLISHED_CHART_VERSION=$(helm search repo vc-authn-oidc -ojson | jq -r '.[0].version')" >> $GITHUB_OUTPUT - echo "LOCAL_APP_VERSION=$(yq e .appVersion charts/vc-authn-oidc/Chart.yaml)" >> $GITHUB_OUTPUT - echo "LOCAL_CHART_VERSION=$(yq e .version charts/vc-authn-oidc/Chart.yaml)" >> $GITHUB_OUTPUT + if [[ "${{ needs.check_helm_changes.outputs.helm_changed }}" == "true" ]]; then + echo "APP_VERSION=$(yq e .appVersion charts/vc-authn-oidc/Chart.yaml)" >> $GITHUB_OUTPUT + echo "CHART_VERSION=$(yq e .version charts/vc-authn-oidc/Chart.yaml)" >> $GITHUB_OUTPUT + else + echo "APP_VERSION=$(helm search repo vc-authn-oidc -ojson | jq -r '.[0].app_version')" >> $GITHUB_OUTPUT + echo "CHART_VERSION=$(helm search repo vc-authn-oidc -ojson | jq -r '.[0].version')" >> $GITHUB_OUTPUT + fi - name: Update versions env: + APP_VERSION: ${{ steps.chart_version.outputs.APP_VERSION }} + CHART_VERSION: ${{ steps.chart_version.outputs.CHART_VERSION }} IMAGE_TAG: ${{ needs.build.outputs.image_version }} run: | cd trust-over-ip-configurations - if [[ "${{ needs.check_helm_changes.outputs.helm_changed }}" == "true" ]]; then - APP_VERSION="${{ steps.chart_version.outputs.LOCAL_APP_VERSION }}" - CHART_VERSION="${{ steps.chart_version.outputs.LOCAL_CHART_VERSION }}" - else - APP_VERSION="${{ steps.chart_version.outputs.PUBLISHED_APP_VERSION }}" - CHART_VERSION="${{ steps.chart_version.outputs.PUBLISHED_CHART_VERSION }}" - fi yq e -i '.appVersion = env(APP_VERSION)' services/vc-authn-oidc/charts/dev/Chart.yaml yq e -i '.version = env(CHART_VERSION)' services/vc-authn-oidc/charts/dev/Chart.yaml yq e -i '.dependencies[0].version = env(CHART_VERSION)' services/vc-authn-oidc/charts/dev/Chart.yaml yq e -i '.vc-authn-oidc.image.tag = env(IMAGE_TAG)' services/vc-authn-oidc/charts/dev/values.yaml - + - name: Commit and Push to trust-over-ip-configurations Repo run: | cd trust-over-ip-configurations