From 59a6100b92d460bbb252e5914c54f852e6f3fe09 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Tue, 16 Jan 2024 22:31:25 -0800 Subject: [PATCH 001/162] adding action.yml and main.yml Signed-off-by: Rajpal Chauhan --- .github/workflow/action.yml | 97 ++++++++++++++++++ .github/workflow/main.yml | 191 ++++++++++++++++++++++++++++++++++++ 2 files changed, 288 insertions(+) create mode 100644 .github/workflow/action.yml create mode 100644 .github/workflow/main.yml diff --git a/.github/workflow/action.yml b/.github/workflow/action.yml new file mode 100644 index 00000000..e49b138c --- /dev/null +++ b/.github/workflow/action.yml @@ -0,0 +1,97 @@ +name: Deploy +description: Deploy to OpenShift namespace + +inputs: + environment: + description: The environment to which the image will be deployed. + required: true + + # Image parameters + ghcr_token: + description: The token to use to login to the GHCR. + required: true + github_image_name: + description: The name of the image in the GHCR to be deployed. + required: true + image_digest: + description: The digest of the image to be deployed. Identifies the unique image tag in the GHCR. + required: true + openshift_image_name: + description: The name of the image to use when pushing to OpenShift. + required: true + + # OpenShift parameters + openshift_server_url: + description: The URL of the OpenShift server. + required: true + namespace: + description: The OpenShift namespace where the image is to be deployed. + required: true + deployment_configuration: + description: The name of the OpenShift deployment configuration triggered by the new image. + required: true + openshift_token: + description: The token used to authenticate with the OpenShift server. + required: true + + # rocket.chat notification parameters + # rocketchat_webhook: + # description: The URL to use for posting notifications to rocket.chat. + # required: true + +runs: + using: composite + steps: + - name: Log in to the GHCR + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ inputs.ghcr_token }} + + - name: Setup Openshift CLI + uses: redhat-actions/oc-login@v1 + with: + openshift_server_url: ${{ inputs.openshift_server_url }} + openshift_token: ${{ inputs.openshift_token }} + + - name: Login in to OpenShift container registry + shell: bash + env: + REGISTRY_AUTH_PREFERENCE: docker + run: | + oc version + docker version + oc registry login --to="${HOME}/.docker/config.json" + + - name: Tag the image in the GHCR as ${{ inputs.environment }} + shell: bash + run: | + docker pull ${{ inputs.github_image_name }}@${{ inputs.image_digest }} + docker tag ${{ inputs.github_image_name }}@${{ inputs.image_digest }} ${{ inputs.github_image_name }}:${{ inputs.environment }} + docker push ${{ inputs.github_image_name }}:${{ inputs.environment }} + + - name: Tag the image in the OpenShift container registry as ${{ inputs.environment }} + shell: bash + run: | + docker pull ${{ inputs.github_image_name }}@${{ inputs.image_digest }} + docker tag ${{ inputs.github_image_name }}@${{ inputs.image_digest }} ${{ inputs.openshift_image_name }}:${{ inputs.environment }} + docker push ${{ inputs.openshift_image_name}}:${{ inputs.environment }} + + - name: Trigger OpenShift rollout + shell: bash + run: | + echo starting rollout in ${{ inputs.namespace }} + oc -n ${{ inputs.namespace }} rollout status dc/${{ inputs.deployment_configuration }} --watch + + # - name: Rocket.Chat Notification + # uses: RocketChat/Rocket.Chat.GitHub.Action.Notification@1.1.1 + # if: always() + # with: + # type: ${{ job.status }} + # job_name: '*Deployment to ${{ inputs.environment }}*' + # mention: 'here' + # mention_if: 'failure' + # channel: '#test-gha' + # url: ${{ inputs.rocketchat_webhook }} + # commit: true \ No newline at end of file diff --git a/.github/workflow/main.yml b/.github/workflow/main.yml new file mode 100644 index 00000000..b9463897 --- /dev/null +++ b/.github/workflow/main.yml @@ -0,0 +1,191 @@ +name: Build and Deploy Image + +on: + workflow_dispatch: + push: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + GITHUB_IMAGE_REPO: ghcr.io/bcgov/dts-endorser-service + OPENSHIFT_IMAGE_REPO: image-registry.apps.silver.devops.gov.bc.ca/4a9599-tools + APP_NAMES: aries-endorser-agent,aries-endorser-db,aries-endorser-backup,aries-endorser-proxy,aries-endorser-api + +jobs: + build: + if: (github.repository == 'bcgov/dts-endorser-service') || (github.event_name == 'workflow_dispatch') + name: Build Image + permissions: + packages: write + runs-on: ubuntu-latest + strategy: + matrix: + include: + - service: aries-endorser-agent + GIT_REPO_URL: https://github.com/bcgov/aries-endorser-service + DOCKER_FILE_PATH: Dockerfile.acapy + SOURCE_CONTEXT_DIR: docker/acapy + # - service: aries-endorser-db + # GIT_REPO_URL: https://github.com/bcgov/aries-endorser-service + # DOCKER_FILE_PATH: docker/wallet/config + # SOURCE_CONTEXT_DIR: docker/wallet/config + - service: aries-endorser-backup + GIT_REPO_URL: https://github.com/BCDevOps/backup-container + DOCKER_FILE_PATH: Dockerfile + SOURCE_CONTEXT_DIR: /docker + # - service: aries-endorser-proxy + # GIT_REPO_URL: https://github.com/BCDevOps/backup-container.git + # DOCKER_FILE_PATH: Dockerfile + # SOURCE_CONTEXT_DIR: /docker + - service: aries-endorser-api + GIT_REPO_URL: https://github.com/bcgov/aries-endorser-service + DOCKER_FILE_PATH: Dockerfile.endorser + SOURCE_CONTEXT_DIR: endorser + outputs: + image_digest: ${{steps.docker_build.outputs.digest}} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + repository: ${{ matrix.GIT_REPO_URL }} + + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to the GHCR + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Prepare docker tags for image + id: meta + uses: docker/metadata-action@v4 + with: + images: ghcr.io/bcgov/dts-endorser-service/${{ matrix.service }} + flavor: | + latest=true + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha,value=latest + + - name: Build and push Docker image + id: docker_build + uses: docker/build-push-action@v3 + with: + context: ${{ matrix.service }}/${{ matrix.SOURCE_CONTEXT_DIR }} + file: ${{ matrix.DOCKER_FILE_PATH }} + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + + - name: Display image results + run: | + echo 'imageid=${{ steps.docker_build.outputs.imageid }}' + echo 'digest=${{ steps.docker_build.outputs.digest }}' + + deploy2dev: + needs: build + env: + ENVIRONMENT: dev + permissions: + packages: write + runs-on: ubuntu-latest + environment: dev + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Deploy to ${{ env.ENVIRONMENT }} + uses: ./.github/workflows/actions/deploy + with: + environment: ${{ env.ENVIRONMENT }} + ghcr_token: ${{ secrets.GITHUB_TOKEN }} + github_image_name: ${{ env.GITHUB_IMAGE_REPO }}/${{ matrix.service }} + image_digest: ${{ needs.build.outputs.image_digest }} + openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}/${{ matrix.service }} + openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} + namespace: ${{ vars.NAMESPACE }} + deployment_configuration: ${{ matrix.service }} + openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} + + # docker pull ghcr.io/bcgov/dts-endorser-service@sha256:57f946ab1053726ac6fcb71c85a98d355e926904ebe26db4798353668b3f6c68 + + # docker pull ghcr.io/bcgov/dts-endorser-service/aries-endorser-api:sha-e237467 + # docker pull ${{ inputs.github_image_name }}@${{ inputs.image_digest }} + # github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} + # GITHUB_IMAGE_REPO: ghcr.io/bcgov/dts-endorser-service + # docker pull ghcr.io/bcgov/dts-endorser-service + # github_image_name: ghcr.io/bcgov/dts-endorser-service + # docker push ghcr.io/bcgov/dts-endorser-service/aries-endorser-api + # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} + + # deploy2test: + # needs: [build, deploy2dev] + # env: + # ENVIRONMENT: test + # permissions: + # packages: write + # runs-on: ubuntu-latest + # environment: test + + # steps: + # - name: Checkout + # uses: actions/checkout@v3 + + # - name: deploy to ${{ env.ENVIRONMENT }} + # uses: ./.github/workflows/actions/deploy + # with: + # environment: ${{ env.ENVIRONMENT }} + # ghcr_token: ${{ secrets.GITHUB_TOKEN }} + # github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ env.APP_NAME }} + # image_digest: ${{ needs.build.outputs.image_digest }} + # openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ env.APP_NAME }} + # openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} + # namespace: ${{ vars.NAMESPACE }} + # deployment_configuration: ${{ env.APP_NAME }} + # openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} + # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} + + # deploy2prod: + # needs: [build, deploy2dev, deploy2test] + # env: + # ENVIRONMENT: prod + # permissions: + # packages: write + # runs-on: ubuntu-latest + # environment: prod + + # steps: + # - name: Checkout + # uses: actions/checkout@v3 + + # - name: deploy to prod + # uses: ./.github/workflows/actions/deploy + # with: + # environment: ${{ env.ENVIRONMENT }} + # ghcr_token: ${{ secrets.GITHUB_TOKEN }} + # github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ env.APP_NAME }} + # image_digest: ${{ needs.build.outputs.image_digest }} + # openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ env.APP_NAME }} + # openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} + # namespace: ${{ vars.NAMESPACE }} + # deployment_configuration: ${{ env.APP_NAME }} + # openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} + # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} + + # aries-endorser-db, aries-endorser-backup, aries-endorser-proxy, aries-endorser-api \ No newline at end of file From fed7fe158440ba05f4eef32bc3380f4458012779 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Tue, 16 Jan 2024 22:34:53 -0800 Subject: [PATCH 002/162] deleting action file Signed-off-by: Rajpal Chauhan --- .github/workflow/action.yml | 97 ------------------------------------- 1 file changed, 97 deletions(-) delete mode 100644 .github/workflow/action.yml diff --git a/.github/workflow/action.yml b/.github/workflow/action.yml deleted file mode 100644 index e49b138c..00000000 --- a/.github/workflow/action.yml +++ /dev/null @@ -1,97 +0,0 @@ -name: Deploy -description: Deploy to OpenShift namespace - -inputs: - environment: - description: The environment to which the image will be deployed. - required: true - - # Image parameters - ghcr_token: - description: The token to use to login to the GHCR. - required: true - github_image_name: - description: The name of the image in the GHCR to be deployed. - required: true - image_digest: - description: The digest of the image to be deployed. Identifies the unique image tag in the GHCR. - required: true - openshift_image_name: - description: The name of the image to use when pushing to OpenShift. - required: true - - # OpenShift parameters - openshift_server_url: - description: The URL of the OpenShift server. - required: true - namespace: - description: The OpenShift namespace where the image is to be deployed. - required: true - deployment_configuration: - description: The name of the OpenShift deployment configuration triggered by the new image. - required: true - openshift_token: - description: The token used to authenticate with the OpenShift server. - required: true - - # rocket.chat notification parameters - # rocketchat_webhook: - # description: The URL to use for posting notifications to rocket.chat. - # required: true - -runs: - using: composite - steps: - - name: Log in to the GHCR - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ inputs.ghcr_token }} - - - name: Setup Openshift CLI - uses: redhat-actions/oc-login@v1 - with: - openshift_server_url: ${{ inputs.openshift_server_url }} - openshift_token: ${{ inputs.openshift_token }} - - - name: Login in to OpenShift container registry - shell: bash - env: - REGISTRY_AUTH_PREFERENCE: docker - run: | - oc version - docker version - oc registry login --to="${HOME}/.docker/config.json" - - - name: Tag the image in the GHCR as ${{ inputs.environment }} - shell: bash - run: | - docker pull ${{ inputs.github_image_name }}@${{ inputs.image_digest }} - docker tag ${{ inputs.github_image_name }}@${{ inputs.image_digest }} ${{ inputs.github_image_name }}:${{ inputs.environment }} - docker push ${{ inputs.github_image_name }}:${{ inputs.environment }} - - - name: Tag the image in the OpenShift container registry as ${{ inputs.environment }} - shell: bash - run: | - docker pull ${{ inputs.github_image_name }}@${{ inputs.image_digest }} - docker tag ${{ inputs.github_image_name }}@${{ inputs.image_digest }} ${{ inputs.openshift_image_name }}:${{ inputs.environment }} - docker push ${{ inputs.openshift_image_name}}:${{ inputs.environment }} - - - name: Trigger OpenShift rollout - shell: bash - run: | - echo starting rollout in ${{ inputs.namespace }} - oc -n ${{ inputs.namespace }} rollout status dc/${{ inputs.deployment_configuration }} --watch - - # - name: Rocket.Chat Notification - # uses: RocketChat/Rocket.Chat.GitHub.Action.Notification@1.1.1 - # if: always() - # with: - # type: ${{ job.status }} - # job_name: '*Deployment to ${{ inputs.environment }}*' - # mention: 'here' - # mention_if: 'failure' - # channel: '#test-gha' - # url: ${{ inputs.rocketchat_webhook }} - # commit: true \ No newline at end of file From 0078d399c1399a7cb6ff90aee31e575484b9c511 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Tue, 16 Jan 2024 22:39:25 -0800 Subject: [PATCH 003/162] adding action.yml Signed-off-by: Rajpal Chauhan --- .github/workflow/actions/deploy/action.yml | 97 ++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 .github/workflow/actions/deploy/action.yml diff --git a/.github/workflow/actions/deploy/action.yml b/.github/workflow/actions/deploy/action.yml new file mode 100644 index 00000000..e49b138c --- /dev/null +++ b/.github/workflow/actions/deploy/action.yml @@ -0,0 +1,97 @@ +name: Deploy +description: Deploy to OpenShift namespace + +inputs: + environment: + description: The environment to which the image will be deployed. + required: true + + # Image parameters + ghcr_token: + description: The token to use to login to the GHCR. + required: true + github_image_name: + description: The name of the image in the GHCR to be deployed. + required: true + image_digest: + description: The digest of the image to be deployed. Identifies the unique image tag in the GHCR. + required: true + openshift_image_name: + description: The name of the image to use when pushing to OpenShift. + required: true + + # OpenShift parameters + openshift_server_url: + description: The URL of the OpenShift server. + required: true + namespace: + description: The OpenShift namespace where the image is to be deployed. + required: true + deployment_configuration: + description: The name of the OpenShift deployment configuration triggered by the new image. + required: true + openshift_token: + description: The token used to authenticate with the OpenShift server. + required: true + + # rocket.chat notification parameters + # rocketchat_webhook: + # description: The URL to use for posting notifications to rocket.chat. + # required: true + +runs: + using: composite + steps: + - name: Log in to the GHCR + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ inputs.ghcr_token }} + + - name: Setup Openshift CLI + uses: redhat-actions/oc-login@v1 + with: + openshift_server_url: ${{ inputs.openshift_server_url }} + openshift_token: ${{ inputs.openshift_token }} + + - name: Login in to OpenShift container registry + shell: bash + env: + REGISTRY_AUTH_PREFERENCE: docker + run: | + oc version + docker version + oc registry login --to="${HOME}/.docker/config.json" + + - name: Tag the image in the GHCR as ${{ inputs.environment }} + shell: bash + run: | + docker pull ${{ inputs.github_image_name }}@${{ inputs.image_digest }} + docker tag ${{ inputs.github_image_name }}@${{ inputs.image_digest }} ${{ inputs.github_image_name }}:${{ inputs.environment }} + docker push ${{ inputs.github_image_name }}:${{ inputs.environment }} + + - name: Tag the image in the OpenShift container registry as ${{ inputs.environment }} + shell: bash + run: | + docker pull ${{ inputs.github_image_name }}@${{ inputs.image_digest }} + docker tag ${{ inputs.github_image_name }}@${{ inputs.image_digest }} ${{ inputs.openshift_image_name }}:${{ inputs.environment }} + docker push ${{ inputs.openshift_image_name}}:${{ inputs.environment }} + + - name: Trigger OpenShift rollout + shell: bash + run: | + echo starting rollout in ${{ inputs.namespace }} + oc -n ${{ inputs.namespace }} rollout status dc/${{ inputs.deployment_configuration }} --watch + + # - name: Rocket.Chat Notification + # uses: RocketChat/Rocket.Chat.GitHub.Action.Notification@1.1.1 + # if: always() + # with: + # type: ${{ job.status }} + # job_name: '*Deployment to ${{ inputs.environment }}*' + # mention: 'here' + # mention_if: 'failure' + # channel: '#test-gha' + # url: ${{ inputs.rocketchat_webhook }} + # commit: true \ No newline at end of file From 87c1adbc9fffb20a2bd424dd31f991f9e9bc214e Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 17 Jan 2024 10:17:37 -0800 Subject: [PATCH 004/162] testing workflow Signed-off-by: Rajpal Chauhan --- .github/workflow/main.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflow/main.yml b/.github/workflow/main.yml index b9463897..2e2e5e1f 100644 --- a/.github/workflow/main.yml +++ b/.github/workflow/main.yml @@ -26,23 +26,23 @@ jobs: matrix: include: - service: aries-endorser-agent - GIT_REPO_URL: https://github.com/bcgov/aries-endorser-service + GIT_REPO_URL: bcgov/aries-endorser-service DOCKER_FILE_PATH: Dockerfile.acapy SOURCE_CONTEXT_DIR: docker/acapy # - service: aries-endorser-db - # GIT_REPO_URL: https://github.com/bcgov/aries-endorser-service + # GIT_REPO_URL: bcgov/aries-endorser-service # DOCKER_FILE_PATH: docker/wallet/config # SOURCE_CONTEXT_DIR: docker/wallet/config - service: aries-endorser-backup - GIT_REPO_URL: https://github.com/BCDevOps/backup-container + GIT_REPO_URL: BCDevOps/backup-container DOCKER_FILE_PATH: Dockerfile SOURCE_CONTEXT_DIR: /docker # - service: aries-endorser-proxy - # GIT_REPO_URL: https://github.com/BCDevOps/backup-container.git + # GIT_REPO_URL: BCDevOps/backup-container.git # DOCKER_FILE_PATH: Dockerfile # SOURCE_CONTEXT_DIR: /docker - service: aries-endorser-api - GIT_REPO_URL: https://github.com/bcgov/aries-endorser-service + GIT_REPO_URL: bcgov/aries-endorser-service DOCKER_FILE_PATH: Dockerfile.endorser SOURCE_CONTEXT_DIR: endorser outputs: From d9d439f062fc49b7eab1538248ece6a04b9c92dd Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 17 Jan 2024 10:24:57 -0800 Subject: [PATCH 005/162] test Signed-off-by: Rajpal Chauhan --- .github/{workflow => workflows}/actions/deploy/action.yml | 0 .github/{workflow => workflows}/main.yml | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .github/{workflow => workflows}/actions/deploy/action.yml (100%) rename .github/{workflow => workflows}/main.yml (100%) diff --git a/.github/workflow/actions/deploy/action.yml b/.github/workflows/actions/deploy/action.yml similarity index 100% rename from .github/workflow/actions/deploy/action.yml rename to .github/workflows/actions/deploy/action.yml diff --git a/.github/workflow/main.yml b/.github/workflows/main.yml similarity index 100% rename from .github/workflow/main.yml rename to .github/workflows/main.yml From 31d87fa1f85dd0877f21440bb3456b193ecefc10 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 17 Jan 2024 10:27:04 -0800 Subject: [PATCH 006/162] yml to yaml Signed-off-by: Rajpal Chauhan --- .github/workflows/actions/deploy/{action.yml => action.yaml} | 0 .github/workflows/{main.yml => main.yaml} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/actions/deploy/{action.yml => action.yaml} (100%) rename .github/workflows/{main.yml => main.yaml} (100%) diff --git a/.github/workflows/actions/deploy/action.yml b/.github/workflows/actions/deploy/action.yaml similarity index 100% rename from .github/workflows/actions/deploy/action.yml rename to .github/workflows/actions/deploy/action.yaml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yaml similarity index 100% rename from .github/workflows/main.yml rename to .github/workflows/main.yaml From 61f7440bba639f887223e79fe823bd12c67d862d Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 17 Jan 2024 12:36:27 -0800 Subject: [PATCH 007/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 2e2e5e1f..f083b749 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -4,7 +4,7 @@ on: workflow_dispatch: push: branches: - - main + - workflow concurrency: group: ${{ github.workflow }}-${{ github.ref }} From 0e09409cc9237ec1e2e5666ce7837e8692a40358 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 17 Jan 2024 12:39:17 -0800 Subject: [PATCH 008/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index f083b749..40446ad5 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -4,7 +4,7 @@ on: workflow_dispatch: push: branches: - - workflow + - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -27,18 +27,18 @@ jobs: include: - service: aries-endorser-agent GIT_REPO_URL: bcgov/aries-endorser-service - DOCKER_FILE_PATH: Dockerfile.acapy SOURCE_CONTEXT_DIR: docker/acapy + DOCKER_FILE_PATH: Dockerfile.acapy # - service: aries-endorser-db # GIT_REPO_URL: bcgov/aries-endorser-service - # DOCKER_FILE_PATH: docker/wallet/config + # DOCKER_FILE_PATH: # SOURCE_CONTEXT_DIR: docker/wallet/config - service: aries-endorser-backup GIT_REPO_URL: BCDevOps/backup-container DOCKER_FILE_PATH: Dockerfile - SOURCE_CONTEXT_DIR: /docker + SOURCE_CONTEXT_DIR: docker # - service: aries-endorser-proxy - # GIT_REPO_URL: BCDevOps/backup-container.git + # GIT_REPO_URL: BCDevOps/backup-container # DOCKER_FILE_PATH: Dockerfile # SOURCE_CONTEXT_DIR: /docker - service: aries-endorser-api @@ -53,6 +53,9 @@ jobs: with: repository: ${{ matrix.GIT_REPO_URL }} + - name: List Directories + run: | + ls -l - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 @@ -84,8 +87,8 @@ jobs: id: docker_build uses: docker/build-push-action@v3 with: - context: ${{ matrix.service }}/${{ matrix.SOURCE_CONTEXT_DIR }} - file: ${{ matrix.DOCKER_FILE_PATH }} + context: ${{ matrix.SOURCE_CONTEXT_DIR }} + file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} From 8df3aa712f24abed5505a97cc33f323b2a2275c5 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 17 Jan 2024 12:40:24 -0800 Subject: [PATCH 009/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 40446ad5..f658292f 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -4,7 +4,7 @@ on: workflow_dispatch: push: branches: - - main + - workflow concurrency: group: ${{ github.workflow }}-${{ github.ref }} From 4ce7a8f7de683414ff73d40437ee95c3775be3fd Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 17 Jan 2024 13:57:18 -0800 Subject: [PATCH 010/162] updating version Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index f658292f..31326693 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -27,8 +27,8 @@ jobs: include: - service: aries-endorser-agent GIT_REPO_URL: bcgov/aries-endorser-service - SOURCE_CONTEXT_DIR: docker/acapy - DOCKER_FILE_PATH: Dockerfile.acapy + SOURCE_CONTEXT_DIR: docker/acapy # The context dir, context, sets the context for the build. i.e. where the build will source files from. + DOCKER_FILE_PATH: Dockerfile.acapy # The docker path, file, is the relative path to the docker file from the root of the repo. # - service: aries-endorser-db # GIT_REPO_URL: bcgov/aries-endorser-service # DOCKER_FILE_PATH: @@ -58,10 +58,10 @@ jobs: ls -l - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Log in to the GHCR - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} @@ -69,7 +69,7 @@ jobs: - name: Prepare docker tags for image id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: ghcr.io/bcgov/dts-endorser-service/${{ matrix.service }} flavor: | @@ -85,7 +85,7 @@ jobs: - name: Build and push Docker image id: docker_build - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: ${{ matrix.SOURCE_CONTEXT_DIR }} file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} @@ -111,7 +111,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Deploy to ${{ env.ENVIRONMENT }} uses: ./.github/workflows/actions/deploy From 389bab26acc532cc1362a87faf83d5117638aebc Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 17 Jan 2024 14:01:47 -0800 Subject: [PATCH 011/162] docker push change Signed-off-by: Rajpal Chauhan --- .github/workflows/actions/deploy/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/actions/deploy/action.yaml b/.github/workflows/actions/deploy/action.yaml index e49b138c..ebf3c854 100644 --- a/.github/workflows/actions/deploy/action.yaml +++ b/.github/workflows/actions/deploy/action.yaml @@ -76,7 +76,7 @@ runs: run: | docker pull ${{ inputs.github_image_name }}@${{ inputs.image_digest }} docker tag ${{ inputs.github_image_name }}@${{ inputs.image_digest }} ${{ inputs.openshift_image_name }}:${{ inputs.environment }} - docker push ${{ inputs.openshift_image_name}}:${{ inputs.environment }} + docker push ${{ inputs.openshift_image_name}}/${{ matrix.service }}:${{ inputs.environment }} - name: Trigger OpenShift rollout shell: bash From 3c5d2db6efe6aaf497595a19b6b74fe6db98d1e9 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 17 Jan 2024 14:13:33 -0800 Subject: [PATCH 012/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/actions/deploy/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/actions/deploy/action.yaml b/.github/workflows/actions/deploy/action.yaml index ebf3c854..519c58e5 100644 --- a/.github/workflows/actions/deploy/action.yaml +++ b/.github/workflows/actions/deploy/action.yaml @@ -69,7 +69,7 @@ runs: run: | docker pull ${{ inputs.github_image_name }}@${{ inputs.image_digest }} docker tag ${{ inputs.github_image_name }}@${{ inputs.image_digest }} ${{ inputs.github_image_name }}:${{ inputs.environment }} - docker push ${{ inputs.github_image_name }}:${{ inputs.environment }} + docker push ${{ inputs.github_image_name }}/${{ matrix.service }}:${{ inputs.environment }} - name: Tag the image in the OpenShift container registry as ${{ inputs.environment }} shell: bash From b0b1ec6e935b2b519c0c1aa6032865c00e6fd6b2 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 17 Jan 2024 14:16:30 -0800 Subject: [PATCH 013/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/actions/deploy/action.yaml | 4 ++-- .github/workflows/main.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/actions/deploy/action.yaml b/.github/workflows/actions/deploy/action.yaml index 519c58e5..2091ade6 100644 --- a/.github/workflows/actions/deploy/action.yaml +++ b/.github/workflows/actions/deploy/action.yaml @@ -69,14 +69,14 @@ runs: run: | docker pull ${{ inputs.github_image_name }}@${{ inputs.image_digest }} docker tag ${{ inputs.github_image_name }}@${{ inputs.image_digest }} ${{ inputs.github_image_name }}:${{ inputs.environment }} - docker push ${{ inputs.github_image_name }}/${{ matrix.service }}:${{ inputs.environment }} + docker push ${{ inputs.github_image_name }}${{ matrix.service }}:${{ inputs.environment }} - name: Tag the image in the OpenShift container registry as ${{ inputs.environment }} shell: bash run: | docker pull ${{ inputs.github_image_name }}@${{ inputs.image_digest }} docker tag ${{ inputs.github_image_name }}@${{ inputs.image_digest }} ${{ inputs.openshift_image_name }}:${{ inputs.environment }} - docker push ${{ inputs.openshift_image_name}}/${{ matrix.service }}:${{ inputs.environment }} + docker push ${{ inputs.openshift_image_name}}${{ matrix.service }}:${{ inputs.environment }} - name: Trigger OpenShift rollout shell: bash diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 31326693..63923dda 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -118,9 +118,9 @@ jobs: with: environment: ${{ env.ENVIRONMENT }} ghcr_token: ${{ secrets.GITHUB_TOKEN }} - github_image_name: ${{ env.GITHUB_IMAGE_REPO }}/${{ matrix.service }} + github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} image_digest: ${{ needs.build.outputs.image_digest }} - openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}/${{ matrix.service }} + openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }} openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} namespace: ${{ vars.NAMESPACE }} deployment_configuration: ${{ matrix.service }} From 311f0b094a562f8bd07cf3c2d10af8e82bb60fa8 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 17 Jan 2024 14:43:41 -0800 Subject: [PATCH 014/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/actions/deploy/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/actions/deploy/action.yaml b/.github/workflows/actions/deploy/action.yaml index 2091ade6..fca170ea 100644 --- a/.github/workflows/actions/deploy/action.yaml +++ b/.github/workflows/actions/deploy/action.yaml @@ -69,7 +69,7 @@ runs: run: | docker pull ${{ inputs.github_image_name }}@${{ inputs.image_digest }} docker tag ${{ inputs.github_image_name }}@${{ inputs.image_digest }} ${{ inputs.github_image_name }}:${{ inputs.environment }} - docker push ${{ inputs.github_image_name }}${{ matrix.service }}:${{ inputs.environment }} + docker push ${{ inputs.github_image_name }} ${{ matrix.service }}:${{ inputs.environment }} - name: Tag the image in the OpenShift container registry as ${{ inputs.environment }} shell: bash From 642e11021468e2779c3f952d141dcb048eb9bcef Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 17 Jan 2024 14:48:00 -0800 Subject: [PATCH 015/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/actions/deploy/action.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/actions/deploy/action.yaml b/.github/workflows/actions/deploy/action.yaml index fca170ea..91f8cc05 100644 --- a/.github/workflows/actions/deploy/action.yaml +++ b/.github/workflows/actions/deploy/action.yaml @@ -19,6 +19,9 @@ inputs: openshift_image_name: description: The name of the image to use when pushing to OpenShift. required: true + service: + description: The name of images used + required: true # OpenShift parameters openshift_server_url: @@ -69,7 +72,7 @@ runs: run: | docker pull ${{ inputs.github_image_name }}@${{ inputs.image_digest }} docker tag ${{ inputs.github_image_name }}@${{ inputs.image_digest }} ${{ inputs.github_image_name }}:${{ inputs.environment }} - docker push ${{ inputs.github_image_name }} ${{ matrix.service }}:${{ inputs.environment }} + docker push ${{ inputs.github_image_name }}${{ inputs.matrix_service }}:${{ inputs.environment }} - name: Tag the image in the OpenShift container registry as ${{ inputs.environment }} shell: bash From 589f478ee40f56bf459269681ca8da153edae12a Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 17 Jan 2024 14:51:52 -0800 Subject: [PATCH 016/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 63923dda..ef8bc945 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -125,6 +125,7 @@ jobs: namespace: ${{ vars.NAMESPACE }} deployment_configuration: ${{ matrix.service }} openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} + matrix_service: ${{ matrix.service }} # docker pull ghcr.io/bcgov/dts-endorser-service@sha256:57f946ab1053726ac6fcb71c85a98d355e926904ebe26db4798353668b3f6c68 From e69cb310324668702ba398057068390624a505de Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Fri, 19 Jan 2024 16:34:46 -0800 Subject: [PATCH 017/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 99 ++++++++++++++++++++++++++++++------- 1 file changed, 80 insertions(+), 19 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index ef8bc945..1f030b5a 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -4,7 +4,7 @@ on: workflow_dispatch: push: branches: - - workflow + - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,7 +14,7 @@ env: GITHUB_IMAGE_REPO: ghcr.io/bcgov/dts-endorser-service OPENSHIFT_IMAGE_REPO: image-registry.apps.silver.devops.gov.bc.ca/4a9599-tools APP_NAMES: aries-endorser-agent,aries-endorser-db,aries-endorser-backup,aries-endorser-proxy,aries-endorser-api - + TAGS: v1 ${{ github.sha }} jobs: build: if: (github.repository == 'bcgov/dts-endorser-service') || (github.event_name == 'workflow_dispatch') @@ -27,20 +27,19 @@ jobs: include: - service: aries-endorser-agent GIT_REPO_URL: bcgov/aries-endorser-service - SOURCE_CONTEXT_DIR: docker/acapy # The context dir, context, sets the context for the build. i.e. where the build will source files from. - DOCKER_FILE_PATH: Dockerfile.acapy # The docker path, file, is the relative path to the docker file from the root of the repo. - # - service: aries-endorser-db - # GIT_REPO_URL: bcgov/aries-endorser-service - # DOCKER_FILE_PATH: - # SOURCE_CONTEXT_DIR: docker/wallet/config + SOURCE_CONTEXT_DIR: docker/acapy + DOCKER_FILE_PATH: Dockerfile.acapy + - service: aries-endorser-db + GIT_REPO_URL: bcgov/aries-endorser-service + PATH: docker/wallet/config + BUILDER_IMAGE: 'quay.io/fedora/postgresql-13:13' - service: aries-endorser-backup GIT_REPO_URL: BCDevOps/backup-container DOCKER_FILE_PATH: Dockerfile SOURCE_CONTEXT_DIR: docker # - service: aries-endorser-proxy - # GIT_REPO_URL: BCDevOps/backup-container # DOCKER_FILE_PATH: Dockerfile - # SOURCE_CONTEXT_DIR: /docker + # SOURCE_CONTEXT_DIR: proxy - service: aries-endorser-api GIT_REPO_URL: bcgov/aries-endorser-service DOCKER_FILE_PATH: Dockerfile.endorser @@ -56,12 +55,14 @@ jobs: - name: List Directories run: | ls -l - + echo $service + env: + service: ${{ matrix.service }} - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@v2 - name: Log in to the GHCR - uses: docker/login-action@v3 + uses: docker/login-action@v2 with: registry: ghcr.io username: ${{ github.actor }} @@ -69,7 +70,7 @@ jobs: - name: Prepare docker tags for image id: meta - uses: docker/metadata-action@v5 + uses: docker/metadata-action@v4 with: images: ghcr.io/bcgov/dts-endorser-service/${{ matrix.service }} flavor: | @@ -82,10 +83,23 @@ jobs: type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} type=sha,value=latest + if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) + env: + service: ${{ matrix.service }} + + - name: Create Docker file + run: | + mkdir ${context} && cd ${context} + echo "FROM ${BASE_IMAGE}" > Dockerfile + echo "RUN chown 1001:root /usr/bin/caddy" >> Dockerfile + if: contains(fromJSON('["aries-endorser-proxy"]'), matrix.service) + env: + context: ${{ matrix.SOURCE_CONTEXT_DIR }} + BASE_IMAGE: "artifacts.developer.gov.bc.ca/docker-remote/caddy:latest" - name: Build and push Docker image id: docker_build - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v3 with: context: ${{ matrix.SOURCE_CONTEXT_DIR }} file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} @@ -94,11 +108,51 @@ jobs: labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max + if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) + + - name: Pull base image + id: pull_build_image + run: | + docker pull ${builder_image} + env: + builder_image: ${{ matrix.BUILDER_IMAGE }} + if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + + - name: Setup and Build + id: build_image + uses: redhat-actions/s2i-build@v2 + with: + path_context: ${{ matrix.PATH }} + # Builder image for a java project + builder_image: ${{ matrix.BUILDER_IMAGE }} + image: dts-endorser-service/${{ matrix.service }} + tags: ${{ env.TAGS }} + if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + + - name: Push image + id: push + uses: redhat-actions/push-to-registry@v2 + with: + tags: ${{ steps.build_image.outputs.tags }} + image: ${{ steps.build_image.outputs.image }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + registry: ghcr.io/bcgov + if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + - name: Print image url + id: ${{ matrix.service }} + run: | + echo "registry_path=${{ steps.push.outputs.registry-paths }}" + echo "digest=${{ steps.push.outputs.digest }}" + if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + - name: Display image results run: | echo 'imageid=${{ steps.docker_build.outputs.imageid }}' echo 'digest=${{ steps.docker_build.outputs.digest }}' + if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) + deploy2dev: needs: build @@ -108,24 +162,31 @@ jobs: packages: write runs-on: ubuntu-latest environment: dev + strategy: + matrix: + include: + - service: aries-endorser-agent + - service: aries-endorser-db + - service: aries-endorser-backup + # - service: aries-endorser-proxy + - service: aries-endorser-api steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v3 - name: Deploy to ${{ env.ENVIRONMENT }} uses: ./.github/workflows/actions/deploy with: environment: ${{ env.ENVIRONMENT }} ghcr_token: ${{ secrets.GITHUB_TOKEN }} - github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} + github_image_name: ${{ env.GITHUB_IMAGE_REPO }}/${{ matrix.service }} image_digest: ${{ needs.build.outputs.image_digest }} - openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }} + openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}/${{ matrix.service }} openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} namespace: ${{ vars.NAMESPACE }} deployment_configuration: ${{ matrix.service }} openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} - matrix_service: ${{ matrix.service }} # docker pull ghcr.io/bcgov/dts-endorser-service@sha256:57f946ab1053726ac6fcb71c85a98d355e926904ebe26db4798353668b3f6c68 From b3024a7854615944b51a9c3f8ff45ff1148dc4d8 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Mon, 22 Jan 2024 15:26:48 -0800 Subject: [PATCH 018/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 1f030b5a..f888e0b2 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -45,6 +45,10 @@ jobs: DOCKER_FILE_PATH: Dockerfile.endorser SOURCE_CONTEXT_DIR: endorser outputs: + aries-endorser-agent_digest: ${{steps.digest.outputs.aries-endorser-agent_digest}} + aries-endorser-backup_digest: ${{steps.digest.outputs.aries-endorser-backup_digest}} + aries-endorser-api_digest: ${{steps.digest.outputs.aries-endorser-api_digest}} + aries-endorser-db_digest: ${{steps.digests.outputs.aries-endorser-db_digest}} image_digest: ${{steps.docker_build.outputs.digest}} steps: - name: Checkout @@ -141,19 +145,21 @@ jobs: if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - name: Print image url - id: ${{ matrix.service }} + id: digests run: | echo "registry_path=${{ steps.push.outputs.registry-paths }}" echo "digest=${{ steps.push.outputs.digest }}" + echo "${matrix.service}_digest=$digest\n" >> $GITHUB_OUTPUT if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - name: Display image results + id: digest run: | echo 'imageid=${{ steps.docker_build.outputs.imageid }}' echo 'digest=${{ steps.docker_build.outputs.digest }}' + echo "${matrix.service}_digest=$digest\n" >> $GITHUB_OUTPUT if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) - deploy2dev: needs: build env: @@ -181,7 +187,7 @@ jobs: environment: ${{ env.ENVIRONMENT }} ghcr_token: ${{ secrets.GITHUB_TOKEN }} github_image_name: ${{ env.GITHUB_IMAGE_REPO }}/${{ matrix.service }} - image_digest: ${{ needs.build.outputs.image_digest }} + image_digest: ${{ needs.build.outputs[format('{0}_digest', matrix.service)] }} openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}/${{ matrix.service }} openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} namespace: ${{ vars.NAMESPACE }} From 56090aeaca81b5b4be42f9c355933bf9ff90d267 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Tue, 23 Jan 2024 11:38:42 -0800 Subject: [PATCH 019/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index f888e0b2..9e3435a9 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -70,7 +70,7 @@ jobs: with: registry: ghcr.io username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Prepare docker tags for image id: meta @@ -187,11 +187,11 @@ jobs: environment: ${{ env.ENVIRONMENT }} ghcr_token: ${{ secrets.GITHUB_TOKEN }} github_image_name: ${{ env.GITHUB_IMAGE_REPO }}/${{ matrix.service }} - image_digest: ${{ needs.build.outputs[format('{0}_digest', matrix.service)] }} + image_digest: ${{ format ( 'needs.build.outputs.{0}_digest', matrix.service) }} openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}/${{ matrix.service }} openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} namespace: ${{ vars.NAMESPACE }} - deployment_configuration: ${{ matrix.service }} + deploymentContext _configuration: ${{ matrix.service }} openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} # docker pull ghcr.io/bcgov/dts-endorser-service@sha256:57f946ab1053726ac6fcb71c85a98d355e926904ebe26db4798353668b3f6c68 From 571aadcc03f497f7515a1dea083f86b7c3c368b3 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Tue, 23 Jan 2024 11:41:00 -0800 Subject: [PATCH 020/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 9e3435a9..29ff759d 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -4,7 +4,7 @@ on: workflow_dispatch: push: branches: - - main + - workflow concurrency: group: ${{ github.workflow }}-${{ github.ref }} From 69ff2dc4af894c777c39c6bd38168f43b7e4384c Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Tue, 23 Jan 2024 11:46:48 -0800 Subject: [PATCH 021/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 29ff759d..5e34f249 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -149,17 +149,21 @@ jobs: run: | echo "registry_path=${{ steps.push.outputs.registry-paths }}" echo "digest=${{ steps.push.outputs.digest }}" - echo "${matrix.service}_digest=$digest\n" >> $GITHUB_OUTPUT + echo "${service}_digest=${digest}" >> $GITHUB_OUTPUT if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + env: + service: ${{ matrix.service }} - name: Display image results id: digest run: | echo 'imageid=${{ steps.docker_build.outputs.imageid }}' echo 'digest=${{ steps.docker_build.outputs.digest }}' - echo "${matrix.service}_digest=$digest\n" >> $GITHUB_OUTPUT + echo "${service}_digest=${digest}" >> $GITHUB_OUTPUT if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) - + env: + service: ${{ matrix.service }} + deploy2dev: needs: build env: From 280c30f57527dff8f13615c8b533ac8315de6500 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Tue, 23 Jan 2024 11:59:24 -0800 Subject: [PATCH 022/162] test --- .github/workflows/main.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 5e34f249..1ddb1acc 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -163,7 +163,7 @@ jobs: if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) env: service: ${{ matrix.service }} - + deploy2dev: needs: build env: @@ -182,6 +182,11 @@ jobs: - service: aries-endorser-api steps: + - name: id + run: | + echo '${need_small}' + env: + need_samll: needs - name: Checkout uses: actions/checkout@v3 From 5238776303fb6ea177eb6a2bbad029095daa9cbd Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Tue, 23 Jan 2024 12:04:30 -0800 Subject: [PATCH 023/162] test --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 1ddb1acc..751b82dd 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -186,7 +186,7 @@ jobs: run: | echo '${need_small}' env: - need_samll: needs + need_samll: ${{ needs }} - name: Checkout uses: actions/checkout@v3 From 3bc972014947c36bc68b5c1431c6ace4cb0e6928 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 24 Jan 2024 09:50:13 -0800 Subject: [PATCH 024/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 284 ++++++++++++++---------------------- 1 file changed, 110 insertions(+), 174 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 751b82dd..36fdc65e 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -4,7 +4,7 @@ on: workflow_dispatch: push: branches: - - workflow + - main concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -13,8 +13,8 @@ concurrency: env: GITHUB_IMAGE_REPO: ghcr.io/bcgov/dts-endorser-service OPENSHIFT_IMAGE_REPO: image-registry.apps.silver.devops.gov.bc.ca/4a9599-tools - APP_NAMES: aries-endorser-agent,aries-endorser-db,aries-endorser-backup,aries-endorser-proxy,aries-endorser-api TAGS: v1 ${{ github.sha }} + jobs: build: if: (github.repository == 'bcgov/dts-endorser-service') || (github.event_name == 'workflow_dispatch') @@ -30,8 +30,8 @@ jobs: SOURCE_CONTEXT_DIR: docker/acapy DOCKER_FILE_PATH: Dockerfile.acapy - service: aries-endorser-db - GIT_REPO_URL: bcgov/aries-endorser-service - PATH: docker/wallet/config + GIT_REPO_URL: bcgov/aries-endorser-service + PATH: docker/wallet/config BUILDER_IMAGE: 'quay.io/fedora/postgresql-13:13' - service: aries-endorser-backup GIT_REPO_URL: BCDevOps/backup-container @@ -44,125 +44,128 @@ jobs: GIT_REPO_URL: bcgov/aries-endorser-service DOCKER_FILE_PATH: Dockerfile.endorser SOURCE_CONTEXT_DIR: endorser + outputs: - aries-endorser-agent_digest: ${{steps.digest.outputs.aries-endorser-agent_digest}} - aries-endorser-backup_digest: ${{steps.digest.outputs.aries-endorser-backup_digest}} - aries-endorser-api_digest: ${{steps.digest.outputs.aries-endorser-api_digest}} - aries-endorser-db_digest: ${{steps.digests.outputs.aries-endorser-db_digest}} - image_digest: ${{steps.docker_build.outputs.digest}} + aries-endorser-agent_digest: ${{ steps.aries-endorser-agent-digest.outputs.digest }} + aries-endorser-backup_digest: ${{ steps.aries-endorser-backup-digest.outputs.digest }} + aries-endorser-api_digest: ${{ steps.aries-endorser-api-digest.outputs.digest }} + aries-endorser-db_digest: ${{ steps.aries-endorser-db-digest.outputs.digest }} + image_digest: ${{ steps.docker_build.outputs.digest }} + steps: - - name: Checkout - uses: actions/checkout@v4 - with: - repository: ${{ matrix.GIT_REPO_URL }} + - name: Checkout + uses: actions/checkout@v4 + with: + repository: ${{ matrix.GIT_REPO_URL }} - - name: List Directories - run: | - ls -l - echo $service - env: - service: ${{ matrix.service }} - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + - name: List Directories + run: | + ls -l + echo $service + env: + service: ${{ matrix.service }} - - name: Log in to the GHCR - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - - name: Prepare docker tags for image - id: meta - uses: docker/metadata-action@v4 - with: - images: ghcr.io/bcgov/dts-endorser-service/${{ matrix.service }} - flavor: | - latest=true - tags: | - type=schedule - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - type=sha,value=latest - if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) - env: - service: ${{ matrix.service }} - - - name: Create Docker file - run: | + - name: Log in to the GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Prepare docker tags for image + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/bcgov/dts-endorser-service/${{ matrix.service }} + flavor: | + latest=true + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha,value=latest + if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) + env: + service: ${{ matrix.service }} + + - name: Create Docker file + run: | mkdir ${context} && cd ${context} echo "FROM ${BASE_IMAGE}" > Dockerfile echo "RUN chown 1001:root /usr/bin/caddy" >> Dockerfile - if: contains(fromJSON('["aries-endorser-proxy"]'), matrix.service) - env: - context: ${{ matrix.SOURCE_CONTEXT_DIR }} - BASE_IMAGE: "artifacts.developer.gov.bc.ca/docker-remote/caddy:latest" - - - name: Build and push Docker image - id: docker_build - uses: docker/build-push-action@v3 - with: - context: ${{ matrix.SOURCE_CONTEXT_DIR }} - file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max - if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) + if: contains(fromJSON('["aries-endorser-proxy"]'), matrix.service) + env: + context: ${{ matrix.SOURCE_CONTEXT_DIR }} + BASE_IMAGE: "artifacts.developer.gov.bc.ca/docker-remote/caddy:latest" - - name: Pull base image - id: pull_build_image - run: | + - name: Build and push Docker image + id: docker_build + uses: docker/build-push-action@v5 + with: + context: ${{ matrix.SOURCE_CONTEXT_DIR }} + file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) + + - name: Pull base image + id: pull_build_image + run: | docker pull ${builder_image} - env: - builder_image: ${{ matrix.BUILDER_IMAGE }} - if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - - - name: Setup and Build - id: build_image - uses: redhat-actions/s2i-build@v2 - with: - path_context: ${{ matrix.PATH }} - # Builder image for a java project - builder_image: ${{ matrix.BUILDER_IMAGE }} - image: dts-endorser-service/${{ matrix.service }} - tags: ${{ env.TAGS }} - if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + env: + builder_image: ${{ matrix.BUILDER_IMAGE }} + if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - - name: Push image - id: push - uses: redhat-actions/push-to-registry@v2 - with: + - name: Setup and Build + id: build_image + uses: redhat-actions/s2i-build@v2 + with: + path_context: ${{ matrix.PATH }} + # Builder image for a java project + builder_image: ${{ matrix.BUILDER_IMAGE }} + image: dts-endorser-service/${{ matrix.service }} + tags: ${{ env.TAGS }} + if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + + - name: Push image + id: push + uses: redhat-actions/push-to-registry@v2 + with: tags: ${{ steps.build_image.outputs.tags }} image: ${{ steps.build_image.outputs.image }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} registry: ghcr.io/bcgov - if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - - - name: Print image url - id: digests - run: | - echo "registry_path=${{ steps.push.outputs.registry-paths }}" - echo "digest=${{ steps.push.outputs.digest }}" - echo "${service}_digest=${digest}" >> $GITHUB_OUTPUT - if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - env: - service: ${{ matrix.service }} + if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + + - name: Print image url + id: digests + run: | + echo "registry_path=${{ steps.push.outputs.registry-paths }}" + echo "digest=${{ steps.push.outputs.digest }}" + echo "${service}_digest=${digest}" >> $GITHUB_OUTPUT + if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + env: + service: ${{ matrix.service }} - - name: Display image results - id: digest - run: | - echo 'imageid=${{ steps.docker_build.outputs.imageid }}' - echo 'digest=${{ steps.docker_build.outputs.digest }}' - echo "${service}_digest=${digest}" >> $GITHUB_OUTPUT - if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) - env: - service: ${{ matrix.service }} + - name: Display image results + id: digest + run: | + echo 'imageid=${{ steps.docker_build.outputs.imageid }}' + echo 'digest=${{ steps.docker_build.outputs.digest }}' + echo "${service}_digest=${digest}" >> $GITHUB_OUTPUT + if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) + env: + service: ${{ matrix.service }} deploy2dev: needs: build @@ -188,7 +191,7 @@ jobs: env: need_samll: ${{ needs }} - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Deploy to ${{ env.ENVIRONMENT }} uses: ./.github/workflows/actions/deploy @@ -202,70 +205,3 @@ jobs: namespace: ${{ vars.NAMESPACE }} deploymentContext _configuration: ${{ matrix.service }} openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} - - # docker pull ghcr.io/bcgov/dts-endorser-service@sha256:57f946ab1053726ac6fcb71c85a98d355e926904ebe26db4798353668b3f6c68 - - # docker pull ghcr.io/bcgov/dts-endorser-service/aries-endorser-api:sha-e237467 - # docker pull ${{ inputs.github_image_name }}@${{ inputs.image_digest }} - # github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} - # GITHUB_IMAGE_REPO: ghcr.io/bcgov/dts-endorser-service - # docker pull ghcr.io/bcgov/dts-endorser-service - # github_image_name: ghcr.io/bcgov/dts-endorser-service - # docker push ghcr.io/bcgov/dts-endorser-service/aries-endorser-api - # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} - - # deploy2test: - # needs: [build, deploy2dev] - # env: - # ENVIRONMENT: test - # permissions: - # packages: write - # runs-on: ubuntu-latest - # environment: test - - # steps: - # - name: Checkout - # uses: actions/checkout@v3 - - # - name: deploy to ${{ env.ENVIRONMENT }} - # uses: ./.github/workflows/actions/deploy - # with: - # environment: ${{ env.ENVIRONMENT }} - # ghcr_token: ${{ secrets.GITHUB_TOKEN }} - # github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ env.APP_NAME }} - # image_digest: ${{ needs.build.outputs.image_digest }} - # openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ env.APP_NAME }} - # openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} - # namespace: ${{ vars.NAMESPACE }} - # deployment_configuration: ${{ env.APP_NAME }} - # openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} - # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} - - # deploy2prod: - # needs: [build, deploy2dev, deploy2test] - # env: - # ENVIRONMENT: prod - # permissions: - # packages: write - # runs-on: ubuntu-latest - # environment: prod - - # steps: - # - name: Checkout - # uses: actions/checkout@v3 - - # - name: deploy to prod - # uses: ./.github/workflows/actions/deploy - # with: - # environment: ${{ env.ENVIRONMENT }} - # ghcr_token: ${{ secrets.GITHUB_TOKEN }} - # github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ env.APP_NAME }} - # image_digest: ${{ needs.build.outputs.image_digest }} - # openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ env.APP_NAME }} - # openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} - # namespace: ${{ vars.NAMESPACE }} - # deployment_configuration: ${{ env.APP_NAME }} - # openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} - # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} - - # aries-endorser-db, aries-endorser-backup, aries-endorser-proxy, aries-endorser-api \ No newline at end of file From d5daa0f6bd4827354f81d3400a5a6928e6477eab Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 24 Jan 2024 09:51:11 -0800 Subject: [PATCH 025/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 36fdc65e..4ae2359a 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -4,7 +4,7 @@ on: workflow_dispatch: push: branches: - - main + - workflow concurrency: group: ${{ github.workflow }}-${{ github.ref }} From 02e8b5e76dc8f8a5131f5291d99629d1aa435db1 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 24 Jan 2024 10:25:42 -0800 Subject: [PATCH 026/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 4ae2359a..9ddc610f 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -181,7 +181,6 @@ jobs: - service: aries-endorser-agent - service: aries-endorser-db - service: aries-endorser-backup - # - service: aries-endorser-proxy - service: aries-endorser-api steps: @@ -189,7 +188,8 @@ jobs: run: | echo '${need_small}' env: - need_samll: ${{ needs }} + need_small: ${{ needs }} + - name: Checkout uses: actions/checkout@v4 @@ -199,9 +199,9 @@ jobs: environment: ${{ env.ENVIRONMENT }} ghcr_token: ${{ secrets.GITHUB_TOKEN }} github_image_name: ${{ env.GITHUB_IMAGE_REPO }}/${{ matrix.service }} - image_digest: ${{ format ( 'needs.build.outputs.{0}_digest', matrix.service) }} + image_digest: ${{ needs.build.outputs[format('{0}_digest', matrix.service)] }} openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}/${{ matrix.service }} openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} namespace: ${{ vars.NAMESPACE }} - deploymentContext _configuration: ${{ matrix.service }} + deployment_configuration: ${{ matrix.service }} openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} From 6d15a2ed71e007f6026776b9a489f9eb2a8afefa Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 25 Jan 2024 10:42:20 -0800 Subject: [PATCH 027/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 9ddc610f..c6e1614b 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -46,10 +46,10 @@ jobs: SOURCE_CONTEXT_DIR: endorser outputs: - aries-endorser-agent_digest: ${{ steps.aries-endorser-agent-digest.outputs.digest }} - aries-endorser-backup_digest: ${{ steps.aries-endorser-backup-digest.outputs.digest }} - aries-endorser-api_digest: ${{ steps.aries-endorser-api-digest.outputs.digest }} - aries-endorser-db_digest: ${{ steps.aries-endorser-db-digest.outputs.digest }} + aries-endorser-agent_digest: ${{ steps.docker_build.outputs.aries-endorser-agent_digest }} + aries-endorser-backup_digest: ${{ steps.docker_build.outputs.aries-endorser-backup_digest }} + aries-endorser-api_digest: ${{ steps.docker_build.outputs.aries-endorser-api_digest }} + aries-endorser-db_digest: ${{ steps.docker_build.outputs.aries-endorser-db_digest }} image_digest: ${{ steps.docker_build.outputs.digest }} steps: From c27af88a04b323bb20f669ab2f9e950cd1d4ad50 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 25 Jan 2024 11:45:16 -0800 Subject: [PATCH 028/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 299 ++++++++++++++++++++++-------------- 1 file changed, 182 insertions(+), 117 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index c6e1614b..10ace325 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -13,8 +13,8 @@ concurrency: env: GITHUB_IMAGE_REPO: ghcr.io/bcgov/dts-endorser-service OPENSHIFT_IMAGE_REPO: image-registry.apps.silver.devops.gov.bc.ca/4a9599-tools + APP_NAMES: aries-endorser-agent,aries-endorser-db,aries-endorser-backup,aries-endorser-proxy,aries-endorser-api TAGS: v1 ${{ github.sha }} - jobs: build: if: (github.repository == 'bcgov/dts-endorser-service') || (github.event_name == 'workflow_dispatch') @@ -30,8 +30,8 @@ jobs: SOURCE_CONTEXT_DIR: docker/acapy DOCKER_FILE_PATH: Dockerfile.acapy - service: aries-endorser-db - GIT_REPO_URL: bcgov/aries-endorser-service - PATH: docker/wallet/config + GIT_REPO_URL: bcgov/aries-endorser-service + PATH: docker/wallet/config BUILDER_IMAGE: 'quay.io/fedora/postgresql-13:13' - service: aries-endorser-backup GIT_REPO_URL: BCDevOps/backup-container @@ -44,133 +44,131 @@ jobs: GIT_REPO_URL: bcgov/aries-endorser-service DOCKER_FILE_PATH: Dockerfile.endorser SOURCE_CONTEXT_DIR: endorser - outputs: - aries-endorser-agent_digest: ${{ steps.docker_build.outputs.aries-endorser-agent_digest }} - aries-endorser-backup_digest: ${{ steps.docker_build.outputs.aries-endorser-backup_digest }} - aries-endorser-api_digest: ${{ steps.docker_build.outputs.aries-endorser-api_digest }} - aries-endorser-db_digest: ${{ steps.docker_build.outputs.aries-endorser-db_digest }} - image_digest: ${{ steps.docker_build.outputs.digest }} - + aries-endorser-agent_digest: ${{steps.digest.outputs.aries-endorser-agent_digest}} + aries-endorser-backup_digest: ${{steps.digest.outputs.aries-endorser-backup_digest}} + aries-endorser-api_digest: ${{steps.digest.outputs.aries-endorser-api_digest}} + aries-endorser-db_digest: ${{steps.digests.outputs.aries-endorser-db_digest}} + image_digest: ${{steps.docker_build.outputs.digest}} steps: - - name: Checkout - uses: actions/checkout@v4 - with: - repository: ${{ matrix.GIT_REPO_URL }} + - name: Checkout + uses: actions/checkout@v4 + with: + repository: ${{ matrix.GIT_REPO_URL }} - - name: List Directories - run: | - ls -l - echo $service - env: - service: ${{ matrix.service }} + - name: List Directories + run: | + ls -l + echo $service + env: + service: ${{ matrix.service }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + - name: Log in to the GHCR + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - - name: Log in to the GHCR - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Prepare docker tags for image - id: meta - uses: docker/metadata-action@v5 - with: - images: ghcr.io/bcgov/dts-endorser-service/${{ matrix.service }} - flavor: | - latest=true - tags: | - type=schedule - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - type=sha,value=latest - if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) - env: - service: ${{ matrix.service }} - - - name: Create Docker file - run: | + - name: Prepare docker tags for image + id: meta + uses: docker/metadata-action@v4 + with: + images: ghcr.io/bcgov/dts-endorser-service/${{ matrix.service }} + flavor: | + latest=true + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha,value=latest + if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) + env: + service: ${{ matrix.service }} + + - name: Create Docker file + run: | mkdir ${context} && cd ${context} echo "FROM ${BASE_IMAGE}" > Dockerfile echo "RUN chown 1001:root /usr/bin/caddy" >> Dockerfile - if: contains(fromJSON('["aries-endorser-proxy"]'), matrix.service) - env: - context: ${{ matrix.SOURCE_CONTEXT_DIR }} - BASE_IMAGE: "artifacts.developer.gov.bc.ca/docker-remote/caddy:latest" + if: contains(fromJSON('["aries-endorser-proxy"]'), matrix.service) + env: + context: ${{ matrix.SOURCE_CONTEXT_DIR }} + BASE_IMAGE: "artifacts.developer.gov.bc.ca/docker-remote/caddy:latest" - - name: Build and push Docker image - id: docker_build - uses: docker/build-push-action@v5 - with: - context: ${{ matrix.SOURCE_CONTEXT_DIR }} - file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max - if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) - - - name: Pull base image - id: pull_build_image - run: | + - name: Build and push Docker image + id: docker_build + uses: docker/build-push-action@v3 + with: + context: ${{ matrix.SOURCE_CONTEXT_DIR }} + file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) + + - name: Pull base image + id: pull_build_image + run: | docker pull ${builder_image} - env: - builder_image: ${{ matrix.BUILDER_IMAGE }} - if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + env: + builder_image: ${{ matrix.BUILDER_IMAGE }} + if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - - name: Setup and Build - id: build_image - uses: redhat-actions/s2i-build@v2 - with: - path_context: ${{ matrix.PATH }} - # Builder image for a java project - builder_image: ${{ matrix.BUILDER_IMAGE }} - image: dts-endorser-service/${{ matrix.service }} - tags: ${{ env.TAGS }} - if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - - - name: Push image - id: push - uses: redhat-actions/push-to-registry@v2 - with: + - name: Setup and Build + id: build_image + uses: redhat-actions/s2i-build@v2 + with: + path_context: ${{ matrix.PATH }} + # Builder image for a java project + builder_image: ${{ matrix.BUILDER_IMAGE }} + image: dts-endorser-service/${{ matrix.service }} + tags: ${{ env.TAGS }} + if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + + - name: Push image + id: push + uses: redhat-actions/push-to-registry@v2 + with: tags: ${{ steps.build_image.outputs.tags }} image: ${{ steps.build_image.outputs.image }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} registry: ghcr.io/bcgov - if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - - - name: Print image url - id: digests - run: | - echo "registry_path=${{ steps.push.outputs.registry-paths }}" - echo "digest=${{ steps.push.outputs.digest }}" - echo "${service}_digest=${digest}" >> $GITHUB_OUTPUT - if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - env: - service: ${{ matrix.service }} + if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + + - name: Print image url + id: digests + run: | + echo "registry_path=${{ steps.push.outputs.registry-paths }}" + echo "digest=${{ steps.push.outputs.digest }}" + echo "${matrix.service}_digest=$digest\n" >> $GITHUB_OUTPUT + if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - - name: Display image results - id: digest - run: | - echo 'imageid=${{ steps.docker_build.outputs.imageid }}' - echo 'digest=${{ steps.docker_build.outputs.digest }}' - echo "${service}_digest=${digest}" >> $GITHUB_OUTPUT - if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) - env: - service: ${{ matrix.service }} + - name: Display image results + id: digest + run: | + echo 'imageid=${{ steps.docker_build.outputs.imageid }}' + echo 'digest=${{ steps.docker_build.outputs.digest }}' + echo "${matrix.service}_digest=$digest\n" >> $GITHUB_OUTPUT + if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) deploy2dev: needs: build env: ENVIRONMENT: dev + aries-endorser-agent_digest : ${{ needs.build.outputs.aries-endorser-agent_digest }} + aries-endorser-db_digest : ${{ needs.build.outputs.aries-endorser-db_digest }} + aries-endorser-api_digest : ${{ needs.build.outputs.aries-endorser-api_digest }} + # aries-endorser-proxy_digest : ${{ needs.build.outputs.aries-endorser-proxy_digest }} + aries-endorser-backup_digest : ${{ needs.build.outputs.aries-endorser-backup_digest }} permissions: packages: write runs-on: ubuntu-latest @@ -179,19 +177,19 @@ jobs: matrix: include: - service: aries-endorser-agent - - service: aries-endorser-db - - service: aries-endorser-backup - - service: aries-endorser-api + # - service: aries-endorser-db + # - service: aries-endorser-backup + # # - service: aries-endorser-proxy + # - service: aries-endorser-api steps: - name: id run: | - echo '${need_small}' + echo "${digest}" env: - need_small: ${{ needs }} - + digest: ${{ env.aries-endorser-api_digest}} - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v3 - name: Deploy to ${{ env.ENVIRONMENT }} uses: ./.github/workflows/actions/deploy @@ -199,9 +197,76 @@ jobs: environment: ${{ env.ENVIRONMENT }} ghcr_token: ${{ secrets.GITHUB_TOKEN }} github_image_name: ${{ env.GITHUB_IMAGE_REPO }}/${{ matrix.service }} - image_digest: ${{ needs.build.outputs[format('{0}_digest', matrix.service)] }} + image_digest: ${{ needs.build.outputs.aries-endorser-agent_digest }} openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}/${{ matrix.service }} openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} namespace: ${{ vars.NAMESPACE }} - deployment_configuration: ${{ matrix.service }} + deploymentContext _configuration: ${{ matrix.service }} openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} + + # docker pull ghcr.io/bcgov/dts-endorser-service@sha256:57f946ab1053726ac6fcb71c85a98d355e926904ebe26db4798353668b3f6c68 + + # docker pull ghcr.io/bcgov/dts-endorser-service/aries-endorser-api:sha-e237467 + # docker pull ${{ inputs.github_image_name }}@${{ inputs.image_digest }} + # github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} + # GITHUB_IMAGE_REPO: ghcr.io/bcgov/dts-endorser-service + # docker pull ghcr.io/bcgov/dts-endorser-service + # github_image_name: ghcr.io/bcgov/dts-endorser-service + # docker push ghcr.io/bcgov/dts-endorser-service/aries-endorser-api + # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} + + # deploy2test: + # needs: [build, deploy2dev] + # env: + # ENVIRONMENT: test + # permissions: + # packages: write + # runs-on: ubuntu-latest + # environment: test + + # steps: + # - name: Checkout + # uses: actions/checkout@v3 + + # - name: deploy to ${{ env.ENVIRONMENT }} + # uses: ./.github/workflows/actions/deploy + # with: + # environment: ${{ env.ENVIRONMENT }} + # ghcr_token: ${{ secrets.GITHUB_TOKEN }} + # github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ env.APP_NAME }} + # image_digest: ${{ needs.build.outputs.image_digest }} + # openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ env.APP_NAME }} + # openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} + # namespace: ${{ vars.NAMESPACE }} + # deployment_configuration: ${{ env.APP_NAME }} + # openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} + # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} + + # deploy2prod: + # needs: [build, deploy2dev, deploy2test] + # env: + # ENVIRONMENT: prod + # permissions: + # packages: write + # runs-on: ubuntu-latest + # environment: prod + + # steps: + # - name: Checkout + # uses: actions/checkout@v3 + + # - name: deploy to prod + # uses: ./.github/workflows/actions/deploy + # with: + # environment: ${{ env.ENVIRONMENT }} + # ghcr_token: ${{ secrets.GITHUB_TOKEN }} + # github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ env.APP_NAME }} + # image_digest: ${{ needs.build.outputs.image_digest }} + # openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ env.APP_NAME }} + # openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} + # namespace: ${{ vars.NAMESPACE }} + # deployment_configuration: ${{ env.APP_NAME }} + # openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} + # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} + + # aries-endorser-db, aries-endorser-backup, aries-endorser-proxy, aries-endorser-api \ No newline at end of file From 8d1f3bec3e99c4a272253dff0d7e7ae58f59b6fa Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 25 Jan 2024 11:49:21 -0800 Subject: [PATCH 029/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 10ace325..3088a861 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -149,7 +149,7 @@ jobs: run: | echo "registry_path=${{ steps.push.outputs.registry-paths }}" echo "digest=${{ steps.push.outputs.digest }}" - echo "${matrix.service}_digest=$digest\n" >> $GITHUB_OUTPUT + echo "${matrix.service}_digest=$digest" >> $GITHUB_OUTPUT if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - name: Display image results @@ -157,7 +157,7 @@ jobs: run: | echo 'imageid=${{ steps.docker_build.outputs.imageid }}' echo 'digest=${{ steps.docker_build.outputs.digest }}' - echo "${matrix.service}_digest=$digest\n" >> $GITHUB_OUTPUT + echo "${matrix.service}_digest=$digest" >> $GITHUB_OUTPUT if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) deploy2dev: From 6d3a656d83c36a80ec6acd7ec932e13920b65a9a Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 25 Jan 2024 11:55:16 -0800 Subject: [PATCH 030/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 3088a861..5513066f 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -149,17 +149,20 @@ jobs: run: | echo "registry_path=${{ steps.push.outputs.registry-paths }}" echo "digest=${{ steps.push.outputs.digest }}" - echo "${matrix.service}_digest=$digest" >> $GITHUB_OUTPUT + echo "${service}_digest=${digest}" >> $GITHUB_OUTPUT if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + env: + service: ${{ matrix.service}} - name: Display image results id: digest run: | echo 'imageid=${{ steps.docker_build.outputs.imageid }}' echo 'digest=${{ steps.docker_build.outputs.digest }}' - echo "${matrix.service}_digest=$digest" >> $GITHUB_OUTPUT + echo "${service}_digest=${digest}" >> $GITHUB_OUTPUT if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) - + env: + service: ${{ matrix.service}} deploy2dev: needs: build env: From 07c06acfc750989e474a0d9c31e25081929dba52 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 25 Jan 2024 12:06:20 -0800 Subject: [PATCH 031/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 5513066f..536306a6 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -45,11 +45,11 @@ jobs: DOCKER_FILE_PATH: Dockerfile.endorser SOURCE_CONTEXT_DIR: endorser outputs: - aries-endorser-agent_digest: ${{steps.digest.outputs.aries-endorser-agent_digest}} - aries-endorser-backup_digest: ${{steps.digest.outputs.aries-endorser-backup_digest}} - aries-endorser-api_digest: ${{steps.digest.outputs.aries-endorser-api_digest}} - aries-endorser-db_digest: ${{steps.digests.outputs.aries-endorser-db_digest}} - image_digest: ${{steps.docker_build.outputs.digest}} + aries-endorser-agent_digest: ${{ steps.digest.outputs.aries-endorser-agent_digest }} + aries-endorser-backup_digest: ${{ steps.digest.outputs.aries-endorser-backup_digest }} + aries-endorser-api_digest: ${{ steps.digest.outputs.aries-endorser-api_digest }} + aries-endorser-db_digest: ${{ steps.digests.outputs.aries-endorser-db_digest }} + image_digest: ${{ steps.docker_build.outputs.digest }} steps: - name: Checkout uses: actions/checkout@v4 From b6e63859d940d08c4082ce6dd5cab24a512ef691 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 25 Jan 2024 12:08:04 -0800 Subject: [PATCH 032/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 536306a6..7ffd0130 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -190,7 +190,7 @@ jobs: run: | echo "${digest}" env: - digest: ${{ env.aries-endorser-api_digest}} + digest: ${{ env.aries-endorser-api_digest }} - name: Checkout uses: actions/checkout@v3 From 312c3d03f27eccc6fc77879a8dee69603ce47a94 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 25 Jan 2024 13:07:28 -0800 Subject: [PATCH 033/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 7ffd0130..04f41a60 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -44,6 +44,7 @@ jobs: GIT_REPO_URL: bcgov/aries-endorser-service DOCKER_FILE_PATH: Dockerfile.endorser SOURCE_CONTEXT_DIR: endorser + outputs: aries-endorser-agent_digest: ${{ steps.digest.outputs.aries-endorser-agent_digest }} aries-endorser-backup_digest: ${{ steps.digest.outputs.aries-endorser-backup_digest }} @@ -163,6 +164,7 @@ jobs: if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) env: service: ${{ matrix.service}} + deploy2dev: needs: build env: @@ -182,7 +184,7 @@ jobs: - service: aries-endorser-agent # - service: aries-endorser-db # - service: aries-endorser-backup - # # - service: aries-endorser-proxy + # - service: aries-endorser-proxy # - service: aries-endorser-api steps: @@ -204,7 +206,7 @@ jobs: openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}/${{ matrix.service }} openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} namespace: ${{ vars.NAMESPACE }} - deploymentContext _configuration: ${{ matrix.service }} + deployment_configuration: ${{ matrix.service }} openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} # docker pull ghcr.io/bcgov/dts-endorser-service@sha256:57f946ab1053726ac6fcb71c85a98d355e926904ebe26db4798353668b3f6c68 From 90cb55db645c26ddbc9e5a7e942e041679dc92e7 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 25 Jan 2024 13:38:36 -0800 Subject: [PATCH 034/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 04f41a60..c6f1c162 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -161,6 +161,7 @@ jobs: echo 'imageid=${{ steps.docker_build.outputs.imageid }}' echo 'digest=${{ steps.docker_build.outputs.digest }}' echo "${service}_digest=${digest}" >> $GITHUB_OUTPUT + cat $GITHUB_OUTPUT if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) env: service: ${{ matrix.service}} @@ -191,8 +192,10 @@ jobs: - name: id run: | echo "${digest}" + echo "${needs}" env: digest: ${{ env.aries-endorser-api_digest }} + new: ${{ fromJson(needs.build )}} - name: Checkout uses: actions/checkout@v3 From 4dda4ae7eab807a1154f728e0e908c37cb73af5f Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 25 Jan 2024 13:44:23 -0800 Subject: [PATCH 035/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index c6f1c162..28b986e1 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -150,6 +150,7 @@ jobs: run: | echo "registry_path=${{ steps.push.outputs.registry-paths }}" echo "digest=${{ steps.push.outputs.digest }}" + digest=${{ steps.push.outputs.digest }} echo "${service}_digest=${digest}" >> $GITHUB_OUTPUT if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) env: @@ -160,6 +161,7 @@ jobs: run: | echo 'imageid=${{ steps.docker_build.outputs.imageid }}' echo 'digest=${{ steps.docker_build.outputs.digest }}' + digest=${{ steps.docker_build.outputs.digest }} echo "${service}_digest=${digest}" >> $GITHUB_OUTPUT cat $GITHUB_OUTPUT if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) @@ -195,7 +197,7 @@ jobs: echo "${needs}" env: digest: ${{ env.aries-endorser-api_digest }} - new: ${{ fromJson(needs.build )}} + new: ${{ fromJson(needs.build) }} - name: Checkout uses: actions/checkout@v3 From 53502df3679fd4a4cc3bef22da57e482b7dbbbd7 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 25 Jan 2024 13:47:18 -0800 Subject: [PATCH 036/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 28b986e1..c6c5f53a 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -194,10 +194,8 @@ jobs: - name: id run: | echo "${digest}" - echo "${needs}" env: digest: ${{ env.aries-endorser-api_digest }} - new: ${{ fromJson(needs.build) }} - name: Checkout uses: actions/checkout@v3 From d6f9ed88c5465060c080b8ba10c5171f8128a1d5 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 25 Jan 2024 13:59:12 -0800 Subject: [PATCH 037/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index c6c5f53a..7242f821 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -11,8 +11,8 @@ concurrency: cancel-in-progress: true env: - GITHUB_IMAGE_REPO: ghcr.io/bcgov/dts-endorser-service - OPENSHIFT_IMAGE_REPO: image-registry.apps.silver.devops.gov.bc.ca/4a9599-tools + GITHUB_IMAGE_REPO: ghcr.io/bcgov/dts-endorser-service/ + OPENSHIFT_IMAGE_REPO: image-registry.apps.silver.devops.gov.bc.ca/4a9599-tools/ APP_NAMES: aries-endorser-agent,aries-endorser-db,aries-endorser-backup,aries-endorser-proxy,aries-endorser-api TAGS: v1 ${{ github.sha }} jobs: @@ -204,9 +204,9 @@ jobs: with: environment: ${{ env.ENVIRONMENT }} ghcr_token: ${{ secrets.GITHUB_TOKEN }} - github_image_name: ${{ env.GITHUB_IMAGE_REPO }}/${{ matrix.service }} + github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} image_digest: ${{ needs.build.outputs.aries-endorser-agent_digest }} - openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}/${{ matrix.service }} + openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }} openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} namespace: ${{ vars.NAMESPACE }} deployment_configuration: ${{ matrix.service }} From d662c1c8b11cfaa3288db6ce10d7b7332a7e974d Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 25 Jan 2024 14:10:11 -0800 Subject: [PATCH 038/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 7242f821..b73504de 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -206,7 +206,7 @@ jobs: ghcr_token: ${{ secrets.GITHUB_TOKEN }} github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} image_digest: ${{ needs.build.outputs.aries-endorser-agent_digest }} - openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }} + openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }} openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} namespace: ${{ vars.NAMESPACE }} deployment_configuration: ${{ matrix.service }} From f7968f7af41457e90dde6b4ec432aace64fb81a6 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 25 Jan 2024 14:22:07 -0800 Subject: [PATCH 039/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/actions/deploy/action.yaml | 2 +- .github/workflows/main.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/actions/deploy/action.yaml b/.github/workflows/actions/deploy/action.yaml index 91f8cc05..224da9ae 100644 --- a/.github/workflows/actions/deploy/action.yaml +++ b/.github/workflows/actions/deploy/action.yaml @@ -79,7 +79,7 @@ runs: run: | docker pull ${{ inputs.github_image_name }}@${{ inputs.image_digest }} docker tag ${{ inputs.github_image_name }}@${{ inputs.image_digest }} ${{ inputs.openshift_image_name }}:${{ inputs.environment }} - docker push ${{ inputs.openshift_image_name}}${{ matrix.service }}:${{ inputs.environment }} + docker push ${{ inputs.openshift_image_name}}:${{ inputs.environment }} - name: Trigger OpenShift rollout shell: bash diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index b73504de..7242f821 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -206,7 +206,7 @@ jobs: ghcr_token: ${{ secrets.GITHUB_TOKEN }} github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} image_digest: ${{ needs.build.outputs.aries-endorser-agent_digest }} - openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }} + openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }} openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} namespace: ${{ vars.NAMESPACE }} deployment_configuration: ${{ matrix.service }} From b0df30bc9521c82fec5233bdff955795de7cbe4f Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Sun, 28 Jan 2024 20:23:10 -0800 Subject: [PATCH 040/162] moving from jenkins to gha Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 82 ++++++++++++++++++------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 7242f821..5f6c2bc6 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -26,29 +26,30 @@ jobs: matrix: include: - service: aries-endorser-agent - GIT_REPO_URL: bcgov/aries-endorser-service - SOURCE_CONTEXT_DIR: docker/acapy - DOCKER_FILE_PATH: Dockerfile.acapy + GIT_REPO_URL: bcgov/aries-endorser-service + DOCKER_FILE_PATH: Dockerfile.acapy # The docker path, file, is the relative path to the docker file from the root of the repo. + SOURCE_CONTEXT_DIR: docker/acapy # The context dir, context, sets the context for the build. i.e. where the build will source files from - service: aries-endorser-db GIT_REPO_URL: bcgov/aries-endorser-service PATH: docker/wallet/config BUILDER_IMAGE: 'quay.io/fedora/postgresql-13:13' - service: aries-endorser-backup GIT_REPO_URL: BCDevOps/backup-container - DOCKER_FILE_PATH: Dockerfile - SOURCE_CONTEXT_DIR: docker - # - service: aries-endorser-proxy - # DOCKER_FILE_PATH: Dockerfile - # SOURCE_CONTEXT_DIR: proxy + DOCKER_FILE_PATH: Dockerfile # The docker path, file, is the relative path to the docker file from the root of the repo. + SOURCE_CONTEXT_DIR: docker # The context dir, context, sets the context for the build. i.e. where the build will source files from + - service: aries-endorser-proxy + DOCKER_FILE_PATH: Dockerfile # The docker path, file, is the relative path to the docker file from the root of the repo. + SOURCE_CONTEXT_DIR: proxy # The context dir, context, sets the context for the build. i.e. where the build will source files from - service: aries-endorser-api GIT_REPO_URL: bcgov/aries-endorser-service - DOCKER_FILE_PATH: Dockerfile.endorser - SOURCE_CONTEXT_DIR: endorser + DOCKER_FILE_PATH: Dockerfile.endorser # The docker path, file, is the relative path to the docker file from the root of the repo. + SOURCE_CONTEXT_DIR: endorser # The context dir, context, sets the context for the build. i.e. where the build will source files from outputs: aries-endorser-agent_digest: ${{ steps.digest.outputs.aries-endorser-agent_digest }} aries-endorser-backup_digest: ${{ steps.digest.outputs.aries-endorser-backup_digest }} aries-endorser-api_digest: ${{ steps.digest.outputs.aries-endorser-api_digest }} + aries-endorser-proxy_digest: ${{ steps.digest.outputs.aries-endorser-proxy_digest }} aries-endorser-db_digest: ${{ steps.digests.outputs.aries-endorser-db_digest }} image_digest: ${{ steps.docker_build.outputs.digest }} steps: @@ -57,17 +58,30 @@ jobs: with: repository: ${{ matrix.GIT_REPO_URL }} - - name: List Directories - run: | - ls -l - echo $service env: service: ${{ matrix.service }} - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 + + - name: Pull base image for proxy and Create Docker file + run: | + docker login -u $REGISTRY_USERNAME -p $REGISTRY_PASSWORD $SOURCE_IMAGE_REGISTRY + BASE_IMAGE=${SOURCE_IMAGE_REGISTRY}${SOURCE_IMAGE_NAME}:${SOURCE_IMAGE_TAG} + docker pull "${BASE_IMAGE}" + mkdir ${context} && cd ${context} + echo "FROM ${BASE_IMAGE}" > Dockerfile + echo "RUN chown 1001:root /usr/bin/caddy" >> Dockerfile + if: contains(fromJSON('["aries-endorser-proxy"]'), matrix.service) + env: + context: ${{ matrix.SOURCE_CONTEXT_DIR }} + SOURCE_IMAGE_REGISTRY: "artifacts.developer.gov.bc.ca/docker-remote/" + SOURCE_IMAGE_NAME: caddy + SOURCE_IMAGE_TAG: latest + REGISTRY_USERNAME: ${{ secrets.USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.PASSWORD }} - name: Log in to the GHCR - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} @@ -75,7 +89,7 @@ jobs: - name: Prepare docker tags for image id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: ghcr.io/bcgov/dts-endorser-service/${{ matrix.service }} flavor: | @@ -91,20 +105,10 @@ jobs: if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) env: service: ${{ matrix.service }} - - - name: Create Docker file - run: | - mkdir ${context} && cd ${context} - echo "FROM ${BASE_IMAGE}" > Dockerfile - echo "RUN chown 1001:root /usr/bin/caddy" >> Dockerfile - if: contains(fromJSON('["aries-endorser-proxy"]'), matrix.service) - env: - context: ${{ matrix.SOURCE_CONTEXT_DIR }} - BASE_IMAGE: "artifacts.developer.gov.bc.ca/docker-remote/caddy:latest" - + - name: Build and push Docker image id: docker_build - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: ${{ matrix.SOURCE_CONTEXT_DIR }} file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} @@ -175,7 +179,7 @@ jobs: aries-endorser-agent_digest : ${{ needs.build.outputs.aries-endorser-agent_digest }} aries-endorser-db_digest : ${{ needs.build.outputs.aries-endorser-db_digest }} aries-endorser-api_digest : ${{ needs.build.outputs.aries-endorser-api_digest }} - # aries-endorser-proxy_digest : ${{ needs.build.outputs.aries-endorser-proxy_digest }} + aries-endorser-proxy_digest : ${{ needs.build.outputs.aries-endorser-proxy_digest }} aries-endorser-backup_digest : ${{ needs.build.outputs.aries-endorser-backup_digest }} permissions: packages: write @@ -185,19 +189,15 @@ jobs: matrix: include: - service: aries-endorser-agent - # - service: aries-endorser-db - # - service: aries-endorser-backup - # - service: aries-endorser-proxy - # - service: aries-endorser-api + - service: aries-endorser-db + - service: aries-endorser-backup + - service: aries-endorser-proxy + - service: aries-endorser-api steps: - - name: id - run: | - echo "${digest}" - env: - digest: ${{ env.aries-endorser-api_digest }} + - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Deploy to ${{ env.ENVIRONMENT }} uses: ./.github/workflows/actions/deploy @@ -205,7 +205,7 @@ jobs: environment: ${{ env.ENVIRONMENT }} ghcr_token: ${{ secrets.GITHUB_TOKEN }} github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} - image_digest: ${{ needs.build.outputs.aries-endorser-agent_digest }} + image_digest: ${{ needs.build.outputs[format ('{0}_digest', matrix.service)] }} openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }} openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} namespace: ${{ vars.NAMESPACE }} From 286c899c55efafee60c0171a89b1b3df922797c2 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Sun, 28 Jan 2024 20:34:11 -0800 Subject: [PATCH 041/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 5f6c2bc6..3db8acf4 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -30,7 +30,7 @@ jobs: DOCKER_FILE_PATH: Dockerfile.acapy # The docker path, file, is the relative path to the docker file from the root of the repo. SOURCE_CONTEXT_DIR: docker/acapy # The context dir, context, sets the context for the build. i.e. where the build will source files from - service: aries-endorser-db - GIT_REPO_URL: bcgov/aries-endorser-service + GIT_REPO_URL: bcgov/aries-endorser-service PATH: docker/wallet/config BUILDER_IMAGE: 'quay.io/fedora/postgresql-13:13' - service: aries-endorser-backup @@ -65,7 +65,7 @@ jobs: - name: Pull base image for proxy and Create Docker file run: | - docker login -u $REGISTRY_USERNAME -p $REGISTRY_PASSWORD $SOURCE_IMAGE_REGISTRY + docker login -u $REGISTRY_USERNAME -p $REGISTRY_PASSWORD $SOURCE_IMAGE_REGISTRY BASE_IMAGE=${SOURCE_IMAGE_REGISTRY}${SOURCE_IMAGE_NAME}:${SOURCE_IMAGE_TAG} docker pull "${BASE_IMAGE}" mkdir ${context} && cd ${context} @@ -75,7 +75,7 @@ jobs: env: context: ${{ matrix.SOURCE_CONTEXT_DIR }} SOURCE_IMAGE_REGISTRY: "artifacts.developer.gov.bc.ca/docker-remote/" - SOURCE_IMAGE_NAME: caddy + SOURCE_IMAGE_NAME: caddy SOURCE_IMAGE_TAG: latest REGISTRY_USERNAME: ${{ secrets.USERNAME }} REGISTRY_PASSWORD: ${{ secrets.PASSWORD }} @@ -111,7 +111,7 @@ jobs: uses: docker/build-push-action@v5 with: context: ${{ matrix.SOURCE_CONTEXT_DIR }} - file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} + file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} @@ -176,11 +176,11 @@ jobs: needs: build env: ENVIRONMENT: dev - aries-endorser-agent_digest : ${{ needs.build.outputs.aries-endorser-agent_digest }} - aries-endorser-db_digest : ${{ needs.build.outputs.aries-endorser-db_digest }} - aries-endorser-api_digest : ${{ needs.build.outputs.aries-endorser-api_digest }} - aries-endorser-proxy_digest : ${{ needs.build.outputs.aries-endorser-proxy_digest }} - aries-endorser-backup_digest : ${{ needs.build.outputs.aries-endorser-backup_digest }} + aries-endorser-agent_digest: ${{ needs.build.outputs.aries-endorser-agent_digest }} + aries-endorser-db_digest: ${{ needs.build.outputs.aries-endorser-db_digest }} + aries-endorser-api_digest: ${{ needs.build.outputs.aries-endorser-api_digest }} + aries-endorser-proxy_digest: ${{ needs.build.outputs.aries-endorser-proxy_digest }} + aries-endorser-backup_digest: ${{ needs.build.outputs.aries-endorser-backup_digest }} permissions: packages: write runs-on: ubuntu-latest @@ -195,7 +195,6 @@ jobs: - service: aries-endorser-api steps: - - name: Checkout uses: actions/checkout@v4 From 7c4ea59e9c450e22672284e3cf0d1cabdf79d63a Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Mon, 29 Jan 2024 10:19:45 -0800 Subject: [PATCH 042/162] adding rocket chat notification Signed-off-by: Rajpal Chauhan --- .github/workflows/actions/deploy/action.yaml | 35 +++++++++----------- .github/workflows/main.yaml | 1 + 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/.github/workflows/actions/deploy/action.yaml b/.github/workflows/actions/deploy/action.yaml index 224da9ae..ade40426 100644 --- a/.github/workflows/actions/deploy/action.yaml +++ b/.github/workflows/actions/deploy/action.yaml @@ -14,14 +14,11 @@ inputs: description: The name of the image in the GHCR to be deployed. required: true image_digest: - description: The digest of the image to be deployed. Identifies the unique image tag in the GHCR. + description: The digest of the image to be deployed. Identifies the unique image tag in the GHCR. required: true openshift_image_name: description: The name of the image to use when pushing to OpenShift. required: true - service: - description: The name of images used - required: true # OpenShift parameters openshift_server_url: @@ -37,10 +34,10 @@ inputs: description: The token used to authenticate with the OpenShift server. required: true - # rocket.chat notification parameters - # rocketchat_webhook: - # description: The URL to use for posting notifications to rocket.chat. - # required: true + rocket.chat notification parameters + rocketchat_webhook: + description: The URL to use for posting notifications to rocket.chat. + required: true runs: using: composite @@ -87,14 +84,14 @@ runs: echo starting rollout in ${{ inputs.namespace }} oc -n ${{ inputs.namespace }} rollout status dc/${{ inputs.deployment_configuration }} --watch - # - name: Rocket.Chat Notification - # uses: RocketChat/Rocket.Chat.GitHub.Action.Notification@1.1.1 - # if: always() - # with: - # type: ${{ job.status }} - # job_name: '*Deployment to ${{ inputs.environment }}*' - # mention: 'here' - # mention_if: 'failure' - # channel: '#test-gha' - # url: ${{ inputs.rocketchat_webhook }} - # commit: true \ No newline at end of file + - name: Rocket.Chat Notification + uses: RocketChat/Rocket.Chat.GitHub.Action.Notification@1.1.1 + if: always() + with: + type: ${{ job.status }} + job_name: '*Deployment to ${{ inputs.environment }}*' + mention: 'here' + mention_if: 'failure' + channel: '#ditp-gha-notifications' + url: ${{ inputs.rocketchat_webhook }} + commit: true \ No newline at end of file diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 3db8acf4..e36ad53f 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -210,6 +210,7 @@ jobs: namespace: ${{ vars.NAMESPACE }} deployment_configuration: ${{ matrix.service }} openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} + rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} # docker pull ghcr.io/bcgov/dts-endorser-service@sha256:57f946ab1053726ac6fcb71c85a98d355e926904ebe26db4798353668b3f6c68 From 6c6aab2a6d1909d521b58ef758fd88360fa4ac86 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Mon, 29 Jan 2024 10:23:52 -0800 Subject: [PATCH 043/162] quick fix Signed-off-by: Rajpal Chauhan --- .github/workflows/actions/deploy/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/actions/deploy/action.yaml b/.github/workflows/actions/deploy/action.yaml index ade40426..44b922a0 100644 --- a/.github/workflows/actions/deploy/action.yaml +++ b/.github/workflows/actions/deploy/action.yaml @@ -34,7 +34,7 @@ inputs: description: The token used to authenticate with the OpenShift server. required: true - rocket.chat notification parameters + # rocket.chat notification parameters rocketchat_webhook: description: The URL to use for posting notifications to rocket.chat. required: true From cba4571370008b693d8a1c829eabcccd2972bcde Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Tue, 30 Jan 2024 23:44:53 -0800 Subject: [PATCH 044/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/actions/deploy/action.yaml | 2 +- .github/workflows/main.yaml | 126 +++++++++---------- 2 files changed, 57 insertions(+), 71 deletions(-) diff --git a/.github/workflows/actions/deploy/action.yaml b/.github/workflows/actions/deploy/action.yaml index 44b922a0..f659da80 100644 --- a/.github/workflows/actions/deploy/action.yaml +++ b/.github/workflows/actions/deploy/action.yaml @@ -69,7 +69,7 @@ runs: run: | docker pull ${{ inputs.github_image_name }}@${{ inputs.image_digest }} docker tag ${{ inputs.github_image_name }}@${{ inputs.image_digest }} ${{ inputs.github_image_name }}:${{ inputs.environment }} - docker push ${{ inputs.github_image_name }}${{ inputs.matrix_service }}:${{ inputs.environment }} + docker push ${{ inputs.github_image_name }}:${{ inputs.environment }} - name: Tag the image in the OpenShift container registry as ${{ inputs.environment }} shell: bash diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index e36ad53f..81945ef5 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -13,8 +13,8 @@ concurrency: env: GITHUB_IMAGE_REPO: ghcr.io/bcgov/dts-endorser-service/ OPENSHIFT_IMAGE_REPO: image-registry.apps.silver.devops.gov.bc.ca/4a9599-tools/ - APP_NAMES: aries-endorser-agent,aries-endorser-db,aries-endorser-backup,aries-endorser-proxy,aries-endorser-api - TAGS: v1 ${{ github.sha }} + APP_NAMES: aries-endorser-agent,aries-endorser-db,aries-endorser-backup,aries-endorser-proxy,aries-endorser-api + jobs: build: if: (github.repository == 'bcgov/dts-endorser-service') || (github.event_name == 'workflow_dispatch') @@ -26,11 +26,11 @@ jobs: matrix: include: - service: aries-endorser-agent - GIT_REPO_URL: bcgov/aries-endorser-service + GIT_REPO_URL: hyperledger/aries-endorser-service DOCKER_FILE_PATH: Dockerfile.acapy # The docker path, file, is the relative path to the docker file from the root of the repo. SOURCE_CONTEXT_DIR: docker/acapy # The context dir, context, sets the context for the build. i.e. where the build will source files from - service: aries-endorser-db - GIT_REPO_URL: bcgov/aries-endorser-service + GIT_REPO_URL: hyperledger/aries-endorser-service PATH: docker/wallet/config BUILDER_IMAGE: 'quay.io/fedora/postgresql-13:13' - service: aries-endorser-backup @@ -41,7 +41,7 @@ jobs: DOCKER_FILE_PATH: Dockerfile # The docker path, file, is the relative path to the docker file from the root of the repo. SOURCE_CONTEXT_DIR: proxy # The context dir, context, sets the context for the build. i.e. where the build will source files from - service: aries-endorser-api - GIT_REPO_URL: bcgov/aries-endorser-service + GIT_REPO_URL: hyperledger/aries-endorser-service DOCKER_FILE_PATH: Dockerfile.endorser # The docker path, file, is the relative path to the docker file from the root of the repo. SOURCE_CONTEXT_DIR: endorser # The context dir, context, sets the context for the build. i.e. where the build will source files from @@ -51,19 +51,18 @@ jobs: aries-endorser-api_digest: ${{ steps.digest.outputs.aries-endorser-api_digest }} aries-endorser-proxy_digest: ${{ steps.digest.outputs.aries-endorser-proxy_digest }} aries-endorser-db_digest: ${{ steps.digests.outputs.aries-endorser-db_digest }} - image_digest: ${{ steps.docker_build.outputs.digest }} + steps: - name: Checkout uses: actions/checkout@v4 with: repository: ${{ matrix.GIT_REPO_URL }} - env: - service: ${{ matrix.service }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Pull base image for proxy and Create Docker file + - name: Pull base image for proxy and Create Docker file + if: contains(fromJSON('["aries-endorser-proxy"]'), matrix.service) run: | docker login -u $REGISTRY_USERNAME -p $REGISTRY_PASSWORD $SOURCE_IMAGE_REGISTRY BASE_IMAGE=${SOURCE_IMAGE_REGISTRY}${SOURCE_IMAGE_NAME}:${SOURCE_IMAGE_TAG} @@ -71,14 +70,13 @@ jobs: mkdir ${context} && cd ${context} echo "FROM ${BASE_IMAGE}" > Dockerfile echo "RUN chown 1001:root /usr/bin/caddy" >> Dockerfile - if: contains(fromJSON('["aries-endorser-proxy"]'), matrix.service) env: context: ${{ matrix.SOURCE_CONTEXT_DIR }} SOURCE_IMAGE_REGISTRY: "artifacts.developer.gov.bc.ca/docker-remote/" SOURCE_IMAGE_NAME: caddy SOURCE_IMAGE_TAG: latest - REGISTRY_USERNAME: ${{ secrets.USERNAME }} - REGISTRY_PASSWORD: ${{ secrets.PASSWORD }} + REGISTRY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} - name: Log in to the GHCR uses: docker/login-action@v3 @@ -102,9 +100,7 @@ jobs: type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} type=sha,value=latest - if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) - env: - service: ${{ matrix.service }} + if: contains(fromJSON('["aries-endorser-db",aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy,"]'), matrix.service) - name: Build and push Docker image id: docker_build @@ -119,15 +115,12 @@ jobs: cache-to: type=gha,mode=max if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) - - name: Pull base image - id: pull_build_image + - name: Pull database image run: | - docker pull ${builder_image} - env: - builder_image: ${{ matrix.BUILDER_IMAGE }} + docker pull ${{ matrix.BUILDER_IMAGE }} if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - - name: Setup and Build + - name: Build database image id: build_image uses: redhat-actions/s2i-build@v2 with: @@ -135,10 +128,10 @@ jobs: # Builder image for a java project builder_image: ${{ matrix.BUILDER_IMAGE }} image: dts-endorser-service/${{ matrix.service }} - tags: ${{ env.TAGS }} + tags: ${{ steps.meta.outputs.tags }} if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - - name: Push image + - name: Push database image id: push uses: redhat-actions/push-to-registry@v2 with: @@ -149,68 +142,61 @@ jobs: registry: ghcr.io/bcgov if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - - name: Print image url + - name: Display ${{ matrix.service }} image results id: digests run: | echo "registry_path=${{ steps.push.outputs.registry-paths }}" - echo "digest=${{ steps.push.outputs.digest }}" digest=${{ steps.push.outputs.digest }} - echo "${service}_digest=${digest}" >> $GITHUB_OUTPUT + echo 'digest=${digest}' + echo "${{ matrix.service }}_digest=${digest}" >> $GITHUB_OUTPUT if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - env: - service: ${{ matrix.service}} - - name: Display image results + - name: Display ${{ matrix.service}} image results id: digest run: | echo 'imageid=${{ steps.docker_build.outputs.imageid }}' - echo 'digest=${{ steps.docker_build.outputs.digest }}' digest=${{ steps.docker_build.outputs.digest }} - echo "${service}_digest=${digest}" >> $GITHUB_OUTPUT + echo 'digest=${digest}' + echo "${{ matrix.service }}_digest=${digest}" >> $GITHUB_OUTPUT cat $GITHUB_OUTPUT if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) - env: - service: ${{ matrix.service}} - deploy2dev: - needs: build - env: - ENVIRONMENT: dev - aries-endorser-agent_digest: ${{ needs.build.outputs.aries-endorser-agent_digest }} - aries-endorser-db_digest: ${{ needs.build.outputs.aries-endorser-db_digest }} - aries-endorser-api_digest: ${{ needs.build.outputs.aries-endorser-api_digest }} - aries-endorser-proxy_digest: ${{ needs.build.outputs.aries-endorser-proxy_digest }} - aries-endorser-backup_digest: ${{ needs.build.outputs.aries-endorser-backup_digest }} - permissions: - packages: write - runs-on: ubuntu-latest - environment: dev - strategy: - matrix: - include: - - service: aries-endorser-agent - - service: aries-endorser-db - - service: aries-endorser-backup - - service: aries-endorser-proxy - - service: aries-endorser-api + # deploy2dev: + # needs: build + # env: + # ENVIRONMENT: dev + # permissions: + # packages: write + # runs-on: ubuntu-latest + # environment: dev + # strategy: + # # Serialize the deployments + # max-parallel: 1 + # matrix: + # include: + # - service: aries-endorser-db + # - service: aries-endorser-agent + # - service: aries-endorser-backup + # - service: aries-endorser-proxy + # - service: aries-endorser-api - steps: - - name: Checkout - uses: actions/checkout@v4 + # steps: + # - name: Checkout + # uses: actions/checkout@v4 - - name: Deploy to ${{ env.ENVIRONMENT }} - uses: ./.github/workflows/actions/deploy - with: - environment: ${{ env.ENVIRONMENT }} - ghcr_token: ${{ secrets.GITHUB_TOKEN }} - github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} - image_digest: ${{ needs.build.outputs[format ('{0}_digest', matrix.service)] }} - openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }} - openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} - namespace: ${{ vars.NAMESPACE }} - deployment_configuration: ${{ matrix.service }} - openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} - rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} + # - name: Deploy to ${{ env.ENVIRONMENT }} + # uses: ./.github/workflows/actions/deploy + # with: + # environment: ${{ env.ENVIRONMENT }} + # ghcr_token: ${{ secrets.GITHUB_TOKEN }} + # github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} + # image_digest: ${{ needs.build.outputs[format ('{0}_digest', matrix.service)] }} + # openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }} + # openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} + # namespace: ${{ vars.NAMESPACE }} + # deployment_configuration: ${{ matrix.service }} + # openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} + # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} # docker pull ghcr.io/bcgov/dts-endorser-service@sha256:57f946ab1053726ac6fcb71c85a98d355e926904ebe26db4798353668b3f6c68 From fadde47f269ea13b3d5ee7a182b2c4d95e6e51ac Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Tue, 30 Jan 2024 23:52:39 -0800 Subject: [PATCH 045/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 81945ef5..3f93b635 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -161,6 +161,7 @@ jobs: cat $GITHUB_OUTPUT if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) + # deploy2dev: # needs: build # env: From ff3a2cd0914b1e2b60cb23f9410325bc166c28c1 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 31 Jan 2024 10:04:15 -0800 Subject: [PATCH 046/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 3f93b635..f040a543 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -87,6 +87,7 @@ jobs: - name: Prepare docker tags for image id: meta + if: contains(fromJSON('["aries-endorser-db",aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy,"]'), matrix.service) uses: docker/metadata-action@v5 with: images: ghcr.io/bcgov/dts-endorser-service/${{ matrix.service }} @@ -100,10 +101,10 @@ jobs: type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} type=sha,value=latest - if: contains(fromJSON('["aries-endorser-db",aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy,"]'), matrix.service) - name: Build and push Docker image id: docker_build + if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) uses: docker/build-push-action@v5 with: context: ${{ matrix.SOURCE_CONTEXT_DIR }} @@ -113,15 +114,15 @@ jobs: labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max - if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) - name: Pull database image + if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) run: | docker pull ${{ matrix.BUILDER_IMAGE }} - if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - name: Build database image id: build_image + if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) uses: redhat-actions/s2i-build@v2 with: path_context: ${{ matrix.PATH }} @@ -129,10 +130,10 @@ jobs: builder_image: ${{ matrix.BUILDER_IMAGE }} image: dts-endorser-service/${{ matrix.service }} tags: ${{ steps.meta.outputs.tags }} - if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - name: Push database image id: push + if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) uses: redhat-actions/push-to-registry@v2 with: tags: ${{ steps.build_image.outputs.tags }} @@ -140,28 +141,26 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} registry: ghcr.io/bcgov - if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - name: Display ${{ matrix.service }} image results id: digests + if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) run: | echo "registry_path=${{ steps.push.outputs.registry-paths }}" digest=${{ steps.push.outputs.digest }} echo 'digest=${digest}' echo "${{ matrix.service }}_digest=${digest}" >> $GITHUB_OUTPUT - if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - name: Display ${{ matrix.service}} image results id: digest + if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) run: | echo 'imageid=${{ steps.docker_build.outputs.imageid }}' digest=${{ steps.docker_build.outputs.digest }} echo 'digest=${digest}' echo "${{ matrix.service }}_digest=${digest}" >> $GITHUB_OUTPUT cat $GITHUB_OUTPUT - if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) - # deploy2dev: # needs: build # env: From d1d267ad3307ec15338ae7ee2063ca5c3da4a879 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 31 Jan 2024 10:51:34 -0800 Subject: [PATCH 047/162] formatting fix Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index f040a543..c9db5904 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -87,7 +87,7 @@ jobs: - name: Prepare docker tags for image id: meta - if: contains(fromJSON('["aries-endorser-db",aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy,"]'), matrix.service) + if: contains(fromJSON('["aries-endorser-db","aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) uses: docker/metadata-action@v5 with: images: ghcr.io/bcgov/dts-endorser-service/${{ matrix.service }} From ccebc63182880b37fb961f1c245a3a935ce39fb0 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 1 Feb 2024 15:52:52 -0800 Subject: [PATCH 048/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index c9db5904..2dfd0f14 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -2,6 +2,14 @@ name: Build and Deploy Image on: workflow_dispatch: + inputs: + tag: + description: 'Define teh tag for the code' + required: false + branch: + description: 'Define branch name' + required: true + default: 'main' push: branches: - workflow @@ -57,6 +65,16 @@ jobs: uses: actions/checkout@v4 with: repository: ${{ matrix.GIT_REPO_URL }} + ref: ${{ github.event.tag }} + if: ${{ github.event.tag != '' }} + + - name: Checkout + uses: actions/checkout@v4 + with: + repository: ${{ matrix.GIT_REPO_URL }} + ref: ${{ github.event.branch }} + if: ${{ github.event.tag == '' }} + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -120,6 +138,11 @@ jobs: run: | docker pull ${{ matrix.BUILDER_IMAGE }} + - name: Extract Values + id: extract + if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + run: echo "tags=$(echo ${{ steps.meta.outputs.tags }} | | grep -oE ':([^[:space:]]+)' | sed 's/://g' | tr '\n' ' ') + - name: Build database image id: build_image if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) @@ -129,7 +152,7 @@ jobs: # Builder image for a java project builder_image: ${{ matrix.BUILDER_IMAGE }} image: dts-endorser-service/${{ matrix.service }} - tags: ${{ steps.meta.outputs.tags }} + tags: ${{ steps.extract.outputs.tags }} - name: Push database image id: push From 095f299cbb279165cae350097ef095f2b6b71035 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 1 Feb 2024 15:59:08 -0800 Subject: [PATCH 049/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 2dfd0f14..e5648b6f 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -141,7 +141,7 @@ jobs: - name: Extract Values id: extract if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - run: echo "tags=$(echo ${{ steps.meta.outputs.tags }} | | grep -oE ':([^[:space:]]+)' | sed 's/://g' | tr '\n' ' ') + run: echo "tags=$(echo ${{ steps.meta.outputs.tags }} | grep -oE ':([^[:space:]]+)' | sed 's/://g' | tr '\n' ' ') - name: Build database image id: build_image From 9f6e2fa750a4b91fe3a42744d719398d9195e060 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 1 Feb 2024 16:01:19 -0800 Subject: [PATCH 050/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index e5648b6f..b1357bcc 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -141,7 +141,7 @@ jobs: - name: Extract Values id: extract if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - run: echo "tags=$(echo ${{ steps.meta.outputs.tags }} | grep -oE ':([^[:space:]]+)' | sed 's/://g' | tr '\n' ' ') + run: echo "tags=$(echo ${{ steps.meta.outputs.tags }} | grep -oE ':([^[:space:]]+)' | sed 's/://g' | tr '\n' ' ')" - name: Build database image id: build_image From ed4c06fcc4cf0abf3467facb3c039e8d8b1512fd Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 1 Feb 2024 16:07:11 -0800 Subject: [PATCH 051/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index b1357bcc..ab17285e 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -141,7 +141,7 @@ jobs: - name: Extract Values id: extract if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - run: echo "tags=$(echo ${{ steps.meta.outputs.tags }} | grep -oE ':([^[:space:]]+)' | sed 's/://g' | tr '\n' ' ')" + run: echo "tags=$(echo '${{ steps.meta.outputs.tags }}' | grep -oE ':([^[:space:]]+)' | sed 's/://g' | tr '\n' ' ')" - name: Build database image id: build_image From 51e3cffbdd9f61030d04fe36488a163c1179eca1 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 1 Feb 2024 16:13:48 -0800 Subject: [PATCH 052/162] TEST Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index ab17285e..aead361b 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -141,7 +141,7 @@ jobs: - name: Extract Values id: extract if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - run: echo "tags=$(echo '${{ steps.meta.outputs.tags }}' | grep -oE ':([^[:space:]]+)' | sed 's/://g' | tr '\n' ' ')" + run: echo "tags=$(echo '${{ steps.meta.outputs.tags }}' | grep -oE ':([^[:space:]]+)' | sed 's/://g' | tr '\n' ' ')" >> $GITHUB_OUTPUT - name: Build database image id: build_image From b5cac31fc6f0662220da5ce79fb7f82b92ba9882 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 1 Feb 2024 16:26:04 -0800 Subject: [PATCH 053/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index aead361b..6f9bd484 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -141,7 +141,7 @@ jobs: - name: Extract Values id: extract if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - run: echo "tags=$(echo '${{ steps.meta.outputs.tags }}' | grep -oE ':([^[:space:]]+)' | sed 's/://g' | tr '\n' ' ')" >> $GITHUB_OUTPUT + run: echo "tags=$(echo '${{ steps.meta.outputs.tags }}' | grep -oE ':([^[:space:]]+)' | sed '/workflow/d' | sed 's/://g' | tr '\n' ' ')" >> $GITHUB_OUTPUT - name: Build database image id: build_image From 4cc699bcf0d80ee0918d4fc1ef5f96cec952e7b2 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 1 Feb 2024 16:43:28 -0800 Subject: [PATCH 054/162] fixing the hard coded part Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 6f9bd484..8f7537b8 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -4,11 +4,11 @@ on: workflow_dispatch: inputs: tag: - description: 'Define teh tag for the code' + description: 'Define the tag for thecode' required: false branch: description: 'Define branch name' - required: true + required: false default: 'main' push: branches: @@ -48,6 +48,9 @@ jobs: - service: aries-endorser-proxy DOCKER_FILE_PATH: Dockerfile # The docker path, file, is the relative path to the docker file from the root of the repo. SOURCE_CONTEXT_DIR: proxy # The context dir, context, sets the context for the build. i.e. where the build will source files from + SOURCE_IMAGE_REGISTRY: "artifacts.developer.gov.bc.ca/docker-remote/" + SOURCE_IMAGE_NAME: caddy + SOURCE_IMAGE_TAG: latest - service: aries-endorser-api GIT_REPO_URL: hyperledger/aries-endorser-service DOCKER_FILE_PATH: Dockerfile.endorser # The docker path, file, is the relative path to the docker file from the root of the repo. @@ -90,9 +93,9 @@ jobs: echo "RUN chown 1001:root /usr/bin/caddy" >> Dockerfile env: context: ${{ matrix.SOURCE_CONTEXT_DIR }} - SOURCE_IMAGE_REGISTRY: "artifacts.developer.gov.bc.ca/docker-remote/" - SOURCE_IMAGE_NAME: caddy - SOURCE_IMAGE_TAG: latest + SOURCE_IMAGE_REGISTRY: ${{ matrix.SOURCE_IMAGE_REGISTRY }} + SOURCE_IMAGE_NAME: ${{ matrix.SOURCE_IMAGE_NAME }} + SOURCE_IMAGE_TAG: ${{ matrix.SOURCE_IMAGE_TAG }} REGISTRY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} REGISTRY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} From dcd7aa8e1e55cf9b4cce468ef50db2d7d7be0ac1 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Tue, 6 Feb 2024 15:45:56 -0800 Subject: [PATCH 055/162] testing Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 68 ++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 8f7537b8..08a36218 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -187,42 +187,42 @@ jobs: echo "${{ matrix.service }}_digest=${digest}" >> $GITHUB_OUTPUT cat $GITHUB_OUTPUT - # deploy2dev: - # needs: build - # env: - # ENVIRONMENT: dev - # permissions: - # packages: write - # runs-on: ubuntu-latest - # environment: dev - # strategy: - # # Serialize the deployments - # max-parallel: 1 - # matrix: - # include: - # - service: aries-endorser-db - # - service: aries-endorser-agent - # - service: aries-endorser-backup - # - service: aries-endorser-proxy - # - service: aries-endorser-api + deploy2dev: + needs: build + env: + ENVIRONMENT: dev + permissions: + packages: write + runs-on: ubuntu-latest + environment: dev + strategy: + # Serialize the deployments + max-parallel: 1 + matrix: + include: + - service: aries-endorser-db + - service: aries-endorser-agent + - service: aries-endorser-backup + - service: aries-endorser-proxy + - service: aries-endorser-api - # steps: - # - name: Checkout - # uses: actions/checkout@v4 + steps: + - name: Checkout + uses: actions/checkout@v4 - # - name: Deploy to ${{ env.ENVIRONMENT }} - # uses: ./.github/workflows/actions/deploy - # with: - # environment: ${{ env.ENVIRONMENT }} - # ghcr_token: ${{ secrets.GITHUB_TOKEN }} - # github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} - # image_digest: ${{ needs.build.outputs[format ('{0}_digest', matrix.service)] }} - # openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }} - # openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} - # namespace: ${{ vars.NAMESPACE }} - # deployment_configuration: ${{ matrix.service }} - # openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} - # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} + - name: Deploy to ${{ env.ENVIRONMENT }} + uses: ./.github/workflows/actions/deploy + with: + environment: ${{ env.ENVIRONMENT }} + ghcr_token: ${{ secrets.GITHUB_TOKEN }} + github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} + image_digest: ${{ needs.build.outputs[format ('{0}_digest', matrix.service)] }} + openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }} + openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} + namespace: ${{ vars.NAMESPACE }} + deployment_configuration: ${{ matrix.service }} + openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} + rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} # docker pull ghcr.io/bcgov/dts-endorser-service@sha256:57f946ab1053726ac6fcb71c85a98d355e926904ebe26db4798353668b3f6c68 From 2eab3b1c817959e65896cf43566dc9cf91f0c665 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 7 Feb 2024 08:39:22 -0800 Subject: [PATCH 056/162] fixing override of the base image Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 86 +++++++++++++++++++++---------------- 1 file changed, 50 insertions(+), 36 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 08a36218..fdc71726 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -54,8 +54,10 @@ jobs: - service: aries-endorser-api GIT_REPO_URL: hyperledger/aries-endorser-service DOCKER_FILE_PATH: Dockerfile.endorser # The docker path, file, is the relative path to the docker file from the root of the repo. - SOURCE_CONTEXT_DIR: endorser # The context dir, context, sets the context for the build. i.e. where the build will source files from - + SOURCE_CONTEXT_DIR: endorser # The context dir, context, sets the context for the build. i.e. where the build will source files from + BASE_SOURCE_IMAGE_REGISTRY: artifacts.developer.gov.bc.ca/docker-remote/ + BASE_SOURCE_IMAGE_NAME: python + BASE_SOURCE_IMAGE_TAG: 3.10-slim-buster outputs: aries-endorser-agent_digest: ${{ steps.digest.outputs.aries-endorser-agent_digest }} aries-endorser-backup_digest: ${{ steps.digest.outputs.aries-endorser-backup_digest }} @@ -122,6 +124,18 @@ jobs: type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} type=sha,value=latest + + - name: Update Docker base image + if: ${{ matrix.BASE_SOURCE_IMAGE_REGISTRY }} != "" && contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) + run: | + BASE_IMAGE=${BASE_SOURCE_IMAGE_REGISTRY}${BASE_SOURCE_IMAGE_NAME}:${BASE_SOURCE_IMAGE_TAG} + sed -i "/FROM .*/FROM ${BASE_IMAGE}/g" ${file} + env: + context: ${{ matrix.SOURCE_CONTEXT_DIR }} + BASE_SOURCE_IMAGE_REGISTRY: ${{ matrix.BASE_SOURCE_IMAGE_REGISTRY }} + BASE_SOURCE_IMAGE_NAME: ${{ matrix.BASE_SOURCE_IMAGE_NAME }} + BASE_SOURCE_IMAGE_TAG: ${{ matrix.BASE_SOURCE_IMAGE_TAG }} + file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} - name: Build and push Docker image id: docker_build @@ -187,42 +201,42 @@ jobs: echo "${{ matrix.service }}_digest=${digest}" >> $GITHUB_OUTPUT cat $GITHUB_OUTPUT - deploy2dev: - needs: build - env: - ENVIRONMENT: dev - permissions: - packages: write - runs-on: ubuntu-latest - environment: dev - strategy: - # Serialize the deployments - max-parallel: 1 - matrix: - include: - - service: aries-endorser-db - - service: aries-endorser-agent - - service: aries-endorser-backup - - service: aries-endorser-proxy - - service: aries-endorser-api + # deploy2dev: + # needs: build + # env: + # ENVIRONMENT: dev + # permissions: + # packages: write + # runs-on: ubuntu-latest + # environment: dev + # strategy: + # # Serialize the deployments + # max-parallel: 1 + # matrix: + # include: + # - service: aries-endorser-db + # - service: aries-endorser-agent + # - service: aries-endorser-backup + # - service: aries-endorser-proxy + # - service: aries-endorser-api - steps: - - name: Checkout - uses: actions/checkout@v4 + # steps: + # - name: Checkout + # uses: actions/checkout@v4 - - name: Deploy to ${{ env.ENVIRONMENT }} - uses: ./.github/workflows/actions/deploy - with: - environment: ${{ env.ENVIRONMENT }} - ghcr_token: ${{ secrets.GITHUB_TOKEN }} - github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} - image_digest: ${{ needs.build.outputs[format ('{0}_digest', matrix.service)] }} - openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }} - openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} - namespace: ${{ vars.NAMESPACE }} - deployment_configuration: ${{ matrix.service }} - openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} - rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} + # - name: Deploy to ${{ env.ENVIRONMENT }} + # uses: ./.github/workflows/actions/deploy + # with: + # environment: ${{ env.ENVIRONMENT }} + # ghcr_token: ${{ secrets.GITHUB_TOKEN }} + # github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} + # image_digest: ${{ needs.build.outputs[format ('{0}_digest', matrix.service)] }} + # openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }} + # openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} + # namespace: ${{ vars.NAMESPACE }} + # deployment_configuration: ${{ matrix.service }} + # openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} + # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} # docker pull ghcr.io/bcgov/dts-endorser-service@sha256:57f946ab1053726ac6fcb71c85a98d355e926904ebe26db4798353668b3f6c68 From b4c8b30e87139264ca1a47ea892b07de1ecfb77b Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 7 Feb 2024 13:50:09 -0800 Subject: [PATCH 057/162] executing the command Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index fdc71726..cd6bdc0c 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -129,7 +129,7 @@ jobs: if: ${{ matrix.BASE_SOURCE_IMAGE_REGISTRY }} != "" && contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) run: | BASE_IMAGE=${BASE_SOURCE_IMAGE_REGISTRY}${BASE_SOURCE_IMAGE_NAME}:${BASE_SOURCE_IMAGE_TAG} - sed -i "/FROM .*/FROM ${BASE_IMAGE}/g" ${file} + sed -i -e "/FROM .*/FROM ${BASE_IMAGE}/g" ${file} env: context: ${{ matrix.SOURCE_CONTEXT_DIR }} BASE_SOURCE_IMAGE_REGISTRY: ${{ matrix.BASE_SOURCE_IMAGE_REGISTRY }} From feb5fbe0061a1e44d85638251c7031acf09c3655 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 7 Feb 2024 14:20:50 -0800 Subject: [PATCH 058/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index cd6bdc0c..bf673501 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -129,7 +129,7 @@ jobs: if: ${{ matrix.BASE_SOURCE_IMAGE_REGISTRY }} != "" && contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) run: | BASE_IMAGE=${BASE_SOURCE_IMAGE_REGISTRY}${BASE_SOURCE_IMAGE_NAME}:${BASE_SOURCE_IMAGE_TAG} - sed -i -e "/FROM .*/FROM ${BASE_IMAGE}/g" ${file} + sed -i -e "/FROM .*/FROM ${BASE_IMAGE}/g" "${file}" env: context: ${{ matrix.SOURCE_CONTEXT_DIR }} BASE_SOURCE_IMAGE_REGISTRY: ${{ matrix.BASE_SOURCE_IMAGE_REGISTRY }} From 2ba2f42237cac486ecfdec1ad412c47c4dcf0b9e Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 7 Feb 2024 14:32:58 -0800 Subject: [PATCH 059/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index bf673501..3327bf25 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -128,8 +128,8 @@ jobs: - name: Update Docker base image if: ${{ matrix.BASE_SOURCE_IMAGE_REGISTRY }} != "" && contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) run: | - BASE_IMAGE=${BASE_SOURCE_IMAGE_REGISTRY}${BASE_SOURCE_IMAGE_NAME}:${BASE_SOURCE_IMAGE_TAG} - sed -i -e "/FROM .*/FROM ${BASE_IMAGE}/g" "${file}" + BASE_IMAGE="${BASE_SOURCE_IMAGE_REGISTRY}${BASE_SOURCE_IMAGE_NAME}:${BASE_SOURCE_IMAGE_TAG}" + sed -i -e "s/FROM .*/FROM ${BASE_IMAGE}/g" "${file}" env: context: ${{ matrix.SOURCE_CONTEXT_DIR }} BASE_SOURCE_IMAGE_REGISTRY: ${{ matrix.BASE_SOURCE_IMAGE_REGISTRY }} From c459b279d7cbce6a0e4d207b3454c16acd95ef0f Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 8 Feb 2024 04:45:06 -0800 Subject: [PATCH 060/162] testing base image Signed-off-by: Rajpal Chauhan --- .github/workflows/actions/deploy/action.yaml | 22 ++--- .github/workflows/main.yaml | 90 +++++++++----------- 2 files changed, 50 insertions(+), 62 deletions(-) diff --git a/.github/workflows/actions/deploy/action.yaml b/.github/workflows/actions/deploy/action.yaml index f659da80..8f6a14f1 100644 --- a/.github/workflows/actions/deploy/action.yaml +++ b/.github/workflows/actions/deploy/action.yaml @@ -84,14 +84,14 @@ runs: echo starting rollout in ${{ inputs.namespace }} oc -n ${{ inputs.namespace }} rollout status dc/${{ inputs.deployment_configuration }} --watch - - name: Rocket.Chat Notification - uses: RocketChat/Rocket.Chat.GitHub.Action.Notification@1.1.1 - if: always() - with: - type: ${{ job.status }} - job_name: '*Deployment to ${{ inputs.environment }}*' - mention: 'here' - mention_if: 'failure' - channel: '#ditp-gha-notifications' - url: ${{ inputs.rocketchat_webhook }} - commit: true \ No newline at end of file + # - name: Rocket.Chat Notification + # uses: RocketChat/Rocket.Chat.GitHub.Action.Notification@1.1.1 + # if: always() + # with: + # type: ${{ job.status }} + # job_name: '*Deployment to ${{ inputs.environment }}*' + # mention: 'here' + # mention_if: 'failure' + # channel: '#ditp-gha-notifications' + # url: ${{ inputs.rocketchat_webhook }} + # commit: true \ No newline at end of file diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 3327bf25..70060934 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -54,10 +54,8 @@ jobs: - service: aries-endorser-api GIT_REPO_URL: hyperledger/aries-endorser-service DOCKER_FILE_PATH: Dockerfile.endorser # The docker path, file, is the relative path to the docker file from the root of the repo. - SOURCE_CONTEXT_DIR: endorser # The context dir, context, sets the context for the build. i.e. where the build will source files from - BASE_SOURCE_IMAGE_REGISTRY: artifacts.developer.gov.bc.ca/docker-remote/ - BASE_SOURCE_IMAGE_NAME: python - BASE_SOURCE_IMAGE_TAG: 3.10-slim-buster + SOURCE_CONTEXT_DIR: endorser # The context dir, context, sets the context for the build. i.e. where the build will source files from + outputs: aries-endorser-agent_digest: ${{ steps.digest.outputs.aries-endorser-agent_digest }} aries-endorser-backup_digest: ${{ steps.digest.outputs.aries-endorser-backup_digest }} @@ -124,18 +122,6 @@ jobs: type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} type=sha,value=latest - - - name: Update Docker base image - if: ${{ matrix.BASE_SOURCE_IMAGE_REGISTRY }} != "" && contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) - run: | - BASE_IMAGE="${BASE_SOURCE_IMAGE_REGISTRY}${BASE_SOURCE_IMAGE_NAME}:${BASE_SOURCE_IMAGE_TAG}" - sed -i -e "s/FROM .*/FROM ${BASE_IMAGE}/g" "${file}" - env: - context: ${{ matrix.SOURCE_CONTEXT_DIR }} - BASE_SOURCE_IMAGE_REGISTRY: ${{ matrix.BASE_SOURCE_IMAGE_REGISTRY }} - BASE_SOURCE_IMAGE_NAME: ${{ matrix.BASE_SOURCE_IMAGE_NAME }} - BASE_SOURCE_IMAGE_TAG: ${{ matrix.BASE_SOURCE_IMAGE_TAG }} - file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} - name: Build and push Docker image id: docker_build @@ -154,7 +140,6 @@ jobs: if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) run: | docker pull ${{ matrix.BUILDER_IMAGE }} - - name: Extract Values id: extract if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) @@ -200,42 +185,45 @@ jobs: echo 'digest=${digest}' echo "${{ matrix.service }}_digest=${digest}" >> $GITHUB_OUTPUT cat $GITHUB_OUTPUT - - # deploy2dev: - # needs: build - # env: - # ENVIRONMENT: dev - # permissions: - # packages: write - # runs-on: ubuntu-latest - # environment: dev - # strategy: - # # Serialize the deployments - # max-parallel: 1 - # matrix: - # include: - # - service: aries-endorser-db - # - service: aries-endorser-agent - # - service: aries-endorser-backup - # - service: aries-endorser-proxy - # - service: aries-endorser-api +<<<<<<< HEAD + +======= +>>>>>>> 75dd3452af8946bd6347ac3909ed344649da182c + deploy2dev: + needs: build + env: + ENVIRONMENT: dev + permissions: + packages: write + runs-on: ubuntu-latest + environment: dev + strategy: + # Serialize the deployments + max-parallel: 1 + matrix: + include: + - service: aries-endorser-db + - service: aries-endorser-agent + - service: aries-endorser-backup + - service: aries-endorser-proxy + - service: aries-endorser-api - # steps: - # - name: Checkout - # uses: actions/checkout@v4 + steps: + - name: Checkout + uses: actions/checkout@v4 - # - name: Deploy to ${{ env.ENVIRONMENT }} - # uses: ./.github/workflows/actions/deploy - # with: - # environment: ${{ env.ENVIRONMENT }} - # ghcr_token: ${{ secrets.GITHUB_TOKEN }} - # github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} - # image_digest: ${{ needs.build.outputs[format ('{0}_digest', matrix.service)] }} - # openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }} - # openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} - # namespace: ${{ vars.NAMESPACE }} - # deployment_configuration: ${{ matrix.service }} - # openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} + - name: Deploy to ${{ env.ENVIRONMENT }} + uses: ./.github/workflows/actions/deploy + with: + environment: ${{ env.ENVIRONMENT }} + ghcr_token: ${{ secrets.GITHUB_TOKEN }} + github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} + image_digest: ${{ needs.build.outputs[format ('{0}_digest', matrix.service)] }} + openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }} + openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} + namespace: ${{ vars.NAMESPACE }} + deployment_configuration: ${{ matrix.service }} + openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} # docker pull ghcr.io/bcgov/dts-endorser-service@sha256:57f946ab1053726ac6fcb71c85a98d355e926904ebe26db4798353668b3f6c68 From 1776a4a9b69f75e20c1534f083e6db8867735309 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 8 Feb 2024 12:14:35 -0800 Subject: [PATCH 061/162] updating and pulling base image Signed-off-by: Rajpal Chauhan --- .github/workflows/actions/deploy/action.yaml | 22 ++++----- .github/workflows/main.yaml | 50 +++++++++++++++----- 2 files changed, 49 insertions(+), 23 deletions(-) diff --git a/.github/workflows/actions/deploy/action.yaml b/.github/workflows/actions/deploy/action.yaml index 8f6a14f1..f659da80 100644 --- a/.github/workflows/actions/deploy/action.yaml +++ b/.github/workflows/actions/deploy/action.yaml @@ -84,14 +84,14 @@ runs: echo starting rollout in ${{ inputs.namespace }} oc -n ${{ inputs.namespace }} rollout status dc/${{ inputs.deployment_configuration }} --watch - # - name: Rocket.Chat Notification - # uses: RocketChat/Rocket.Chat.GitHub.Action.Notification@1.1.1 - # if: always() - # with: - # type: ${{ job.status }} - # job_name: '*Deployment to ${{ inputs.environment }}*' - # mention: 'here' - # mention_if: 'failure' - # channel: '#ditp-gha-notifications' - # url: ${{ inputs.rocketchat_webhook }} - # commit: true \ No newline at end of file + - name: Rocket.Chat Notification + uses: RocketChat/Rocket.Chat.GitHub.Action.Notification@1.1.1 + if: always() + with: + type: ${{ job.status }} + job_name: '*Deployment to ${{ inputs.environment }}*' + mention: 'here' + mention_if: 'failure' + channel: '#ditp-gha-notifications' + url: ${{ inputs.rocketchat_webhook }} + commit: true \ No newline at end of file diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 70060934..c268030b 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: tag: - description: 'Define the tag for thecode' + description: 'Define the tag for the code' required: false branch: description: 'Define branch name' @@ -54,8 +54,12 @@ jobs: - service: aries-endorser-api GIT_REPO_URL: hyperledger/aries-endorser-service DOCKER_FILE_PATH: Dockerfile.endorser # The docker path, file, is the relative path to the docker file from the root of the repo. - SOURCE_CONTEXT_DIR: endorser # The context dir, context, sets the context for the build. i.e. where the build will source files from - + SOURCE_CONTEXT_DIR: endorser # The context dir, context, sets the context for the build. i.e. where the build will source files from + BASE_SOURCE_IMAGE_REGISTRY: artifacts.developer.gov.bc.ca/docker-remote/ + BASE_SOURCE_IMAGE_NAME: python + BASE_SOURCE_IMAGE_TAG: 3.10-slim-buster + REGISTRY_USERNAME_SECRET_NAME: ARTIFACTORY_USERNAME + REGISTRY_PASSWORD_SECRET_NAME: ARTIFACTORY_PASSWORD outputs: aries-endorser-agent_digest: ${{ steps.digest.outputs.aries-endorser-agent_digest }} aries-endorser-backup_digest: ${{ steps.digest.outputs.aries-endorser-backup_digest }} @@ -68,25 +72,29 @@ jobs: uses: actions/checkout@v4 with: repository: ${{ matrix.GIT_REPO_URL }} - ref: ${{ github.event.tag }} + ref: ${{ github.event.tag }} if: ${{ github.event.tag != '' }} - name: Checkout uses: actions/checkout@v4 with: repository: ${{ matrix.GIT_REPO_URL }} - ref: ${{ github.event.branch }} + ref: ${{ github.event.branch }} if: ${{ github.event.tag == '' }} - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Pull base image for proxy and Create Docker file if: contains(fromJSON('["aries-endorser-proxy"]'), matrix.service) run: | + if [[ -n "${BASE_SOURCE_IMAGE_REGISTRY}" ]]; then + docker login -u $REGISTRY_USERNAME -p $REGISTRY_PASSWORD $BASE_SOURCE_IMAGE_REGISTRY + BASE_IMAGE="${BASE_SOURCE_IMAGE_REGISTRY}${BASE_SOURCE_IMAGE_NAME}:${BASE_SOURCE_IMAGE_TAG}" + else docker login -u $REGISTRY_USERNAME -p $REGISTRY_PASSWORD $SOURCE_IMAGE_REGISTRY BASE_IMAGE=${SOURCE_IMAGE_REGISTRY}${SOURCE_IMAGE_NAME}:${SOURCE_IMAGE_TAG} + fi docker pull "${BASE_IMAGE}" mkdir ${context} && cd ${context} echo "FROM ${BASE_IMAGE}" > Dockerfile @@ -96,6 +104,9 @@ jobs: SOURCE_IMAGE_REGISTRY: ${{ matrix.SOURCE_IMAGE_REGISTRY }} SOURCE_IMAGE_NAME: ${{ matrix.SOURCE_IMAGE_NAME }} SOURCE_IMAGE_TAG: ${{ matrix.SOURCE_IMAGE_TAG }} + BASE_SOURCE_IMAGE_REGISTRY: ${{ matrix.BASE_SOURCE_IMAGE_REGISTRY }} + BASE_SOURCE_IMAGE_NAME: ${{ matrix.BASE_SOURCE_IMAGE_NAME }} + BASE_SOURCE_IMAGE_TAG: ${{ matrix.BASE_SOURCE_IMAGE_TAG }} REGISTRY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} REGISTRY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} @@ -122,7 +133,25 @@ jobs: type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} type=sha,value=latest - + + - name: Update Docker base image and pull the base image if access is required + if: matrix.BASE_SOURCE_IMAGE_REGISTRY != '' && contains(fromJSON('["aries-endorser-db","aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) + run: | + if [[ -n "${REGISTRY_USERNAME}" ]]; then + docker login -u $REGISTRY_USERNAME -p $REGISTRY_PASSWORD $BASE_SOURCE_IMAGE_REGISTRY + fi + BASE_IMAGE="${BASE_SOURCE_IMAGE_REGISTRY}${BASE_SOURCE_IMAGE_NAME}:${BASE_SOURCE_IMAGE_TAG}" + sed -i -e "s;FROM .*;FROM ${BASE_IMAGE};g" "$file" + docker pull $BASE_IMAGE + env: + context: ${{ matrix.SOURCE_CONTEXT_DIR }} + BASE_SOURCE_IMAGE_REGISTRY: ${{ matrix.BASE_SOURCE_IMAGE_REGISTRY }} + BASE_SOURCE_IMAGE_NAME: ${{ matrix.BASE_SOURCE_IMAGE_NAME }} + BASE_SOURCE_IMAGE_TAG: ${{ matrix.BASE_SOURCE_IMAGE_TAG }} + file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} + REGISTRY_USERNAME: ${{ secrets[matrix.REGISTRY_USERNAME_SECRET_NAME]}} + REGISTRY_PASSWORD: ${{ secrets[matrix.REGISTRY_PASSWORD_SECRET_NAME]}} + - name: Build and push Docker image id: docker_build if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) @@ -185,10 +214,7 @@ jobs: echo 'digest=${digest}' echo "${{ matrix.service }}_digest=${digest}" >> $GITHUB_OUTPUT cat $GITHUB_OUTPUT -<<<<<<< HEAD - -======= ->>>>>>> 75dd3452af8946bd6347ac3909ed344649da182c + deploy2dev: needs: build env: @@ -224,7 +250,7 @@ jobs: namespace: ${{ vars.NAMESPACE }} deployment_configuration: ${{ matrix.service }} openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} - # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} + rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} # docker pull ghcr.io/bcgov/dts-endorser-service@sha256:57f946ab1053726ac6fcb71c85a98d355e926904ebe26db4798353668b3f6c68 From b18148b282562b2127a40d3a91d8be20e92b3161 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 8 Feb 2024 15:10:13 -0800 Subject: [PATCH 062/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 172 ++++++++++++++++++------------------ 1 file changed, 86 insertions(+), 86 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index c268030b..cfa608e8 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -155,7 +155,7 @@ jobs: - name: Build and push Docker image id: docker_build if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v4 with: context: ${{ matrix.SOURCE_CONTEXT_DIR }} file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} @@ -215,106 +215,106 @@ jobs: echo "${{ matrix.service }}_digest=${digest}" >> $GITHUB_OUTPUT cat $GITHUB_OUTPUT - deploy2dev: - needs: build - env: - ENVIRONMENT: dev - permissions: - packages: write - runs-on: ubuntu-latest - environment: dev - strategy: - # Serialize the deployments - max-parallel: 1 - matrix: - include: - - service: aries-endorser-db - - service: aries-endorser-agent - - service: aries-endorser-backup - - service: aries-endorser-proxy - - service: aries-endorser-api - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Deploy to ${{ env.ENVIRONMENT }} - uses: ./.github/workflows/actions/deploy - with: - environment: ${{ env.ENVIRONMENT }} - ghcr_token: ${{ secrets.GITHUB_TOKEN }} - github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} - image_digest: ${{ needs.build.outputs[format ('{0}_digest', matrix.service)] }} - openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }} - openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} - namespace: ${{ vars.NAMESPACE }} - deployment_configuration: ${{ matrix.service }} - openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} - rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} - - # docker pull ghcr.io/bcgov/dts-endorser-service@sha256:57f946ab1053726ac6fcb71c85a98d355e926904ebe26db4798353668b3f6c68 - - # docker pull ghcr.io/bcgov/dts-endorser-service/aries-endorser-api:sha-e237467 - # docker pull ${{ inputs.github_image_name }}@${{ inputs.image_digest }} - # github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} - # GITHUB_IMAGE_REPO: ghcr.io/bcgov/dts-endorser-service - # docker pull ghcr.io/bcgov/dts-endorser-service - # github_image_name: ghcr.io/bcgov/dts-endorser-service - # docker push ghcr.io/bcgov/dts-endorser-service/aries-endorser-api - # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} - - # deploy2test: - # needs: [build, deploy2dev] + # deploy2dev: + # needs: build # env: - # ENVIRONMENT: test + # ENVIRONMENT: dev # permissions: # packages: write # runs-on: ubuntu-latest - # environment: test - + # environment: dev + # strategy: + # # Serialize the deployments + # max-parallel: 1 + # matrix: + # include: + # - service: aries-endorser-db + # - service: aries-endorser-agent + # - service: aries-endorser-backup + # - service: aries-endorser-proxy + # - service: aries-endorser-api + # steps: # - name: Checkout - # uses: actions/checkout@v3 - - # - name: deploy to ${{ env.ENVIRONMENT }} + # uses: actions/checkout@v4 + + # - name: Deploy to ${{ env.ENVIRONMENT }} # uses: ./.github/workflows/actions/deploy # with: # environment: ${{ env.ENVIRONMENT }} # ghcr_token: ${{ secrets.GITHUB_TOKEN }} - # github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ env.APP_NAME }} - # image_digest: ${{ needs.build.outputs.image_digest }} - # openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ env.APP_NAME }} + # github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} + # image_digest: ${{ needs.build.outputs[format ('{0}_digest', matrix.service)] }} + # openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }} # openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} # namespace: ${{ vars.NAMESPACE }} - # deployment_configuration: ${{ env.APP_NAME }} + # deployment_configuration: ${{ matrix.service }} # openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} - # deploy2prod: - # needs: [build, deploy2dev, deploy2test] - # env: - # ENVIRONMENT: prod - # permissions: - # packages: write - # runs-on: ubuntu-latest - # environment: prod + # # docker pull ghcr.io/bcgov/dts-endorser-service@sha256:57f946ab1053726ac6fcb71c85a98d355e926904ebe26db4798353668b3f6c68 - # steps: - # - name: Checkout - # uses: actions/checkout@v3 + # # docker pull ghcr.io/bcgov/dts-endorser-service/aries-endorser-api:sha-e237467 + # # docker pull ${{ inputs.github_image_name }}@${{ inputs.image_digest }} + # # github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} + # # GITHUB_IMAGE_REPO: ghcr.io/bcgov/dts-endorser-service + # # docker pull ghcr.io/bcgov/dts-endorser-service + # # github_image_name: ghcr.io/bcgov/dts-endorser-service + # # docker push ghcr.io/bcgov/dts-endorser-service/aries-endorser-api + # # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} - # - name: deploy to prod - # uses: ./.github/workflows/actions/deploy - # with: - # environment: ${{ env.ENVIRONMENT }} - # ghcr_token: ${{ secrets.GITHUB_TOKEN }} - # github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ env.APP_NAME }} - # image_digest: ${{ needs.build.outputs.image_digest }} - # openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ env.APP_NAME }} - # openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} - # namespace: ${{ vars.NAMESPACE }} - # deployment_configuration: ${{ env.APP_NAME }} - # openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} - # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} + # # deploy2test: + # # needs: [build, deploy2dev] + # # env: + # # ENVIRONMENT: test + # # permissions: + # # packages: write + # # runs-on: ubuntu-latest + # # environment: test + + # # steps: + # # - name: Checkout + # # uses: actions/checkout@v3 + + # # - name: deploy to ${{ env.ENVIRONMENT }} + # # uses: ./.github/workflows/actions/deploy + # # with: + # # environment: ${{ env.ENVIRONMENT }} + # # ghcr_token: ${{ secrets.GITHUB_TOKEN }} + # # github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ env.APP_NAME }} + # # image_digest: ${{ needs.build.outputs.image_digest }} + # # openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ env.APP_NAME }} + # # openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} + # # namespace: ${{ vars.NAMESPACE }} + # # deployment_configuration: ${{ env.APP_NAME }} + # # openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} + # # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} + + # # deploy2prod: + # # needs: [build, deploy2dev, deploy2test] + # # env: + # # ENVIRONMENT: prod + # # permissions: + # # packages: write + # # runs-on: ubuntu-latest + # # environment: prod + + # # steps: + # # - name: Checkout + # # uses: actions/checkout@v3 + + # # - name: deploy to prod + # # uses: ./.github/workflows/actions/deploy + # # with: + # # environment: ${{ env.ENVIRONMENT }} + # # ghcr_token: ${{ secrets.GITHUB_TOKEN }} + # # github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ env.APP_NAME }} + # # image_digest: ${{ needs.build.outputs.image_digest }} + # # openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ env.APP_NAME }} + # # openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} + # # namespace: ${{ vars.NAMESPACE }} + # # deployment_configuration: ${{ env.APP_NAME }} + # # openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} + # # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} - # aries-endorser-db, aries-endorser-backup, aries-endorser-proxy, aries-endorser-api \ No newline at end of file + # # aries-endorser-db, aries-endorser-backup, aries-endorser-proxy, aries-endorser-api \ No newline at end of file From cb5bcf98dc112136eeea8cb7f96c1979442301e6 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Sat, 10 Feb 2024 00:30:56 -0800 Subject: [PATCH 063/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index cfa608e8..27594db5 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -57,7 +57,7 @@ jobs: SOURCE_CONTEXT_DIR: endorser # The context dir, context, sets the context for the build. i.e. where the build will source files from BASE_SOURCE_IMAGE_REGISTRY: artifacts.developer.gov.bc.ca/docker-remote/ BASE_SOURCE_IMAGE_NAME: python - BASE_SOURCE_IMAGE_TAG: 3.10-slim-buster + BASE_SOURCE_IMAGE_TAG: 3.10-slim-buster-test REGISTRY_USERNAME_SECRET_NAME: ARTIFACTORY_USERNAME REGISTRY_PASSWORD_SECRET_NAME: ARTIFACTORY_PASSWORD outputs: From b7e1b0c02b9ca6e4af2b8b1e686409e7ad43253c Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Sat, 10 Feb 2024 00:31:28 -0800 Subject: [PATCH 064/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/actions/deploy/action.yaml | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/actions/deploy/action.yaml b/.github/workflows/actions/deploy/action.yaml index f659da80..8f6a14f1 100644 --- a/.github/workflows/actions/deploy/action.yaml +++ b/.github/workflows/actions/deploy/action.yaml @@ -84,14 +84,14 @@ runs: echo starting rollout in ${{ inputs.namespace }} oc -n ${{ inputs.namespace }} rollout status dc/${{ inputs.deployment_configuration }} --watch - - name: Rocket.Chat Notification - uses: RocketChat/Rocket.Chat.GitHub.Action.Notification@1.1.1 - if: always() - with: - type: ${{ job.status }} - job_name: '*Deployment to ${{ inputs.environment }}*' - mention: 'here' - mention_if: 'failure' - channel: '#ditp-gha-notifications' - url: ${{ inputs.rocketchat_webhook }} - commit: true \ No newline at end of file + # - name: Rocket.Chat Notification + # uses: RocketChat/Rocket.Chat.GitHub.Action.Notification@1.1.1 + # if: always() + # with: + # type: ${{ job.status }} + # job_name: '*Deployment to ${{ inputs.environment }}*' + # mention: 'here' + # mention_if: 'failure' + # channel: '#ditp-gha-notifications' + # url: ${{ inputs.rocketchat_webhook }} + # commit: true \ No newline at end of file From c6c6ae3a469412da3cede5e8144535a04a6419d8 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Mon, 12 Feb 2024 10:18:20 -0800 Subject: [PATCH 065/162] fixing base image Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 27594db5..cfa608e8 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -57,7 +57,7 @@ jobs: SOURCE_CONTEXT_DIR: endorser # The context dir, context, sets the context for the build. i.e. where the build will source files from BASE_SOURCE_IMAGE_REGISTRY: artifacts.developer.gov.bc.ca/docker-remote/ BASE_SOURCE_IMAGE_NAME: python - BASE_SOURCE_IMAGE_TAG: 3.10-slim-buster-test + BASE_SOURCE_IMAGE_TAG: 3.10-slim-buster REGISTRY_USERNAME_SECRET_NAME: ARTIFACTORY_USERNAME REGISTRY_PASSWORD_SECRET_NAME: ARTIFACTORY_PASSWORD outputs: From 58d022c8c59f396139fef117024343950d9d4c53 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Mon, 12 Feb 2024 12:39:12 -0800 Subject: [PATCH 066/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index cfa608e8..dc64223e 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -120,7 +120,7 @@ jobs: - name: Prepare docker tags for image id: meta if: contains(fromJSON('["aries-endorser-db","aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) - uses: docker/metadata-action@v5 + uses: docker/metadata-action@v4 with: images: ghcr.io/bcgov/dts-endorser-service/${{ matrix.service }} flavor: | @@ -161,10 +161,18 @@ jobs: file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} push: true tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max - + # labels: ${{ steps.meta.outputs.labels }} + labels: | + org.opencontainers.image.created=2024-02-12T18:18:55.462Z + org.opencontainers.image.description=Digital Trust Services - Endorser Service + org.opencontainers.image.licenses=Apache-2.0 + org.opencontainers.image.revision=c6c6ae3a469412da3cede5e8144535a04a6419d8 + org.opencontainers.image.source=https://github.com/bcgov/dts-endorser-service + org.opencontainers.image.title=dts-endorser-service + org.opencontainers.image.url=https://github.com/bcgov/dts-endorser-service + org.opencontainers.image.version=workflow + cache-from: type=gha + cache-to: type=gha,mode=max - name: Pull database image if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) run: | From 118f5b1cb6c311bfd1a2099bc2c3024828e82368 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Tue, 13 Feb 2024 13:09:47 -0800 Subject: [PATCH 067/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index dc64223e..b3beceb7 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -88,17 +88,17 @@ jobs: - name: Pull base image for proxy and Create Docker file if: contains(fromJSON('["aries-endorser-proxy"]'), matrix.service) run: | - if [[ -n "${BASE_SOURCE_IMAGE_REGISTRY}" ]]; then - docker login -u $REGISTRY_USERNAME -p $REGISTRY_PASSWORD $BASE_SOURCE_IMAGE_REGISTRY - BASE_IMAGE="${BASE_SOURCE_IMAGE_REGISTRY}${BASE_SOURCE_IMAGE_NAME}:${BASE_SOURCE_IMAGE_TAG}" - else - docker login -u $REGISTRY_USERNAME -p $REGISTRY_PASSWORD $SOURCE_IMAGE_REGISTRY - BASE_IMAGE=${SOURCE_IMAGE_REGISTRY}${SOURCE_IMAGE_NAME}:${SOURCE_IMAGE_TAG} - fi - docker pull "${BASE_IMAGE}" - mkdir ${context} && cd ${context} - echo "FROM ${BASE_IMAGE}" > Dockerfile - echo "RUN chown 1001:root /usr/bin/caddy" >> Dockerfile + if [[ -n "${BASE_SOURCE_IMAGE_REGISTRY}" ]]; then + docker login -u $REGISTRY_USERNAME -p $REGISTRY_PASSWORD $BASE_SOURCE_IMAGE_REGISTRY + BASE_IMAGE="${BASE_SOURCE_IMAGE_REGISTRY}${BASE_SOURCE_IMAGE_NAME}:${BASE_SOURCE_IMAGE_TAG}" + else + docker login -u $REGISTRY_USERNAME -p $REGISTRY_PASSWORD $SOURCE_IMAGE_REGISTRY + BASE_IMAGE=${SOURCE_IMAGE_REGISTRY}${SOURCE_IMAGE_NAME}:${SOURCE_IMAGE_TAG} + fi + docker pull "${BASE_IMAGE}" + mkdir ${context} && cd ${context} + echo "FROM ${BASE_IMAGE}" > Dockerfile + echo "RUN chown 1001:root /usr/bin/caddy" >> Dockerfile env: context: ${{ matrix.SOURCE_CONTEXT_DIR }} SOURCE_IMAGE_REGISTRY: ${{ matrix.SOURCE_IMAGE_REGISTRY }} @@ -173,6 +173,7 @@ jobs: org.opencontainers.image.version=workflow cache-from: type=gha cache-to: type=gha,mode=max + - name: Pull database image if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) run: | @@ -198,11 +199,11 @@ jobs: if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) uses: redhat-actions/push-to-registry@v2 with: - tags: ${{ steps.build_image.outputs.tags }} - image: ${{ steps.build_image.outputs.image }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - registry: ghcr.io/bcgov + tags: ${{ steps.build_image.outputs.tags }} + image: ${{ steps.build_image.outputs.image }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + registry: ghcr.io/bcgov - name: Display ${{ matrix.service }} image results id: digests From 42ee259497ee7fdc2643d9b1875573511b76c6fc Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 14 Feb 2024 01:07:00 -0800 Subject: [PATCH 068/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index b3beceb7..7d8b914e 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -163,16 +163,24 @@ jobs: tags: ${{ steps.meta.outputs.tags }} # labels: ${{ steps.meta.outputs.labels }} labels: | - org.opencontainers.image.created=2024-02-12T18:18:55.462Z - org.opencontainers.image.description=Digital Trust Services - Endorser Service + acapy.version=0.1O.3 + description = aries-cloudagent provides a base image for running Hyperledger Aries agents in Docker. This + io.buildah.version=126.4 + io.k8s.description=aries-cloudagent provides a base image for running Hyperledger Aries agents in Docker. This + io.k8s.display-name=aries-endorser-agent-15 + 4a9599-tools + io.openshift.build.namespace= + io.openshift.build.source-context-dir=docker/acapy + maintainer=aries-coudagent + org.opencontainers.image.created=2023-09-29T16:15:13.175Z + org.opencontainers.image.description=Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized id org.opencontainers.image.licenses=Apache-2.0 - org.opencontainers.image.revision=c6c6ae3a469412da3cede5e8144535a04a6419d8 - org.opencontainers.image.source=https://github.com/bcgov/dts-endorser-service - org.opencontainers.image.title=dts-endorser-service - org.opencontainers.image.url=https://github.com/bcgov/dts-endorser-service - org.opencontainers.image.version=workflow - cache-from: type=gha - cache-to: type=gha,mode=max + org.opencontainers.image.revision=736cdfb38b68900b779e6159f8a16d299127fdc8 + org.opencontainers.image.source=https://github.com/hyperledger/aries-cloudagent-python + org.opencontainers.image.title=aries-doudagent-Python + org.opencontainers.image.url=https://github.com/hyperledger/aries-cloudagent-python + Py39-0103 + org.opencontainers.image.version=aries-cloudaaent image - name: Pull database image if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) From 33154314988af384252ffd2ffcfc3df7b1de828d Mon Sep 17 00:00:00 2001 From: Raj Chauhan <98990802+rajpalc7@users.noreply.github.com> Date: Wed, 14 Feb 2024 13:00:38 -0800 Subject: [PATCH 069/162] Create labels.txt --- .github/workflows/labels.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/labels.txt diff --git a/.github/workflows/labels.txt b/.github/workflows/labels.txt new file mode 100644 index 00000000..45953e01 --- /dev/null +++ b/.github/workflows/labels.txt @@ -0,0 +1,18 @@ + "labels": { + "org.opencontainers.image.source": "https://github.com/hyperledger/aries-cloudagent-python", + "org.opencontainers.image.title": "aries-cloudagent-python", + "summary": "aries-cloudagent image", + "acapy.version": "0.10.3", + "org.opencontainers.image.description": "Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized identity applications and services running in non-mobile environments.", + "io.k8s.display-name": "aries-cloudagent 0.10.3", + "org.opencontainers.image.url": "https://github.com/hyperledger/aries-cloudagent-python", + "org.opencontainers.image.licenses": "Apache-2.0", + "name": "aries-cloudagent", + "org.opencontainers.image.version": "py3.9-0.10.3", + "io.k8s.description": "aries-cloudagent provides a base image for running Hyperledger Aries agents in Docker. This image layers the python implementation of aries-cloudagent 0.10.3. Based on Debian Buster.", + "org.opencontainers.image.created": "2023-09-29T16:15:13.175Z", + "org.opencontainers.image.revision": "736cdfb38b68900b779e6159f8a16d299127fdc8", + "maintainer": "", + "description": "aries-cloudagent provides a base image for running Hyperledger Aries agents in Docker. This image layers the python implementation of aries-cloudagent 0.10.3. Based on Debian Buster." + } +} From bc1a2856054fc78caf021a5bbb35988e301d6d09 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 14 Feb 2024 13:32:33 -0800 Subject: [PATCH 070/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/labels.txt | 37 ++++++++++++++++++------------------ .github/workflows/main.yaml | 2 +- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/.github/workflows/labels.txt b/.github/workflows/labels.txt index 45953e01..677b921e 100644 --- a/.github/workflows/labels.txt +++ b/.github/workflows/labels.txt @@ -1,18 +1,19 @@ - "labels": { - "org.opencontainers.image.source": "https://github.com/hyperledger/aries-cloudagent-python", - "org.opencontainers.image.title": "aries-cloudagent-python", - "summary": "aries-cloudagent image", - "acapy.version": "0.10.3", - "org.opencontainers.image.description": "Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized identity applications and services running in non-mobile environments.", - "io.k8s.display-name": "aries-cloudagent 0.10.3", - "org.opencontainers.image.url": "https://github.com/hyperledger/aries-cloudagent-python", - "org.opencontainers.image.licenses": "Apache-2.0", - "name": "aries-cloudagent", - "org.opencontainers.image.version": "py3.9-0.10.3", - "io.k8s.description": "aries-cloudagent provides a base image for running Hyperledger Aries agents in Docker. This image layers the python implementation of aries-cloudagent 0.10.3. Based on Debian Buster.", - "org.opencontainers.image.created": "2023-09-29T16:15:13.175Z", - "org.opencontainers.image.revision": "736cdfb38b68900b779e6159f8a16d299127fdc8", - "maintainer": "", - "description": "aries-cloudagent provides a base image for running Hyperledger Aries agents in Docker. This image layers the python implementation of aries-cloudagent 0.10.3. Based on Debian Buster." - } -} +acapy.version=O.10.3 +description=aries-dloudagent provides a base image for running Hyperledger Aries agents in Docker. This +io.buildah.version=126.4 +io.k8s.description=aries-cloudagent provides a base image for running Hyperledger Aries agents in Docker. This +io.k8s.display-name=aries-cloudagent 0.10.3 +io.openshift_build.name=aries-endorser-agent-15 +4a9599-tools +io.openshift.build.namespace= +io.openshift.build.source-context-dir=docker/acapy +maintainer=aries-coudagent +org.opencontainers.image.created=2023-09-29T16:15:13.175Z +org.opencontainers.image.description=Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized id +org.opencontainers.image.licenses=Apache-2.0 +org.opencontainers.image.revision=736cdfb38b68900b779e6159f8a16d299127fdc8 +org.opencontainers.image.source=https://github.com/hyperledger/aries-cloudagent-python +org.opencontainers.image.title=aries-doudagent-Python +org.opencontainers.image.url=https://github.com/hyperledger/aries-cloudagent-python +Py39-0103 +org.opencontainers.image.version=aries-cloudaaent image \ No newline at end of file diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 7d8b914e..2b0d343c 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -161,7 +161,7 @@ jobs: file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} push: true tags: ${{ steps.meta.outputs.tags }} - # labels: ${{ steps.meta.outputs.labels }} + # labels: ${{ steps.load_labels.outputs.* }} labels: | acapy.version=0.1O.3 description = aries-cloudagent provides a base image for running Hyperledger Aries agents in Docker. This From cf09169ee9322a17bc07917ac7686494a5ea40f3 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 14 Feb 2024 14:44:26 -0800 Subject: [PATCH 071/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 2b0d343c..17a0e6fd 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -133,7 +133,7 @@ jobs: type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} type=sha,value=latest - + - name: Update Docker base image and pull the base image if access is required if: matrix.BASE_SOURCE_IMAGE_REGISTRY != '' && contains(fromJSON('["aries-endorser-db","aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) run: | @@ -161,7 +161,7 @@ jobs: file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} push: true tags: ${{ steps.meta.outputs.tags }} - # labels: ${{ steps.load_labels.outputs.* }} + # labels: ${{ steps.meta.outputs.labels }} labels: | acapy.version=0.1O.3 description = aries-cloudagent provides a base image for running Hyperledger Aries agents in Docker. This @@ -231,7 +231,6 @@ jobs: echo 'digest=${digest}' echo "${{ matrix.service }}_digest=${digest}" >> $GITHUB_OUTPUT cat $GITHUB_OUTPUT - # deploy2dev: # needs: build # env: From 0a9ce58a02ddebd97d6fd781620b2d365aaa74ed Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 14 Feb 2024 16:13:20 -0800 Subject: [PATCH 072/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 41 ++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 17a0e6fd..f8bedc5f 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -133,7 +133,10 @@ jobs: type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} type=sha,value=latest + labels: | + acapy.version=0.1O.3 + - name: Update Docker base image and pull the base image if access is required if: matrix.BASE_SOURCE_IMAGE_REGISTRY != '' && contains(fromJSON('["aries-endorser-db","aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) run: | @@ -162,25 +165,25 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} # labels: ${{ steps.meta.outputs.labels }} - labels: | - acapy.version=0.1O.3 - description = aries-cloudagent provides a base image for running Hyperledger Aries agents in Docker. This - io.buildah.version=126.4 - io.k8s.description=aries-cloudagent provides a base image for running Hyperledger Aries agents in Docker. This - io.k8s.display-name=aries-endorser-agent-15 - 4a9599-tools - io.openshift.build.namespace= - io.openshift.build.source-context-dir=docker/acapy - maintainer=aries-coudagent - org.opencontainers.image.created=2023-09-29T16:15:13.175Z - org.opencontainers.image.description=Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized id - org.opencontainers.image.licenses=Apache-2.0 - org.opencontainers.image.revision=736cdfb38b68900b779e6159f8a16d299127fdc8 - org.opencontainers.image.source=https://github.com/hyperledger/aries-cloudagent-python - org.opencontainers.image.title=aries-doudagent-Python - org.opencontainers.image.url=https://github.com/hyperledger/aries-cloudagent-python - Py39-0103 - org.opencontainers.image.version=aries-cloudaaent image + # labels: | + # acapy.version=0.1O.3 + # description = aries-cloudagent provides a base image for running Hyperledger Aries agents in Docker. This + # io.buildah.version=126.4 + # io.k8s.description=aries-cloudagent provides a base image for running Hyperledger Aries agents in Docker. This + # io.k8s.display-name=aries-endorser-agent-15 + # 4a9599-tools + # io.openshift.build.namespace= + # io.openshift.build.source-context-dir=docker/acapy + # maintainer=aries-coudagent + # org.opencontainers.image.created=2023-09-29T16:15:13.175Z + # org.opencontainers.image.description=Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized id + # org.opencontainers.image.licenses=Apache-2.0 + # org.opencontainers.image.revision=736cdfb38b68900b779e6159f8a16d299127fdc8 + # org.opencontainers.image.source=https://github.com/hyperledger/aries-cloudagent-python + # org.opencontainers.image.title=aries-doudagent-Python + # org.opencontainers.image.url=https://github.com/hyperledger/aries-cloudagent-python + # Py39-0103 + # org.opencontainers.image.version=aries-cloudaaent image - name: Pull database image if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) From 40d5f13ffc68876506dd1eea330d274650c4b54c Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 14 Feb 2024 16:30:27 -0800 Subject: [PATCH 073/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index f8bedc5f..1f446b2e 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -120,7 +120,7 @@ jobs: - name: Prepare docker tags for image id: meta if: contains(fromJSON('["aries-endorser-db","aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: ghcr.io/bcgov/dts-endorser-service/${{ matrix.service }} flavor: | @@ -135,6 +135,8 @@ jobs: type=sha,value=latest labels: | acapy.version=0.1O.3 + annotations: | + org.opencontainers.image.description="Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized id" - name: Update Docker base image and pull the base image if access is required From 42bda2aa2de378ae947e4bb97b94c140fc9073bc Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 14 Feb 2024 16:40:02 -0800 Subject: [PATCH 074/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 1f446b2e..e6ccd4c0 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -160,12 +160,14 @@ jobs: - name: Build and push Docker image id: docker_build if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: context: ${{ matrix.SOURCE_CONTEXT_DIR }} file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} push: true tags: ${{ steps.meta.outputs.tags }} + annotations: | + org.opencontainers.image.description="Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized id" # labels: ${{ steps.meta.outputs.labels }} # labels: | # acapy.version=0.1O.3 From 129c482bc7eee420014fc7af5f0ae232788f40d6 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 14 Feb 2024 16:45:07 -0800 Subject: [PATCH 075/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index e6ccd4c0..2680dc64 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -166,8 +166,8 @@ jobs: file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} push: true tags: ${{ steps.meta.outputs.tags }} - annotations: | - org.opencontainers.image.description="Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized id" + annotations: ${{ steps.meta.outputs.annotations }} + # labels: ${{ steps.meta.outputs.labels }} # labels: | # acapy.version=0.1O.3 From 6b48537f3151add594732c5e94371cce20bcb193 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 14 Feb 2024 16:51:36 -0800 Subject: [PATCH 076/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 2680dc64..1b054b6b 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -166,8 +166,8 @@ jobs: file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} push: true tags: ${{ steps.meta.outputs.tags }} - annotations: ${{ steps.meta.outputs.annotations }} - + # annotations: ${{ steps.meta.outputs.annotations }} + outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=My multi-arch image # labels: ${{ steps.meta.outputs.labels }} # labels: | # acapy.version=0.1O.3 From ee768a30c26c4d1efe2f72de0a69bce22ca371f7 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 14 Feb 2024 16:54:05 -0800 Subject: [PATCH 077/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 1b054b6b..4e7222c5 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -167,7 +167,7 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} # annotations: ${{ steps.meta.outputs.annotations }} - outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=My multi-arch image + outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized id # labels: ${{ steps.meta.outputs.labels }} # labels: | # acapy.version=0.1O.3 From 9e33c30daf9728068a9bdc36a0f5c1922cf0f723 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 15 Feb 2024 09:39:48 -0800 Subject: [PATCH 078/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 67 +++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 4e7222c5..c9fbe35b 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -238,41 +238,42 @@ jobs: echo 'digest=${digest}' echo "${{ matrix.service }}_digest=${digest}" >> $GITHUB_OUTPUT cat $GITHUB_OUTPUT - # deploy2dev: - # needs: build - # env: - # ENVIRONMENT: dev - # permissions: - # packages: write - # runs-on: ubuntu-latest - # environment: dev - # strategy: - # # Serialize the deployments - # max-parallel: 1 - # matrix: - # include: - # - service: aries-endorser-db - # - service: aries-endorser-agent - # - service: aries-endorser-backup - # - service: aries-endorser-proxy - # - service: aries-endorser-api + + deploy2dev: + needs: build + env: + ENVIRONMENT: dev + permissions: + packages: write + runs-on: ubuntu-latest + environment: dev + strategy: + # Serialize the deployments + max-parallel: 1 + matrix: + include: + - service: aries-endorser-db + - service: aries-endorser-agent + - service: aries-endorser-backup + - service: aries-endorser-proxy + - service: aries-endorser-api - # steps: - # - name: Checkout - # uses: actions/checkout@v4 + steps: + - name: Checkout + uses: actions/checkout@v4 - # - name: Deploy to ${{ env.ENVIRONMENT }} - # uses: ./.github/workflows/actions/deploy - # with: - # environment: ${{ env.ENVIRONMENT }} - # ghcr_token: ${{ secrets.GITHUB_TOKEN }} - # github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} - # image_digest: ${{ needs.build.outputs[format ('{0}_digest', matrix.service)] }} - # openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }} - # openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} - # namespace: ${{ vars.NAMESPACE }} - # deployment_configuration: ${{ matrix.service }} - # openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} + - name: Deploy to ${{ env.ENVIRONMENT }} + uses: ./.github/workflows/actions/deploy + with: + environment: ${{ env.ENVIRONMENT }} + ghcr_token: ${{ secrets.GITHUB_TOKEN }} + github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} + image_digest: ${{ needs.build.outputs[format ('{0}_digest', matrix.service)] }} + openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }} + openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} + namespace: ${{ vars.NAMESPACE }} + deployment_configuration: ${{ matrix.service }} + openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} # # docker pull ghcr.io/bcgov/dts-endorser-service@sha256:57f946ab1053726ac6fcb71c85a98d355e926904ebe26db4798353668b3f6c68 From 386535eec327f1e1a707bc2dab1f150a8125334e Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 15 Feb 2024 11:17:10 -0800 Subject: [PATCH 079/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index c9fbe35b..8a258c77 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -168,7 +168,7 @@ jobs: tags: ${{ steps.meta.outputs.tags }} # annotations: ${{ steps.meta.outputs.annotations }} outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized id - # labels: ${{ steps.meta.outputs.labels }} + labels: ${{ steps.meta.outputs.labels }} # labels: | # acapy.version=0.1O.3 # description = aries-cloudagent provides a base image for running Hyperledger Aries agents in Docker. This @@ -238,7 +238,7 @@ jobs: echo 'digest=${digest}' echo "${{ matrix.service }}_digest=${digest}" >> $GITHUB_OUTPUT cat $GITHUB_OUTPUT - + deploy2dev: needs: build env: From f3cf208e39afa9ad72aefe00291e08ffb0170d8a Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 15 Feb 2024 13:07:00 -0800 Subject: [PATCH 080/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 8a258c77..5081b98c 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -135,10 +135,10 @@ jobs: type=sha,value=latest labels: | acapy.version=0.1O.3 + annotations: | org.opencontainers.image.description="Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized id" - - name: Update Docker base image and pull the base image if access is required if: matrix.BASE_SOURCE_IMAGE_REGISTRY != '' && contains(fromJSON('["aries-endorser-db","aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) run: | @@ -168,7 +168,7 @@ jobs: tags: ${{ steps.meta.outputs.tags }} # annotations: ${{ steps.meta.outputs.annotations }} outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized id - labels: ${{ steps.meta.outputs.labels }} + # labels: ${{ steps.meta.outputs.labels }} # labels: | # acapy.version=0.1O.3 # description = aries-cloudagent provides a base image for running Hyperledger Aries agents in Docker. This From 1f40724fdab1c324d4a741737364e88a164eb146 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 15 Feb 2024 13:13:01 -0800 Subject: [PATCH 081/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 5081b98c..6e70d077 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -135,7 +135,7 @@ jobs: type=sha,value=latest labels: | acapy.version=0.1O.3 - + hi.raj=raj annotations: | org.opencontainers.image.description="Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized id" From 763f64acac5605166b680aa4e60f535372954211 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 15 Feb 2024 13:52:46 -0800 Subject: [PATCH 082/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 6e70d077..baa110f7 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -132,10 +132,7 @@ jobs: type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} - type=sha,value=latest - labels: | - acapy.version=0.1O.3 - hi.raj=raj + type=sha,value=latest annotations: | org.opencontainers.image.description="Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized id" @@ -168,7 +165,7 @@ jobs: tags: ${{ steps.meta.outputs.tags }} # annotations: ${{ steps.meta.outputs.annotations }} outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized id - # labels: ${{ steps.meta.outputs.labels }} + labels: ${{ steps.meta.outputs.labels }} # labels: | # acapy.version=0.1O.3 # description = aries-cloudagent provides a base image for running Hyperledger Aries agents in Docker. This From 37ba47c4bd0da8a9c03cb59051eca60ba8c66862 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 15 Feb 2024 14:01:17 -0800 Subject: [PATCH 083/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index baa110f7..57ec8216 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -165,7 +165,10 @@ jobs: tags: ${{ steps.meta.outputs.tags }} # annotations: ${{ steps.meta.outputs.annotations }} outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized id - labels: ${{ steps.meta.outputs.labels }} + labels: + ${{ steps.meta.outputs.labels }} + io.openshift.foo=HelloRaj + # labels: | # acapy.version=0.1O.3 # description = aries-cloudagent provides a base image for running Hyperledger Aries agents in Docker. This From 9c63aacb003e5f22ee068e4192428db2b3804b34 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 15 Feb 2024 14:25:39 -0800 Subject: [PATCH 084/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 57ec8216..4a340ffc 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -168,7 +168,12 @@ jobs: labels: ${{ steps.meta.outputs.labels }} io.openshift.foo=HelloRaj - + io.buildah.version=126.4 + io.openshift.build.commit.ref=main + io.openshift.build.namespace=4a9599-tools + io.openshift.build.source-context-dir=docker/acapy + io.openshift.build.source-location=https://github.com/bcgov/aries-endorser-service.git + # labels: | # acapy.version=0.1O.3 # description = aries-cloudagent provides a base image for running Hyperledger Aries agents in Docker. This From a068c772559ffdadae62f6bce4ef4db5cc8045f2 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 15 Feb 2024 14:30:49 -0800 Subject: [PATCH 085/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 4a340ffc..aaf7a6f6 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -165,8 +165,7 @@ jobs: tags: ${{ steps.meta.outputs.tags }} # annotations: ${{ steps.meta.outputs.annotations }} outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized id - labels: - ${{ steps.meta.outputs.labels }} + labels: | io.openshift.foo=HelloRaj io.buildah.version=126.4 io.openshift.build.commit.ref=main From 6de2f4d894a1d0e0a70dcd238b7d493f0a3c4465 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 15 Feb 2024 14:46:29 -0800 Subject: [PATCH 086/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index aaf7a6f6..427b0722 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -166,8 +166,8 @@ jobs: # annotations: ${{ steps.meta.outputs.annotations }} outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized id labels: | - io.openshift.foo=HelloRaj - io.buildah.version=126.4 + io.buildah.version=1.29.0 + io.openshift.build.commit.message= Allow None in model for EndorserTransaction.transaction_request io.openshift.build.commit.ref=main io.openshift.build.namespace=4a9599-tools io.openshift.build.source-context-dir=docker/acapy From 1c169cef53ef8423add8a17aeccd1160ae95954c Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 15 Feb 2024 15:57:52 -0800 Subject: [PATCH 087/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 427b0722..df72c1b3 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -163,16 +163,14 @@ jobs: file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} push: true tags: ${{ steps.meta.outputs.tags }} - # annotations: ${{ steps.meta.outputs.annotations }} outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized id - labels: | - io.buildah.version=1.29.0 - io.openshift.build.commit.message= Allow None in model for EndorserTransaction.transaction_request - io.openshift.build.commit.ref=main - io.openshift.build.namespace=4a9599-tools - io.openshift.build.source-context-dir=docker/acapy - io.openshift.build.source-location=https://github.com/bcgov/aries-endorser-service.git - + labels: | + # io.openshift.build.commit.ref=main + # io.openshift.build.namespace=4a9599-tools + # io.openshift.build.source-context-dir=docker/acapy + # io.openshift.build.source-location=https://github.com/bcgov/aries-endorser-service.git + io.openshift.build.source-location=${{ github.repositoryUrl }} + io.openshift.build.commit.id=${{ github.sha }} # labels: | # acapy.version=0.1O.3 # description = aries-cloudagent provides a base image for running Hyperledger Aries agents in Docker. This From 7873066bd3a3230bbddf967caac9f9fbcc09a288 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 15 Feb 2024 16:21:35 -0800 Subject: [PATCH 088/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index df72c1b3..c6427fc2 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -165,11 +165,7 @@ jobs: tags: ${{ steps.meta.outputs.tags }} outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized id labels: | - # io.openshift.build.commit.ref=main - # io.openshift.build.namespace=4a9599-tools - # io.openshift.build.source-context-dir=docker/acapy - # io.openshift.build.source-location=https://github.com/bcgov/aries-endorser-service.git - io.openshift.build.source-location=${{ github.repositoryUrl }} + io.openshift.build.source-location=${{ github.repositoryUrl | replace('git://', 'https://') }} io.openshift.build.commit.id=${{ github.sha }} # labels: | # acapy.version=0.1O.3 From 96dae8fd78c546d2dc455e42218111d9ead9b6f6 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 15 Feb 2024 16:31:41 -0800 Subject: [PATCH 089/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index c6427fc2..2f6077ff 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -165,7 +165,7 @@ jobs: tags: ${{ steps.meta.outputs.tags }} outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized id labels: | - io.openshift.build.source-location=${{ github.repositoryUrl | replace('git://', 'https://') }} + io.openshift.build.source-location=${{ github.repositoryUrl }} io.openshift.build.commit.id=${{ github.sha }} # labels: | # acapy.version=0.1O.3 From 989dfd590254634278ab0d44eb9738a77d10a954 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 15 Feb 2024 16:43:13 -0800 Subject: [PATCH 090/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 2f6077ff..0c98e644 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -165,8 +165,8 @@ jobs: tags: ${{ steps.meta.outputs.tags }} outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized id labels: | - io.openshift.build.source-location=${{ github.repositoryUrl }} - io.openshift.build.commit.id=${{ github.sha }} + io.openshift.build.source-location: ${{ github.repositoryUrl | replace('git://', 'https://') }} + io.openshift.build.commit.id: ${{ github.sha }} # labels: | # acapy.version=0.1O.3 # description = aries-cloudagent provides a base image for running Hyperledger Aries agents in Docker. This From 2659714e71eb97df740a491c1d5f8f1c454870e5 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 15 Feb 2024 16:45:23 -0800 Subject: [PATCH 091/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 0c98e644..c35e2d25 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -153,6 +153,7 @@ jobs: file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} REGISTRY_USERNAME: ${{ secrets[matrix.REGISTRY_USERNAME_SECRET_NAME]}} REGISTRY_PASSWORD: ${{ secrets[matrix.REGISTRY_PASSWORD_SECRET_NAME]}} + REPO_URL: ${{ github.repositoryUrl }} - name: Build and push Docker image id: docker_build @@ -165,7 +166,7 @@ jobs: tags: ${{ steps.meta.outputs.tags }} outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized id labels: | - io.openshift.build.source-location: ${{ github.repositoryUrl | replace('git://', 'https://') }} + io.openshift.build.source-location: ${{ env.REPO_URL.replace('git://', 'https://') }} io.openshift.build.commit.id: ${{ github.sha }} # labels: | # acapy.version=0.1O.3 From f8ed34ede9c0cfdc5a390d7372674d3356f6de90 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 15 Feb 2024 16:53:31 -0800 Subject: [PATCH 092/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index c35e2d25..1030d633 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -153,7 +153,6 @@ jobs: file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} REGISTRY_USERNAME: ${{ secrets[matrix.REGISTRY_USERNAME_SECRET_NAME]}} REGISTRY_PASSWORD: ${{ secrets[matrix.REGISTRY_PASSWORD_SECRET_NAME]}} - REPO_URL: ${{ github.repositoryUrl }} - name: Build and push Docker image id: docker_build @@ -166,7 +165,7 @@ jobs: tags: ${{ steps.meta.outputs.tags }} outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized id labels: | - io.openshift.build.source-location: ${{ env.REPO_URL.replace('git://', 'https://') }} + io.openshift.build.source-location: ${{ github.repositoryUrl }} io.openshift.build.commit.id: ${{ github.sha }} # labels: | # acapy.version=0.1O.3 From 5a87f69d468738cad27375a00dbf2c111d2bc452 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 15 Feb 2024 18:57:00 -0800 Subject: [PATCH 093/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/actions/deploy/action.yaml | 16 ++++++++++++++++ .github/workflows/labels.txt | 19 ------------------- .github/workflows/main.yaml | 6 +++--- 3 files changed, 19 insertions(+), 22 deletions(-) delete mode 100644 .github/workflows/labels.txt diff --git a/.github/workflows/actions/deploy/action.yaml b/.github/workflows/actions/deploy/action.yaml index 8f6a14f1..76cc7584 100644 --- a/.github/workflows/actions/deploy/action.yaml +++ b/.github/workflows/actions/deploy/action.yaml @@ -62,6 +62,22 @@ runs: run: | oc version docker version + + # Openshift pipeline is currently running on 14.4.6 version and according to + # the new red hat article - https://access.redhat.com/articles/7042033 + # the Podman auth configuration locations are preferred over Docker configuration locations. + + # In order to avoid the "unauthorized: authentication required error" and + # make github actions job run successfully make sure when we try to login to openshift registry + # we need to define the oc registry login --to="${HOME}/.docker/config.json" in the oc login action step. + + # This was not an issue when Openshift pipeline was running on 14.2 or 14.3 version + # but since Openshift upgraded to 14.4 version it started giving warning + # message : the default reading order of registry auth file will be changed from "${HOME}/.docker/config.json" + # to podman registry config locations in the future version of oc. + # "${HOME}/.docker/config.json" is deprecated, but can still be used for storing credentials + # as a fallback. See https://github.com/containers/image/blob/main/docs/containers-auth.json.5.md for the order + # of podman registry config locations. oc registry login --to="${HOME}/.docker/config.json" - name: Tag the image in the GHCR as ${{ inputs.environment }} diff --git a/.github/workflows/labels.txt b/.github/workflows/labels.txt deleted file mode 100644 index 677b921e..00000000 --- a/.github/workflows/labels.txt +++ /dev/null @@ -1,19 +0,0 @@ -acapy.version=O.10.3 -description=aries-dloudagent provides a base image for running Hyperledger Aries agents in Docker. This -io.buildah.version=126.4 -io.k8s.description=aries-cloudagent provides a base image for running Hyperledger Aries agents in Docker. This -io.k8s.display-name=aries-cloudagent 0.10.3 -io.openshift_build.name=aries-endorser-agent-15 -4a9599-tools -io.openshift.build.namespace= -io.openshift.build.source-context-dir=docker/acapy -maintainer=aries-coudagent -org.opencontainers.image.created=2023-09-29T16:15:13.175Z -org.opencontainers.image.description=Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized id -org.opencontainers.image.licenses=Apache-2.0 -org.opencontainers.image.revision=736cdfb38b68900b779e6159f8a16d299127fdc8 -org.opencontainers.image.source=https://github.com/hyperledger/aries-cloudagent-python -org.opencontainers.image.title=aries-doudagent-Python -org.opencontainers.image.url=https://github.com/hyperledger/aries-cloudagent-python -Py39-0103 -org.opencontainers.image.version=aries-cloudaaent image \ No newline at end of file diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 1030d633..96d5d72c 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -165,8 +165,8 @@ jobs: tags: ${{ steps.meta.outputs.tags }} outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized id labels: | - io.openshift.build.source-location: ${{ github.repositoryUrl }} - io.openshift.build.commit.id: ${{ github.sha }} + io.openshift.build.source-location=${{ github.repositoryUrl }} + io.openshift.build.commit.id=${{ github.sha }} # labels: | # acapy.version=0.1O.3 # description = aries-cloudagent provides a base image for running Hyperledger Aries agents in Docker. This @@ -190,7 +190,7 @@ jobs: - name: Pull database image if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) run: | - docker pull ${{ matrix.BUILDER_IMAGE }} + docker pull ${{ matrix.BUILDER_IMAGE }} - name: Extract Values id: extract if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) From 69859691bb94e3124f182e74e3737c5b1b48318b Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Fri, 16 Feb 2024 09:46:58 -0800 Subject: [PATCH 094/162] clean up Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 96d5d72c..17f2ba00 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -167,25 +167,6 @@ jobs: labels: | io.openshift.build.source-location=${{ github.repositoryUrl }} io.openshift.build.commit.id=${{ github.sha }} - # labels: | - # acapy.version=0.1O.3 - # description = aries-cloudagent provides a base image for running Hyperledger Aries agents in Docker. This - # io.buildah.version=126.4 - # io.k8s.description=aries-cloudagent provides a base image for running Hyperledger Aries agents in Docker. This - # io.k8s.display-name=aries-endorser-agent-15 - # 4a9599-tools - # io.openshift.build.namespace= - # io.openshift.build.source-context-dir=docker/acapy - # maintainer=aries-coudagent - # org.opencontainers.image.created=2023-09-29T16:15:13.175Z - # org.opencontainers.image.description=Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized id - # org.opencontainers.image.licenses=Apache-2.0 - # org.opencontainers.image.revision=736cdfb38b68900b779e6159f8a16d299127fdc8 - # org.opencontainers.image.source=https://github.com/hyperledger/aries-cloudagent-python - # org.opencontainers.image.title=aries-doudagent-Python - # org.opencontainers.image.url=https://github.com/hyperledger/aries-cloudagent-python - # Py39-0103 - # org.opencontainers.image.version=aries-cloudaaent image - name: Pull database image if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) @@ -274,17 +255,6 @@ jobs: openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} - # # docker pull ghcr.io/bcgov/dts-endorser-service@sha256:57f946ab1053726ac6fcb71c85a98d355e926904ebe26db4798353668b3f6c68 - - # # docker pull ghcr.io/bcgov/dts-endorser-service/aries-endorser-api:sha-e237467 - # # docker pull ${{ inputs.github_image_name }}@${{ inputs.image_digest }} - # # github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} - # # GITHUB_IMAGE_REPO: ghcr.io/bcgov/dts-endorser-service - # # docker pull ghcr.io/bcgov/dts-endorser-service - # # github_image_name: ghcr.io/bcgov/dts-endorser-service - # # docker push ghcr.io/bcgov/dts-endorser-service/aries-endorser-api - # # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} - # # deploy2test: # # needs: [build, deploy2dev] # # env: From 9ea26b135b3b7341c7c2291e5a09522e59fd8f8d Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 21 Feb 2024 10:45:08 -0800 Subject: [PATCH 095/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 40 ++++++++++++++----------------------- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 17f2ba00..442743d6 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -55,11 +55,11 @@ jobs: GIT_REPO_URL: hyperledger/aries-endorser-service DOCKER_FILE_PATH: Dockerfile.endorser # The docker path, file, is the relative path to the docker file from the root of the repo. SOURCE_CONTEXT_DIR: endorser # The context dir, context, sets the context for the build. i.e. where the build will source files from - BASE_SOURCE_IMAGE_REGISTRY: artifacts.developer.gov.bc.ca/docker-remote/ - BASE_SOURCE_IMAGE_NAME: python - BASE_SOURCE_IMAGE_TAG: 3.10-slim-buster - REGISTRY_USERNAME_SECRET_NAME: ARTIFACTORY_USERNAME - REGISTRY_PASSWORD_SECRET_NAME: ARTIFACTORY_PASSWORD + SOURCE_IMAGE_REGISTRY: artifacts.developer.gov.bc.ca/docker-remote/ + SOURCE_IMAGE_NAME: python + SOURCE_IMAGE_TAG: 3.10-slim-buster + REGISTRY_USERNAME: ARTIFACTORY_USERNAME + REGISTRY_PASSWORD: ARTIFACTORY_PASSWORD outputs: aries-endorser-agent_digest: ${{ steps.digest.outputs.aries-endorser-agent_digest }} aries-endorser-backup_digest: ${{ steps.digest.outputs.aries-endorser-backup_digest }} @@ -70,17 +70,9 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - with: - repository: ${{ matrix.GIT_REPO_URL }} - ref: ${{ github.event.tag }} - if: ${{ github.event.tag != '' }} - - - name: Checkout - uses: actions/checkout@v4 - with: + with: repository: ${{ matrix.GIT_REPO_URL }} - ref: ${{ github.event.branch }} - if: ${{ github.event.tag == '' }} + ref: ${{ github.event.ref || github.event.inputs.tag || github.event.inputs.branch || 'main' }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -122,7 +114,7 @@ jobs: if: contains(fromJSON('["aries-endorser-db","aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) uses: docker/metadata-action@v5 with: - images: ghcr.io/bcgov/dts-endorser-service/${{ matrix.service }} + images: env.GITHUB_IMAGE_REPO/${{ matrix.service }} flavor: | latest=true tags: | @@ -133,8 +125,9 @@ jobs: type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} type=sha,value=latest - annotations: | - org.opencontainers.image.description="Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized id" + labels: | + io.openshift.build.source-location=${{ github.repositoryUrl }} + io.openshift.build.commit.id=${{ github.sha }} - name: Update Docker base image and pull the base image if access is required if: matrix.BASE_SOURCE_IMAGE_REGISTRY != '' && contains(fromJSON('["aries-endorser-db","aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) @@ -163,16 +156,13 @@ jobs: file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} push: true tags: ${{ steps.meta.outputs.tags }} - outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized id - labels: | - io.openshift.build.source-location=${{ github.repositoryUrl }} - io.openshift.build.commit.id=${{ github.sha }} + outputs: type=image,name=target - name: Pull database image if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) run: | docker pull ${{ matrix.BUILDER_IMAGE }} - - name: Extract Values + - name: Extract Tags id: extract if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) run: echo "tags=$(echo '${{ steps.meta.outputs.tags }}' | grep -oE ':([^[:space:]]+)' | sed '/workflow/d' | sed 's/://g' | tr '\n' ' ')" >> $GITHUB_OUTPUT @@ -205,7 +195,7 @@ jobs: run: | echo "registry_path=${{ steps.push.outputs.registry-paths }}" digest=${{ steps.push.outputs.digest }} - echo 'digest=${digest}' + echo "digest=${digest}" echo "${{ matrix.service }}_digest=${digest}" >> $GITHUB_OUTPUT - name: Display ${{ matrix.service}} image results @@ -214,7 +204,7 @@ jobs: run: | echo 'imageid=${{ steps.docker_build.outputs.imageid }}' digest=${{ steps.docker_build.outputs.digest }} - echo 'digest=${digest}' + echo "digest=${digest}" echo "${{ matrix.service }}_digest=${digest}" >> $GITHUB_OUTPUT cat $GITHUB_OUTPUT From d63638877f13bb7077c1463fdee1abe246208732 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 21 Feb 2024 10:55:44 -0800 Subject: [PATCH 096/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 442743d6..343f2015 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -114,7 +114,7 @@ jobs: if: contains(fromJSON('["aries-endorser-db","aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) uses: docker/metadata-action@v5 with: - images: env.GITHUB_IMAGE_REPO/${{ matrix.service }} + images: ${{ env.GITHUB_IMAGE_REPO }}/${{ matrix.service }} flavor: | latest=true tags: | From e1cab01906b81a6887fe9bc65d55d23864ea03e9 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 21 Feb 2024 11:00:50 -0800 Subject: [PATCH 097/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 343f2015..5b0dc622 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -114,7 +114,7 @@ jobs: if: contains(fromJSON('["aries-endorser-db","aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) uses: docker/metadata-action@v5 with: - images: ${{ env.GITHUB_IMAGE_REPO }}/${{ matrix.service }} + images: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} flavor: | latest=true tags: | From 9fde0a946c61ef17d3ae97bb69b67848205c3654 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 21 Feb 2024 14:37:00 -0800 Subject: [PATCH 098/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 5b0dc622..1f491581 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -72,7 +72,7 @@ jobs: uses: actions/checkout@v4 with: repository: ${{ matrix.GIT_REPO_URL }} - ref: ${{ github.event.ref || github.event.inputs.tag || github.event.inputs.branch || 'main' }} + ref: ${{ github.ref || github.event.inputs.tag || github.event.inputs.branch || 'main' }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 From 65ecf655e0dac3f3a77c944002967563c5af3db5 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 22 Feb 2024 14:15:09 -0800 Subject: [PATCH 099/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 137 +++++++++++++++++------------------- 1 file changed, 65 insertions(+), 72 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 1f491581..143e5f61 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,15 +1,7 @@ name: Build and Deploy Image on: - workflow_dispatch: - inputs: - tag: - description: 'Define the tag for the code' - required: false - branch: - description: 'Define branch name' - required: false - default: 'main' + push: branches: - workflow @@ -37,6 +29,11 @@ jobs: GIT_REPO_URL: hyperledger/aries-endorser-service DOCKER_FILE_PATH: Dockerfile.acapy # The docker path, file, is the relative path to the docker file from the root of the repo. SOURCE_CONTEXT_DIR: docker/acapy # The context dir, context, sets the context for the build. i.e. where the build will source files from + SOURCE_IMAGE_REGISTRY: "" + SOURCE_IMAGE_NAME: "" + SOURCE_IMAGE_TAG: "" + REGISTRY_USERNAME: ARTIFACTORY_USERNAME + REGISTRY_PASSWORD: ARTIFACTORY_PASSWORD - service: aries-endorser-db GIT_REPO_URL: hyperledger/aries-endorser-service PATH: docker/wallet/config @@ -45,12 +42,19 @@ jobs: GIT_REPO_URL: BCDevOps/backup-container DOCKER_FILE_PATH: Dockerfile # The docker path, file, is the relative path to the docker file from the root of the repo. SOURCE_CONTEXT_DIR: docker # The context dir, context, sets the context for the build. i.e. where the build will source files from + SOURCE_IMAGE_REGISTRY: "" + SOURCE_IMAGE_NAME: "" + SOURCE_IMAGE_TAG: "" + REGISTRY_USERNAME: ARTIFACTORY_USERNAME + REGISTRY_PASSWORD: ARTIFACTORY_PASSWORD - service: aries-endorser-proxy DOCKER_FILE_PATH: Dockerfile # The docker path, file, is the relative path to the docker file from the root of the repo. SOURCE_CONTEXT_DIR: proxy # The context dir, context, sets the context for the build. i.e. where the build will source files from SOURCE_IMAGE_REGISTRY: "artifacts.developer.gov.bc.ca/docker-remote/" SOURCE_IMAGE_NAME: caddy SOURCE_IMAGE_TAG: latest + REGISTRY_USERNAME: ARTIFACTORY_USERNAME + REGISTRY_PASSWORD: ARTIFACTORY_PASSWORD - service: aries-endorser-api GIT_REPO_URL: hyperledger/aries-endorser-service DOCKER_FILE_PATH: Dockerfile.endorser # The docker path, file, is the relative path to the docker file from the root of the repo. @@ -70,24 +74,26 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - with: + with: repository: ${{ matrix.GIT_REPO_URL }} - ref: ${{ github.ref || github.event.inputs.tag || github.event.inputs.branch || 'main' }} - + ref: ${{ github.ref }} + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - name: Login to image registry + if: matrix.SOURCE_IMAGE_REGISTRY != '' + uses: docker/login-action@v3 + with: + registry: ${{ matrix.SOURCE_IMAGE_REGISTRY }} + username: ${{ secrets[matrix.REGISTRY_USERNAME_SECRET_NAME]}} + password: ${{ secrets[matrix.REGISTRY_PASSWORD_SECRET_NAME]}} + + - name: Pull base image for proxy and Create Docker file if: contains(fromJSON('["aries-endorser-proxy"]'), matrix.service) run: | - if [[ -n "${BASE_SOURCE_IMAGE_REGISTRY}" ]]; then - docker login -u $REGISTRY_USERNAME -p $REGISTRY_PASSWORD $BASE_SOURCE_IMAGE_REGISTRY - BASE_IMAGE="${BASE_SOURCE_IMAGE_REGISTRY}${BASE_SOURCE_IMAGE_NAME}:${BASE_SOURCE_IMAGE_TAG}" - else - docker login -u $REGISTRY_USERNAME -p $REGISTRY_PASSWORD $SOURCE_IMAGE_REGISTRY BASE_IMAGE=${SOURCE_IMAGE_REGISTRY}${SOURCE_IMAGE_NAME}:${SOURCE_IMAGE_TAG} - fi - docker pull "${BASE_IMAGE}" mkdir ${context} && cd ${context} echo "FROM ${BASE_IMAGE}" > Dockerfile echo "RUN chown 1001:root /usr/bin/caddy" >> Dockerfile @@ -96,11 +102,7 @@ jobs: SOURCE_IMAGE_REGISTRY: ${{ matrix.SOURCE_IMAGE_REGISTRY }} SOURCE_IMAGE_NAME: ${{ matrix.SOURCE_IMAGE_NAME }} SOURCE_IMAGE_TAG: ${{ matrix.SOURCE_IMAGE_TAG }} - BASE_SOURCE_IMAGE_REGISTRY: ${{ matrix.BASE_SOURCE_IMAGE_REGISTRY }} - BASE_SOURCE_IMAGE_NAME: ${{ matrix.BASE_SOURCE_IMAGE_NAME }} - BASE_SOURCE_IMAGE_TAG: ${{ matrix.BASE_SOURCE_IMAGE_TAG }} - REGISTRY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} - REGISTRY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} + - name: Log in to the GHCR uses: docker/login-action@v3 @@ -130,22 +132,17 @@ jobs: io.openshift.build.commit.id=${{ github.sha }} - name: Update Docker base image and pull the base image if access is required - if: matrix.BASE_SOURCE_IMAGE_REGISTRY != '' && contains(fromJSON('["aries-endorser-db","aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) + if: matrix.SOURCE_IMAGE_REGISTRY != '' && contains(fromJSON('["aries-endorser-db","aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) run: | - if [[ -n "${REGISTRY_USERNAME}" ]]; then - docker login -u $REGISTRY_USERNAME -p $REGISTRY_PASSWORD $BASE_SOURCE_IMAGE_REGISTRY - fi BASE_IMAGE="${BASE_SOURCE_IMAGE_REGISTRY}${BASE_SOURCE_IMAGE_NAME}:${BASE_SOURCE_IMAGE_TAG}" sed -i -e "s;FROM .*;FROM ${BASE_IMAGE};g" "$file" - docker pull $BASE_IMAGE env: context: ${{ matrix.SOURCE_CONTEXT_DIR }} - BASE_SOURCE_IMAGE_REGISTRY: ${{ matrix.BASE_SOURCE_IMAGE_REGISTRY }} - BASE_SOURCE_IMAGE_NAME: ${{ matrix.BASE_SOURCE_IMAGE_NAME }} - BASE_SOURCE_IMAGE_TAG: ${{ matrix.BASE_SOURCE_IMAGE_TAG }} + SOURCE_IMAGE_REGISTRY: ${{ matrix.SOURCE_IMAGE_REGISTRY }} + SOURCE_IMAGE_NAME: ${{ matrix.SOURCE_IMAGE_NAME }} + SOURCE_IMAGE_TAG: ${{ matrix.SOURCE_IMAGE_TAG }} file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} - REGISTRY_USERNAME: ${{ secrets[matrix.REGISTRY_USERNAME_SECRET_NAME]}} - REGISTRY_PASSWORD: ${{ secrets[matrix.REGISTRY_PASSWORD_SECRET_NAME]}} + - name: Build and push Docker image id: docker_build @@ -157,11 +154,7 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} outputs: type=image,name=target - - - name: Pull database image - if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - run: | - docker pull ${{ matrix.BUILDER_IMAGE }} + - name: Extract Tags id: extract if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) @@ -208,41 +201,41 @@ jobs: echo "${{ matrix.service }}_digest=${digest}" >> $GITHUB_OUTPUT cat $GITHUB_OUTPUT - deploy2dev: - needs: build - env: - ENVIRONMENT: dev - permissions: - packages: write - runs-on: ubuntu-latest - environment: dev - strategy: - # Serialize the deployments - max-parallel: 1 - matrix: - include: - - service: aries-endorser-db - - service: aries-endorser-agent - - service: aries-endorser-backup - - service: aries-endorser-proxy - - service: aries-endorser-api + # deploy2dev: + # needs: build + # env: + # ENVIRONMENT: dev + # permissions: + # packages: write + # runs-on: ubuntu-latest + # environment: dev + # strategy: + # # Serialize the deployments + # max-parallel: 1 + # matrix: + # include: + # - service: aries-endorser-db + # - service: aries-endorser-agent + # - service: aries-endorser-backup + # - service: aries-endorser-proxy + # - service: aries-endorser-api - steps: - - name: Checkout - uses: actions/checkout@v4 + # steps: + # - name: Checkout + # uses: actions/checkout@v4 - - name: Deploy to ${{ env.ENVIRONMENT }} - uses: ./.github/workflows/actions/deploy - with: - environment: ${{ env.ENVIRONMENT }} - ghcr_token: ${{ secrets.GITHUB_TOKEN }} - github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} - image_digest: ${{ needs.build.outputs[format ('{0}_digest', matrix.service)] }} - openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }} - openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} - namespace: ${{ vars.NAMESPACE }} - deployment_configuration: ${{ matrix.service }} - openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} + # - name: Deploy to ${{ env.ENVIRONMENT }} + # uses: ./.github/workflows/actions/deploy + # with: + # environment: ${{ env.ENVIRONMENT }} + # ghcr_token: ${{ secrets.GITHUB_TOKEN }} + # github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} + # image_digest: ${{ needs.build.outputs[format ('{0}_digest', matrix.service)] }} + # openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }} + # openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} + # namespace: ${{ vars.NAMESPACE }} + # deployment_configuration: ${{ matrix.service }} + # openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} # # deploy2test: From cf5209d897fa1e4fa0032d46ddfcabc013dba0d2 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 22 Feb 2024 14:37:40 -0800 Subject: [PATCH 100/162] TEST Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 143e5f61..ef9c1dc9 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -32,8 +32,8 @@ jobs: SOURCE_IMAGE_REGISTRY: "" SOURCE_IMAGE_NAME: "" SOURCE_IMAGE_TAG: "" - REGISTRY_USERNAME: ARTIFACTORY_USERNAME - REGISTRY_PASSWORD: ARTIFACTORY_PASSWORD + REGISTRY_USERNAME_SECRET_NAME: ARTIFACTORY_USERNAME + REGISTRY_PASSWORD_SECRET_NAME: ARTIFACTORY_PASSWORD - service: aries-endorser-db GIT_REPO_URL: hyperledger/aries-endorser-service PATH: docker/wallet/config @@ -45,16 +45,16 @@ jobs: SOURCE_IMAGE_REGISTRY: "" SOURCE_IMAGE_NAME: "" SOURCE_IMAGE_TAG: "" - REGISTRY_USERNAME: ARTIFACTORY_USERNAME - REGISTRY_PASSWORD: ARTIFACTORY_PASSWORD + REGISTRY_USERNAME_SECRET_NAME: ARTIFACTORY_USERNAME + REGISTRY_PASSWORD_SECRET_NAME: ARTIFACTORY_PASSWORD - service: aries-endorser-proxy DOCKER_FILE_PATH: Dockerfile # The docker path, file, is the relative path to the docker file from the root of the repo. SOURCE_CONTEXT_DIR: proxy # The context dir, context, sets the context for the build. i.e. where the build will source files from SOURCE_IMAGE_REGISTRY: "artifacts.developer.gov.bc.ca/docker-remote/" SOURCE_IMAGE_NAME: caddy SOURCE_IMAGE_TAG: latest - REGISTRY_USERNAME: ARTIFACTORY_USERNAME - REGISTRY_PASSWORD: ARTIFACTORY_PASSWORD + REGISTRY_USERNAME_SECRET_NAME: ARTIFACTORY_USERNAME + REGISTRY_PASSWORD_SECRET_NAME: ARTIFACTORY_PASSWORD - service: aries-endorser-api GIT_REPO_URL: hyperledger/aries-endorser-service DOCKER_FILE_PATH: Dockerfile.endorser # The docker path, file, is the relative path to the docker file from the root of the repo. @@ -62,8 +62,8 @@ jobs: SOURCE_IMAGE_REGISTRY: artifacts.developer.gov.bc.ca/docker-remote/ SOURCE_IMAGE_NAME: python SOURCE_IMAGE_TAG: 3.10-slim-buster - REGISTRY_USERNAME: ARTIFACTORY_USERNAME - REGISTRY_PASSWORD: ARTIFACTORY_PASSWORD + REGISTRY_USERNAME_SECRET_NAME: ARTIFACTORY_USERNAME + REGISTRY_PASSWORD_SECRET_NAME: ARTIFACTORY_PASSWORD outputs: aries-endorser-agent_digest: ${{ steps.digest.outputs.aries-endorser-agent_digest }} aries-endorser-backup_digest: ${{ steps.digest.outputs.aries-endorser-backup_digest }} @@ -82,7 +82,7 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Login to image registry - if: matrix.SOURCE_IMAGE_REGISTRY != '' + if: matrix.SOURCE_IMAGE_REGISTRY != '' && contains(fromJSON('["aries-endorser-db","aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) uses: docker/login-action@v3 with: registry: ${{ matrix.SOURCE_IMAGE_REGISTRY }} @@ -143,7 +143,6 @@ jobs: SOURCE_IMAGE_TAG: ${{ matrix.SOURCE_IMAGE_TAG }} file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} - - name: Build and push Docker image id: docker_build if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) From 6dd266dfaf91900820064c260a97882b5131f576 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 22 Feb 2024 16:53:18 -0800 Subject: [PATCH 101/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index ef9c1dc9..463e2f41 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -93,7 +93,8 @@ jobs: - name: Pull base image for proxy and Create Docker file if: contains(fromJSON('["aries-endorser-proxy"]'), matrix.service) run: | - BASE_IMAGE=${SOURCE_IMAGE_REGISTRY}${SOURCE_IMAGE_NAME}:${SOURCE_IMAGE_TAG} + BASE_IMAGE="${SOURCE_IMAGE_REGISTRY}${SOURCE_IMAGE_NAME}:${SOURCE_IMAGE_TAG}" + echo "$BASE_IMAGE" mkdir ${context} && cd ${context} echo "FROM ${BASE_IMAGE}" > Dockerfile echo "RUN chown 1001:root /usr/bin/caddy" >> Dockerfile @@ -103,7 +104,6 @@ jobs: SOURCE_IMAGE_NAME: ${{ matrix.SOURCE_IMAGE_NAME }} SOURCE_IMAGE_TAG: ${{ matrix.SOURCE_IMAGE_TAG }} - - name: Log in to the GHCR uses: docker/login-action@v3 with: From d04954ef51d915022eb1cee6a7279735f994da5d Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 22 Feb 2024 21:13:56 -0800 Subject: [PATCH 102/162] TEST Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 463e2f41..a17be749 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -134,7 +134,7 @@ jobs: - name: Update Docker base image and pull the base image if access is required if: matrix.SOURCE_IMAGE_REGISTRY != '' && contains(fromJSON('["aries-endorser-db","aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) run: | - BASE_IMAGE="${BASE_SOURCE_IMAGE_REGISTRY}${BASE_SOURCE_IMAGE_NAME}:${BASE_SOURCE_IMAGE_TAG}" + BASE_IMAGE="${SOURCE_IMAGE_REGISTRY}${SOURCE_IMAGE_NAME}:${SOURCE_IMAGE_TAG}" sed -i -e "s;FROM .*;FROM ${BASE_IMAGE};g" "$file" env: context: ${{ matrix.SOURCE_CONTEXT_DIR }} From 3d1d1daf504d25314f3b60f2647c2b5653c34d32 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 22 Feb 2024 21:39:18 -0800 Subject: [PATCH 103/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index a17be749..9a024fcf 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,7 +1,7 @@ name: Build and Deploy Image on: - + workflow_dispatch: push: branches: - workflow From f0f4eacfef348061fd3cf6299572ca6d5b186b5e Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Fri, 23 Feb 2024 10:03:19 -0800 Subject: [PATCH 104/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 9a024fcf..121a313b 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -89,7 +89,6 @@ jobs: username: ${{ secrets[matrix.REGISTRY_USERNAME_SECRET_NAME]}} password: ${{ secrets[matrix.REGISTRY_PASSWORD_SECRET_NAME]}} - - name: Pull base image for proxy and Create Docker file if: contains(fromJSON('["aries-endorser-proxy"]'), matrix.service) run: | @@ -132,7 +131,7 @@ jobs: io.openshift.build.commit.id=${{ github.sha }} - name: Update Docker base image and pull the base image if access is required - if: matrix.SOURCE_IMAGE_REGISTRY != '' && contains(fromJSON('["aries-endorser-db","aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) + if: matrix.SOURCE_IMAGE_REGISTRY != '' && contains(fromJSON('["aries-endorser-db","aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) run: | BASE_IMAGE="${SOURCE_IMAGE_REGISTRY}${SOURCE_IMAGE_NAME}:${SOURCE_IMAGE_TAG}" sed -i -e "s;FROM .*;FROM ${BASE_IMAGE};g" "$file" From 6d04e020effde90e4730fed1c4f1f0b4a6b41f46 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Fri, 23 Feb 2024 11:52:26 -0800 Subject: [PATCH 105/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 121a313b..7cb82c57 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -27,6 +27,7 @@ jobs: include: - service: aries-endorser-agent GIT_REPO_URL: hyperledger/aries-endorser-service + GIT REPO: "" DOCKER_FILE_PATH: Dockerfile.acapy # The docker path, file, is the relative path to the docker file from the root of the repo. SOURCE_CONTEXT_DIR: docker/acapy # The context dir, context, sets the context for the build. i.e. where the build will source files from SOURCE_IMAGE_REGISTRY: "" @@ -36,10 +37,12 @@ jobs: REGISTRY_PASSWORD_SECRET_NAME: ARTIFACTORY_PASSWORD - service: aries-endorser-db GIT_REPO_URL: hyperledger/aries-endorser-service + GIT REPO: "" PATH: docker/wallet/config BUILDER_IMAGE: 'quay.io/fedora/postgresql-13:13' - service: aries-endorser-backup GIT_REPO_URL: BCDevOps/backup-container + GIT REPO: "" DOCKER_FILE_PATH: Dockerfile # The docker path, file, is the relative path to the docker file from the root of the repo. SOURCE_CONTEXT_DIR: docker # The context dir, context, sets the context for the build. i.e. where the build will source files from SOURCE_IMAGE_REGISTRY: "" @@ -48,6 +51,7 @@ jobs: REGISTRY_USERNAME_SECRET_NAME: ARTIFACTORY_USERNAME REGISTRY_PASSWORD_SECRET_NAME: ARTIFACTORY_PASSWORD - service: aries-endorser-proxy + GIT REPO: "" DOCKER_FILE_PATH: Dockerfile # The docker path, file, is the relative path to the docker file from the root of the repo. SOURCE_CONTEXT_DIR: proxy # The context dir, context, sets the context for the build. i.e. where the build will source files from SOURCE_IMAGE_REGISTRY: "artifacts.developer.gov.bc.ca/docker-remote/" @@ -57,6 +61,7 @@ jobs: REGISTRY_PASSWORD_SECRET_NAME: ARTIFACTORY_PASSWORD - service: aries-endorser-api GIT_REPO_URL: hyperledger/aries-endorser-service + GIT REPO: "" DOCKER_FILE_PATH: Dockerfile.endorser # The docker path, file, is the relative path to the docker file from the root of the repo. SOURCE_CONTEXT_DIR: endorser # The context dir, context, sets the context for the build. i.e. where the build will source files from SOURCE_IMAGE_REGISTRY: artifacts.developer.gov.bc.ca/docker-remote/ From 903749be717e8fe9f5ee7f7c2e604318fb8b55bf Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Fri, 23 Feb 2024 12:31:01 -0800 Subject: [PATCH 106/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 7cb82c57..cf31e5ae 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -4,7 +4,7 @@ on: workflow_dispatch: push: branches: - - workflow + - move-tests-to-askar concurrency: group: ${{ github.workflow }}-${{ github.ref }} From 9a4952a731e178700f7cb52dabdc27cb013ff221 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Fri, 23 Feb 2024 13:57:29 -0800 Subject: [PATCH 107/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 47 ++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index cf31e5ae..b6f57699 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -4,7 +4,7 @@ on: workflow_dispatch: push: branches: - - move-tests-to-askar + - concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -28,6 +28,7 @@ jobs: - service: aries-endorser-agent GIT_REPO_URL: hyperledger/aries-endorser-service GIT REPO: "" + GIT_BRANCH: move-tests-to-askar DOCKER_FILE_PATH: Dockerfile.acapy # The docker path, file, is the relative path to the docker file from the root of the repo. SOURCE_CONTEXT_DIR: docker/acapy # The context dir, context, sets the context for the build. i.e. where the build will source files from SOURCE_IMAGE_REGISTRY: "" @@ -38,11 +39,13 @@ jobs: - service: aries-endorser-db GIT_REPO_URL: hyperledger/aries-endorser-service GIT REPO: "" + GIT_BRANCH: move-tests-to-askar PATH: docker/wallet/config BUILDER_IMAGE: 'quay.io/fedora/postgresql-13:13' - service: aries-endorser-backup GIT_REPO_URL: BCDevOps/backup-container GIT REPO: "" + GIT_BRANCH: master DOCKER_FILE_PATH: Dockerfile # The docker path, file, is the relative path to the docker file from the root of the repo. SOURCE_CONTEXT_DIR: docker # The context dir, context, sets the context for the build. i.e. where the build will source files from SOURCE_IMAGE_REGISTRY: "" @@ -52,6 +55,7 @@ jobs: REGISTRY_PASSWORD_SECRET_NAME: ARTIFACTORY_PASSWORD - service: aries-endorser-proxy GIT REPO: "" + GIT_BRANCH: workflow DOCKER_FILE_PATH: Dockerfile # The docker path, file, is the relative path to the docker file from the root of the repo. SOURCE_CONTEXT_DIR: proxy # The context dir, context, sets the context for the build. i.e. where the build will source files from SOURCE_IMAGE_REGISTRY: "artifacts.developer.gov.bc.ca/docker-remote/" @@ -62,6 +66,7 @@ jobs: - service: aries-endorser-api GIT_REPO_URL: hyperledger/aries-endorser-service GIT REPO: "" + GIT_BRANCH: move-tests-to-askar DOCKER_FILE_PATH: Dockerfile.endorser # The docker path, file, is the relative path to the docker file from the root of the repo. SOURCE_CONTEXT_DIR: endorser # The context dir, context, sets the context for the build. i.e. where the build will source files from SOURCE_IMAGE_REGISTRY: artifacts.developer.gov.bc.ca/docker-remote/ @@ -163,27 +168,27 @@ jobs: if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) run: echo "tags=$(echo '${{ steps.meta.outputs.tags }}' | grep -oE ':([^[:space:]]+)' | sed '/workflow/d' | sed 's/://g' | tr '\n' ' ')" >> $GITHUB_OUTPUT - - name: Build database image - id: build_image - if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - uses: redhat-actions/s2i-build@v2 - with: - path_context: ${{ matrix.PATH }} - # Builder image for a java project - builder_image: ${{ matrix.BUILDER_IMAGE }} - image: dts-endorser-service/${{ matrix.service }} - tags: ${{ steps.extract.outputs.tags }} + # - name: Build database image + # id: build_image + # if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + # uses: redhat-actions/s2i-build@v2 + # with: + # path_context: ${{ matrix.PATH }} + # # Builder image for a java project + # builder_image: ${{ matrix.BUILDER_IMAGE }} + # image: dts-endorser-service/${{ matrix.service }} + # tags: ${{ steps.extract.outputs.tags }} - - name: Push database image - id: push - if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - uses: redhat-actions/push-to-registry@v2 - with: - tags: ${{ steps.build_image.outputs.tags }} - image: ${{ steps.build_image.outputs.image }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - registry: ghcr.io/bcgov + # - name: Push database image + # id: push + # if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + # uses: redhat-actions/push-to-registry@v2 + # with: + # tags: ${{ steps.build_image.outputs.tags }} + # image: ${{ steps.build_image.outputs.image }} + # username: ${{ github.actor }} + # password: ${{ secrets.GITHUB_TOKEN }} + # registry: ghcr.io/bcgov - name: Display ${{ matrix.service }} image results id: digests From 2fd0c193e9e793d9e6bdb8264ec5e7125843c489 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Fri, 23 Feb 2024 13:59:08 -0800 Subject: [PATCH 108/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index b6f57699..027c7069 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -4,7 +4,7 @@ on: workflow_dispatch: push: branches: - - + - workflow concurrency: group: ${{ github.workflow }}-${{ github.ref }} From 661bcb9eddcf6e40fa6947adb9aaa1ab8bfd40d1 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Fri, 23 Feb 2024 14:00:56 -0800 Subject: [PATCH 109/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 027c7069..e97dae3e 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -28,7 +28,7 @@ jobs: - service: aries-endorser-agent GIT_REPO_URL: hyperledger/aries-endorser-service GIT REPO: "" - GIT_BRANCH: move-tests-to-askar + BRANCH: move-tests-to-askar DOCKER_FILE_PATH: Dockerfile.acapy # The docker path, file, is the relative path to the docker file from the root of the repo. SOURCE_CONTEXT_DIR: docker/acapy # The context dir, context, sets the context for the build. i.e. where the build will source files from SOURCE_IMAGE_REGISTRY: "" @@ -39,13 +39,13 @@ jobs: - service: aries-endorser-db GIT_REPO_URL: hyperledger/aries-endorser-service GIT REPO: "" - GIT_BRANCH: move-tests-to-askar + BRANCH: move-tests-to-askar PATH: docker/wallet/config BUILDER_IMAGE: 'quay.io/fedora/postgresql-13:13' - service: aries-endorser-backup GIT_REPO_URL: BCDevOps/backup-container GIT REPO: "" - GIT_BRANCH: master + BRANCH: master DOCKER_FILE_PATH: Dockerfile # The docker path, file, is the relative path to the docker file from the root of the repo. SOURCE_CONTEXT_DIR: docker # The context dir, context, sets the context for the build. i.e. where the build will source files from SOURCE_IMAGE_REGISTRY: "" @@ -55,7 +55,7 @@ jobs: REGISTRY_PASSWORD_SECRET_NAME: ARTIFACTORY_PASSWORD - service: aries-endorser-proxy GIT REPO: "" - GIT_BRANCH: workflow + BRANCH: workflow DOCKER_FILE_PATH: Dockerfile # The docker path, file, is the relative path to the docker file from the root of the repo. SOURCE_CONTEXT_DIR: proxy # The context dir, context, sets the context for the build. i.e. where the build will source files from SOURCE_IMAGE_REGISTRY: "artifacts.developer.gov.bc.ca/docker-remote/" @@ -66,7 +66,7 @@ jobs: - service: aries-endorser-api GIT_REPO_URL: hyperledger/aries-endorser-service GIT REPO: "" - GIT_BRANCH: move-tests-to-askar + BRANCH: move-tests-to-askar DOCKER_FILE_PATH: Dockerfile.endorser # The docker path, file, is the relative path to the docker file from the root of the repo. SOURCE_CONTEXT_DIR: endorser # The context dir, context, sets the context for the build. i.e. where the build will source files from SOURCE_IMAGE_REGISTRY: artifacts.developer.gov.bc.ca/docker-remote/ From 97ea771c43b834f8cd31ac4565127e6b5efdae34 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Fri, 23 Feb 2024 14:04:28 -0800 Subject: [PATCH 110/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index e97dae3e..c1af1a55 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -27,7 +27,7 @@ jobs: include: - service: aries-endorser-agent GIT_REPO_URL: hyperledger/aries-endorser-service - GIT REPO: "" + GIT_REPO: "" BRANCH: move-tests-to-askar DOCKER_FILE_PATH: Dockerfile.acapy # The docker path, file, is the relative path to the docker file from the root of the repo. SOURCE_CONTEXT_DIR: docker/acapy # The context dir, context, sets the context for the build. i.e. where the build will source files from @@ -38,13 +38,13 @@ jobs: REGISTRY_PASSWORD_SECRET_NAME: ARTIFACTORY_PASSWORD - service: aries-endorser-db GIT_REPO_URL: hyperledger/aries-endorser-service - GIT REPO: "" + GIT_REPO: "" BRANCH: move-tests-to-askar PATH: docker/wallet/config BUILDER_IMAGE: 'quay.io/fedora/postgresql-13:13' - service: aries-endorser-backup GIT_REPO_URL: BCDevOps/backup-container - GIT REPO: "" + GIT_REPO: "" BRANCH: master DOCKER_FILE_PATH: Dockerfile # The docker path, file, is the relative path to the docker file from the root of the repo. SOURCE_CONTEXT_DIR: docker # The context dir, context, sets the context for the build. i.e. where the build will source files from @@ -54,7 +54,7 @@ jobs: REGISTRY_USERNAME_SECRET_NAME: ARTIFACTORY_USERNAME REGISTRY_PASSWORD_SECRET_NAME: ARTIFACTORY_PASSWORD - service: aries-endorser-proxy - GIT REPO: "" + GIT_REPO: "" BRANCH: workflow DOCKER_FILE_PATH: Dockerfile # The docker path, file, is the relative path to the docker file from the root of the repo. SOURCE_CONTEXT_DIR: proxy # The context dir, context, sets the context for the build. i.e. where the build will source files from @@ -65,7 +65,7 @@ jobs: REGISTRY_PASSWORD_SECRET_NAME: ARTIFACTORY_PASSWORD - service: aries-endorser-api GIT_REPO_URL: hyperledger/aries-endorser-service - GIT REPO: "" + GIT_REPO: "" BRANCH: move-tests-to-askar DOCKER_FILE_PATH: Dockerfile.endorser # The docker path, file, is the relative path to the docker file from the root of the repo. SOURCE_CONTEXT_DIR: endorser # The context dir, context, sets the context for the build. i.e. where the build will source files from From 65fa73fbbebaddbd89eb413d3f4bc220580de8fb Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Sat, 24 Feb 2024 02:48:16 -0800 Subject: [PATCH 111/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index c1af1a55..6815ddf4 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -27,8 +27,7 @@ jobs: include: - service: aries-endorser-agent GIT_REPO_URL: hyperledger/aries-endorser-service - GIT_REPO: "" - BRANCH: move-tests-to-askar + GIT_REF: "" DOCKER_FILE_PATH: Dockerfile.acapy # The docker path, file, is the relative path to the docker file from the root of the repo. SOURCE_CONTEXT_DIR: docker/acapy # The context dir, context, sets the context for the build. i.e. where the build will source files from SOURCE_IMAGE_REGISTRY: "" @@ -36,16 +35,15 @@ jobs: SOURCE_IMAGE_TAG: "" REGISTRY_USERNAME_SECRET_NAME: ARTIFACTORY_USERNAME REGISTRY_PASSWORD_SECRET_NAME: ARTIFACTORY_PASSWORD - - service: aries-endorser-db - GIT_REPO_URL: hyperledger/aries-endorser-service - GIT_REPO: "" - BRANCH: move-tests-to-askar - PATH: docker/wallet/config - BUILDER_IMAGE: 'quay.io/fedora/postgresql-13:13' + # - service: aries-endorser-db + # GIT_REPO_URL: hyperledger/aries-endorser-service + # GIT_REF: "" + # BRANCH: move-tests-to-askar + # PATH: docker/wallet/config + # BUILDER_IMAGE: 'quay.io/fedora/postgresql-13:13' - service: aries-endorser-backup GIT_REPO_URL: BCDevOps/backup-container - GIT_REPO: "" - BRANCH: master + GIT_REF: "" DOCKER_FILE_PATH: Dockerfile # The docker path, file, is the relative path to the docker file from the root of the repo. SOURCE_CONTEXT_DIR: docker # The context dir, context, sets the context for the build. i.e. where the build will source files from SOURCE_IMAGE_REGISTRY: "" @@ -54,8 +52,7 @@ jobs: REGISTRY_USERNAME_SECRET_NAME: ARTIFACTORY_USERNAME REGISTRY_PASSWORD_SECRET_NAME: ARTIFACTORY_PASSWORD - service: aries-endorser-proxy - GIT_REPO: "" - BRANCH: workflow + GIT_REF: "" DOCKER_FILE_PATH: Dockerfile # The docker path, file, is the relative path to the docker file from the root of the repo. SOURCE_CONTEXT_DIR: proxy # The context dir, context, sets the context for the build. i.e. where the build will source files from SOURCE_IMAGE_REGISTRY: "artifacts.developer.gov.bc.ca/docker-remote/" @@ -65,7 +62,7 @@ jobs: REGISTRY_PASSWORD_SECRET_NAME: ARTIFACTORY_PASSWORD - service: aries-endorser-api GIT_REPO_URL: hyperledger/aries-endorser-service - GIT_REPO: "" + GIT_REF: "" BRANCH: move-tests-to-askar DOCKER_FILE_PATH: Dockerfile.endorser # The docker path, file, is the relative path to the docker file from the root of the repo. SOURCE_CONTEXT_DIR: endorser # The context dir, context, sets the context for the build. i.e. where the build will source files from @@ -86,7 +83,7 @@ jobs: uses: actions/checkout@v4 with: repository: ${{ matrix.GIT_REPO_URL }} - ref: ${{ github.ref }} + ref: ${{ matrix.GIT_REF }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -176,7 +173,7 @@ jobs: # path_context: ${{ matrix.PATH }} # # Builder image for a java project # builder_image: ${{ matrix.BUILDER_IMAGE }} - # image: dts-endorser-service/${{ matrix.service }} + # image: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} # tags: ${{ steps.extract.outputs.tags }} # - name: Push database image @@ -188,7 +185,6 @@ jobs: # image: ${{ steps.build_image.outputs.image }} # username: ${{ github.actor }} # password: ${{ secrets.GITHUB_TOKEN }} - # registry: ghcr.io/bcgov - name: Display ${{ matrix.service }} image results id: digests From 58f363f4756d36347616a075b4336b6359668836 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Sat, 24 Feb 2024 03:02:42 -0800 Subject: [PATCH 112/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 50 ++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 6815ddf4..cafb3d26 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -35,12 +35,12 @@ jobs: SOURCE_IMAGE_TAG: "" REGISTRY_USERNAME_SECRET_NAME: ARTIFACTORY_USERNAME REGISTRY_PASSWORD_SECRET_NAME: ARTIFACTORY_PASSWORD - # - service: aries-endorser-db - # GIT_REPO_URL: hyperledger/aries-endorser-service - # GIT_REF: "" - # BRANCH: move-tests-to-askar - # PATH: docker/wallet/config - # BUILDER_IMAGE: 'quay.io/fedora/postgresql-13:13' + - service: aries-endorser-db + GIT_REPO_URL: hyperledger/aries-endorser-service + GIT_REF: "" + BRANCH: move-tests-to-askar + PATH: docker/wallet/config + BUILDER_IMAGE: 'quay.io/fedora/postgresql-13:13' - service: aries-endorser-backup GIT_REPO_URL: BCDevOps/backup-container GIT_REF: "" @@ -165,26 +165,26 @@ jobs: if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) run: echo "tags=$(echo '${{ steps.meta.outputs.tags }}' | grep -oE ':([^[:space:]]+)' | sed '/workflow/d' | sed 's/://g' | tr '\n' ' ')" >> $GITHUB_OUTPUT - # - name: Build database image - # id: build_image - # if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - # uses: redhat-actions/s2i-build@v2 - # with: - # path_context: ${{ matrix.PATH }} - # # Builder image for a java project - # builder_image: ${{ matrix.BUILDER_IMAGE }} - # image: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} - # tags: ${{ steps.extract.outputs.tags }} + - name: Build database image + id: build_image + if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + uses: redhat-actions/s2i-build@v2 + with: + path_context: ${{ matrix.PATH }} + # Builder image for a java project + builder_image: ${{ matrix.BUILDER_IMAGE }} + image: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} + tags: ${{ steps.extract.outputs.tags }} - # - name: Push database image - # id: push - # if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - # uses: redhat-actions/push-to-registry@v2 - # with: - # tags: ${{ steps.build_image.outputs.tags }} - # image: ${{ steps.build_image.outputs.image }} - # username: ${{ github.actor }} - # password: ${{ secrets.GITHUB_TOKEN }} + - name: Push database image + id: push + if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + uses: redhat-actions/push-to-registry@v2 + with: + tags: ${{ steps.build_image.outputs.tags }} + image: ${{ steps.build_image.outputs.image }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Display ${{ matrix.service }} image results id: digests From 10662f330c1a47052f10a368e5aa674306e5b9d9 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Sat, 24 Feb 2024 03:34:42 -0800 Subject: [PATCH 113/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 63 ++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index cafb3d26..802d3a36 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -40,7 +40,9 @@ jobs: GIT_REF: "" BRANCH: move-tests-to-askar PATH: docker/wallet/config - BUILDER_IMAGE: 'quay.io/fedora/postgresql-13:13' + SOURCE_IMAGE_REGISTRY: "hub.docker.com/" + SOURCE_IMAGE_NAME: "alpine" + SOURCE_IMAGE_TAG: "latest" - service: aries-endorser-backup GIT_REPO_URL: BCDevOps/backup-container GIT_REF: "" @@ -84,7 +86,9 @@ jobs: with: repository: ${{ matrix.GIT_REPO_URL }} ref: ${{ matrix.GIT_REF }} - +# ref: github.ref + + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -96,7 +100,14 @@ jobs: username: ${{ secrets[matrix.REGISTRY_USERNAME_SECRET_NAME]}} password: ${{ secrets[matrix.REGISTRY_PASSWORD_SECRET_NAME]}} - - name: Pull base image for proxy and Create Docker file + - name: Log in to the GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create Docker file if: contains(fromJSON('["aries-endorser-proxy"]'), matrix.service) run: | BASE_IMAGE="${SOURCE_IMAGE_REGISTRY}${SOURCE_IMAGE_NAME}:${SOURCE_IMAGE_TAG}" @@ -110,12 +121,7 @@ jobs: SOURCE_IMAGE_NAME: ${{ matrix.SOURCE_IMAGE_NAME }} SOURCE_IMAGE_TAG: ${{ matrix.SOURCE_IMAGE_TAG }} - - name: Log in to the GHCR - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + - name: Prepare docker tags for image id: meta @@ -137,7 +143,7 @@ jobs: io.openshift.build.source-location=${{ github.repositoryUrl }} io.openshift.build.commit.id=${{ github.sha }} - - name: Update Docker base image and pull the base image if access is required + - name: Update Docker base image if: matrix.SOURCE_IMAGE_REGISTRY != '' && contains(fromJSON('["aries-endorser-db","aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) run: | BASE_IMAGE="${SOURCE_IMAGE_REGISTRY}${SOURCE_IMAGE_NAME}:${SOURCE_IMAGE_TAG}" @@ -149,22 +155,6 @@ jobs: SOURCE_IMAGE_TAG: ${{ matrix.SOURCE_IMAGE_TAG }} file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} - - name: Build and push Docker image - id: docker_build - if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) - uses: docker/build-push-action@v5 - with: - context: ${{ matrix.SOURCE_CONTEXT_DIR }} - file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} - push: true - tags: ${{ steps.meta.outputs.tags }} - outputs: type=image,name=target - - - name: Extract Tags - id: extract - if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - run: echo "tags=$(echo '${{ steps.meta.outputs.tags }}' | grep -oE ':([^[:space:]]+)' | sed '/workflow/d' | sed 's/://g' | tr '\n' ' ')" >> $GITHUB_OUTPUT - - name: Build database image id: build_image if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) @@ -172,10 +162,10 @@ jobs: with: path_context: ${{ matrix.PATH }} # Builder image for a java project - builder_image: ${{ matrix.BUILDER_IMAGE }} + builder_image: "${matrix.SOURCE_IMAGE_REGISTRY}${matrix.SOURCE_IMAGE_NAME}:${matrix.SOURCE_IMAGE_TAG}" image: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} tags: ${{ steps.extract.outputs.tags }} - + - name: Push database image id: push if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) @@ -186,6 +176,23 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push Docker image + id: docker_build + if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) + uses: docker/build-push-action@v5 + with: + context: ${{ matrix.SOURCE_CONTEXT_DIR }} + file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} + push: true + tags: ${{ steps.meta.outputs.tags }} + outputs: type=image,name=target + + - name: Extract Tags + id: extract + if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + run: echo "tags=$(echo '${{ steps.meta.outputs.tags }}' | grep -oE ':([^[:space:]]+)' | sed '/workflow/d' | sed 's/://g' | tr '\n' ' ')" >> $GITHUB_OUTPUT + - name: Display ${{ matrix.service }} image results id: digests if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) From 2ec1f1cd431674f74f30ac118d9eb0d1af26c743 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Sat, 24 Feb 2024 03:35:43 -0800 Subject: [PATCH 114/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 802d3a36..b6d2285b 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -100,12 +100,12 @@ jobs: username: ${{ secrets[matrix.REGISTRY_USERNAME_SECRET_NAME]}} password: ${{ secrets[matrix.REGISTRY_PASSWORD_SECRET_NAME]}} - - name: Log in to the GHCR - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + - name: Log in to the GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Create Docker file if: contains(fromJSON('["aries-endorser-proxy"]'), matrix.service) From 155320a2d7cfca96bce4a2b375199582a59ec020 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Sat, 24 Feb 2024 03:44:41 -0800 Subject: [PATCH 115/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index b6d2285b..8f6144f3 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -38,7 +38,6 @@ jobs: - service: aries-endorser-db GIT_REPO_URL: hyperledger/aries-endorser-service GIT_REF: "" - BRANCH: move-tests-to-askar PATH: docker/wallet/config SOURCE_IMAGE_REGISTRY: "hub.docker.com/" SOURCE_IMAGE_NAME: "alpine" @@ -65,7 +64,6 @@ jobs: - service: aries-endorser-api GIT_REPO_URL: hyperledger/aries-endorser-service GIT_REF: "" - BRANCH: move-tests-to-askar DOCKER_FILE_PATH: Dockerfile.endorser # The docker path, file, is the relative path to the docker file from the root of the repo. SOURCE_CONTEXT_DIR: endorser # The context dir, context, sets the context for the build. i.e. where the build will source files from SOURCE_IMAGE_REGISTRY: artifacts.developer.gov.bc.ca/docker-remote/ @@ -87,26 +85,18 @@ jobs: repository: ${{ matrix.GIT_REPO_URL }} ref: ${{ matrix.GIT_REF }} # ref: github.ref - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Login to image registry - if: matrix.SOURCE_IMAGE_REGISTRY != '' && contains(fromJSON('["aries-endorser-db","aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) + if: matrix.SOURCE_IMAGE_REGISTRY != '' && contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) uses: docker/login-action@v3 with: registry: ${{ matrix.SOURCE_IMAGE_REGISTRY }} username: ${{ secrets[matrix.REGISTRY_USERNAME_SECRET_NAME]}} password: ${{ secrets[matrix.REGISTRY_PASSWORD_SECRET_NAME]}} - - - name: Log in to the GHCR - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - + - name: Create Docker file if: contains(fromJSON('["aries-endorser-proxy"]'), matrix.service) run: | @@ -121,8 +111,6 @@ jobs: SOURCE_IMAGE_NAME: ${{ matrix.SOURCE_IMAGE_NAME }} SOURCE_IMAGE_TAG: ${{ matrix.SOURCE_IMAGE_TAG }} - - - name: Prepare docker tags for image id: meta if: contains(fromJSON('["aries-endorser-db","aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) @@ -176,7 +164,6 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push Docker image id: docker_build if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) From 5ede59a4d1377b361ddb1812e61f1dd5342790bc Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Sat, 24 Feb 2024 03:46:52 -0800 Subject: [PATCH 116/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 8f6144f3..4a537f7d 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -132,7 +132,7 @@ jobs: io.openshift.build.commit.id=${{ github.sha }} - name: Update Docker base image - if: matrix.SOURCE_IMAGE_REGISTRY != '' && contains(fromJSON('["aries-endorser-db","aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) + if: matrix.SOURCE_IMAGE_REGISTRY != '' && contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) run: | BASE_IMAGE="${SOURCE_IMAGE_REGISTRY}${SOURCE_IMAGE_NAME}:${SOURCE_IMAGE_TAG}" sed -i -e "s;FROM .*;FROM ${BASE_IMAGE};g" "$file" From 358ebc490de7ca108c0e7dcfef85326a54dec08d Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Sat, 24 Feb 2024 03:58:15 -0800 Subject: [PATCH 117/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 4a537f7d..2ba4a065 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -85,6 +85,7 @@ jobs: repository: ${{ matrix.GIT_REPO_URL }} ref: ${{ matrix.GIT_REF }} # ref: github.ref + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -149,8 +150,8 @@ jobs: uses: redhat-actions/s2i-build@v2 with: path_context: ${{ matrix.PATH }} - # Builder image for a java project - builder_image: "${matrix.SOURCE_IMAGE_REGISTRY}${matrix.SOURCE_IMAGE_NAME}:${matrix.SOURCE_IMAGE_TAG}" + # Builder image for a java projectE_IMAG + builder_image: ${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }} image: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} tags: ${{ steps.extract.outputs.tags }} @@ -164,6 +165,13 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Log in to the GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push Docker image id: docker_build if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) From b92e257389a08990e7e91c062c96f92a23e2a9f3 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Sat, 24 Feb 2024 04:05:46 -0800 Subject: [PATCH 118/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 2ba4a065..cb3a9e6d 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -39,7 +39,7 @@ jobs: GIT_REPO_URL: hyperledger/aries-endorser-service GIT_REF: "" PATH: docker/wallet/config - SOURCE_IMAGE_REGISTRY: "hub.docker.com/" + SOURCE_IMAGE_REGISTRY: "docker.io/" SOURCE_IMAGE_NAME: "alpine" SOURCE_IMAGE_TAG: "latest" - service: aries-endorser-backup @@ -151,7 +151,7 @@ jobs: with: path_context: ${{ matrix.PATH }} # Builder image for a java projectE_IMAG - builder_image: ${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }} + builder_image: ${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }} image: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} tags: ${{ steps.extract.outputs.tags }} From f4005323474cf5d583f98d877adf1944b95c1c5b Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Sat, 24 Feb 2024 04:08:59 -0800 Subject: [PATCH 119/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index cb3a9e6d..b805d1aa 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -144,6 +144,11 @@ jobs: SOURCE_IMAGE_TAG: ${{ matrix.SOURCE_IMAGE_TAG }} file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} + - name: Extract Tags + id: extract + if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + run: echo "tags=$(echo '${{ steps.meta.outputs.tags }}' | grep -oE ':([^[:space:]]+)' | sed '/workflow/d' | sed 's/://g' | tr '\n' ' ')" >> $GITHUB_OUTPUT + - name: Build database image id: build_image if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) @@ -183,11 +188,6 @@ jobs: tags: ${{ steps.meta.outputs.tags }} outputs: type=image,name=target - - name: Extract Tags - id: extract - if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - run: echo "tags=$(echo '${{ steps.meta.outputs.tags }}' | grep -oE ':([^[:space:]]+)' | sed '/workflow/d' | sed 's/://g' | tr '\n' ' ')" >> $GITHUB_OUTPUT - - name: Display ${{ matrix.service }} image results id: digests if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) From 084cb1ec4ee7fc7302a550afb190810d7782c96c Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Sat, 24 Feb 2024 11:44:17 -0800 Subject: [PATCH 120/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index b805d1aa..0e7fc2f3 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -148,6 +148,11 @@ jobs: id: extract if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) run: echo "tags=$(echo '${{ steps.meta.outputs.tags }}' | grep -oE ':([^[:space:]]+)' | sed '/workflow/d' | sed 's/://g' | tr '\n' ' ')" >> $GITHUB_OUTPUT + + - name: Pull database image + if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + run: | + docker pull ${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }} - name: Build database image id: build_image From bd528d7406fb7726e4a211ae645af0850da05213 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Sat, 24 Feb 2024 11:49:50 -0800 Subject: [PATCH 121/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 0e7fc2f3..fb12ecf2 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -39,9 +39,9 @@ jobs: GIT_REPO_URL: hyperledger/aries-endorser-service GIT_REF: "" PATH: docker/wallet/config - SOURCE_IMAGE_REGISTRY: "docker.io/" - SOURCE_IMAGE_NAME: "alpine" - SOURCE_IMAGE_TAG: "latest" + SOURCE_IMAGE_REGISTRY: "quay.io/" + SOURCE_IMAGE_NAME: "fedora/postgresql-13" + SOURCE_IMAGE_TAG: "13" - service: aries-endorser-backup GIT_REPO_URL: BCDevOps/backup-container GIT_REF: "" From 6e34900cfaa40931744d554c903669e64cc19dd1 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Sat, 24 Feb 2024 11:51:46 -0800 Subject: [PATCH 122/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index fb12ecf2..04cfb548 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -174,6 +174,7 @@ jobs: image: ${{ steps.build_image.outputs.image }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + registry: ghcr.io/bcgov - name: Log in to the GHCR uses: docker/login-action@v3 From 5c6cd6f01279334343882ae111a450a2cf2922d9 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Sat, 24 Feb 2024 12:13:48 -0800 Subject: [PATCH 123/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 04cfb548..ec167655 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -174,7 +174,7 @@ jobs: image: ${{ steps.build_image.outputs.image }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - registry: ghcr.io/bcgov + registry: ${{ env.GITHUB_IMAGE_REPO }} - name: Log in to the GHCR uses: docker/login-action@v3 From 87b018856a3e89a44f0b9882884e3dd898105bc0 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Sat, 24 Feb 2024 12:15:28 -0800 Subject: [PATCH 124/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index ec167655..31749c57 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -162,7 +162,7 @@ jobs: path_context: ${{ matrix.PATH }} # Builder image for a java projectE_IMAG builder_image: ${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }} - image: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} + image: dts-endorser-service/${{ matrix.service }} tags: ${{ steps.extract.outputs.tags }} - name: Push database image From 0447fb312f940b094f8a7c486ba6f089371815df Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Mon, 26 Feb 2024 10:40:46 -0800 Subject: [PATCH 125/162] deployment Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 78 ++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 31749c57..86c8d081 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -94,9 +94,9 @@ jobs: if: matrix.SOURCE_IMAGE_REGISTRY != '' && contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) uses: docker/login-action@v3 with: - registry: ${{ matrix.SOURCE_IMAGE_REGISTRY }} - username: ${{ secrets[matrix.REGISTRY_USERNAME_SECRET_NAME]}} - password: ${{ secrets[matrix.REGISTRY_PASSWORD_SECRET_NAME]}} + registry: ${{ matrix.SOURCE_IMAGE_REGISTRY }} + username: ${{ secrets[matrix.REGISTRY_USERNAME_SECRET_NAME]}} + password: ${{ secrets[matrix.REGISTRY_PASSWORD_SECRET_NAME]}} - name: Create Docker file if: contains(fromJSON('["aries-endorser-proxy"]'), matrix.service) @@ -161,8 +161,8 @@ jobs: with: path_context: ${{ matrix.PATH }} # Builder image for a java projectE_IMAG - builder_image: ${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }} - image: dts-endorser-service/${{ matrix.service }} + builder_image: ${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }} + image: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} tags: ${{ steps.extract.outputs.tags }} - name: Push database image @@ -213,42 +213,42 @@ jobs: echo "${{ matrix.service }}_digest=${digest}" >> $GITHUB_OUTPUT cat $GITHUB_OUTPUT - # deploy2dev: - # needs: build - # env: - # ENVIRONMENT: dev - # permissions: - # packages: write - # runs-on: ubuntu-latest - # environment: dev - # strategy: - # # Serialize the deployments - # max-parallel: 1 - # matrix: - # include: - # - service: aries-endorser-db - # - service: aries-endorser-agent - # - service: aries-endorser-backup - # - service: aries-endorser-proxy - # - service: aries-endorser-api + deploy2dev: + needs: build + env: + ENVIRONMENT: dev + permissions: + packages: write + runs-on: ubuntu-latest + environment: dev + strategy: + # Serialize the deployments + max-parallel: 1 + matrix: + include: + - service: aries-endorser-db + - service: aries-endorser-agent + - service: aries-endorser-backup + - service: aries-endorser-proxy + - service: aries-endorser-api - # steps: - # - name: Checkout - # uses: actions/checkout@v4 + steps: + - name: Checkout + uses: actions/checkout@v4 - # - name: Deploy to ${{ env.ENVIRONMENT }} - # uses: ./.github/workflows/actions/deploy - # with: - # environment: ${{ env.ENVIRONMENT }} - # ghcr_token: ${{ secrets.GITHUB_TOKEN }} - # github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} - # image_digest: ${{ needs.build.outputs[format ('{0}_digest', matrix.service)] }} - # openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }} - # openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} - # namespace: ${{ vars.NAMESPACE }} - # deployment_configuration: ${{ matrix.service }} - # openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} - # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} + - name: Deploy to ${{ env.ENVIRONMENT }} + uses: ./.github/workflows/actions/deploy + with: + environment: ${{ env.ENVIRONMENT }} + ghcr_token: ${{ secrets.GITHUB_TOKEN }} + github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} + image_digest: ${{ needs.build.outputs[format ('{0}_digest', matrix.service)] }} + openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }} + openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} + namespace: ${{ vars.NAMESPACE }} + deployment_configuration: ${{ matrix.service }} + openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} + # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} # # deploy2test: # # needs: [build, deploy2dev] From 6b894236002cc3e9058a5e83f00898536ccdf1e4 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Mon, 26 Feb 2024 12:41:38 -0800 Subject: [PATCH 126/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/actions/deploy/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/actions/deploy/action.yaml b/.github/workflows/actions/deploy/action.yaml index 76cc7584..e351dcc5 100644 --- a/.github/workflows/actions/deploy/action.yaml +++ b/.github/workflows/actions/deploy/action.yaml @@ -85,7 +85,7 @@ runs: run: | docker pull ${{ inputs.github_image_name }}@${{ inputs.image_digest }} docker tag ${{ inputs.github_image_name }}@${{ inputs.image_digest }} ${{ inputs.github_image_name }}:${{ inputs.environment }} - docker push ${{ inputs.github_image_name }}:${{ inputs.environment }} + docker push ${{ inputs.OPENSHIFT_IMAGE_REPO }}:${{ inputs.environment }} - name: Tag the image in the OpenShift container registry as ${{ inputs.environment }} shell: bash From e87c7ae19387b7dad74773bcef8b65f2f565d372 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Mon, 26 Feb 2024 12:44:19 -0800 Subject: [PATCH 127/162] deployment Signed-off-by: Rajpal Chauhan --- .github/workflows/actions/deploy/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/actions/deploy/action.yaml b/.github/workflows/actions/deploy/action.yaml index e351dcc5..4b0493b1 100644 --- a/.github/workflows/actions/deploy/action.yaml +++ b/.github/workflows/actions/deploy/action.yaml @@ -85,7 +85,7 @@ runs: run: | docker pull ${{ inputs.github_image_name }}@${{ inputs.image_digest }} docker tag ${{ inputs.github_image_name }}@${{ inputs.image_digest }} ${{ inputs.github_image_name }}:${{ inputs.environment }} - docker push ${{ inputs.OPENSHIFT_IMAGE_REPO }}:${{ inputs.environment }} + docker push ${{ inputs.openshift_image_name }}:${{ inputs.environment }} - name: Tag the image in the OpenShift container registry as ${{ inputs.environment }} shell: bash From 3a9cb1c7898c66a7ab9459cc81389c21537af2af Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Mon, 26 Feb 2024 13:14:51 -0800 Subject: [PATCH 128/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/actions/deploy/action.yaml | 2 +- .github/workflows/main.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/actions/deploy/action.yaml b/.github/workflows/actions/deploy/action.yaml index 4b0493b1..76cc7584 100644 --- a/.github/workflows/actions/deploy/action.yaml +++ b/.github/workflows/actions/deploy/action.yaml @@ -85,7 +85,7 @@ runs: run: | docker pull ${{ inputs.github_image_name }}@${{ inputs.image_digest }} docker tag ${{ inputs.github_image_name }}@${{ inputs.image_digest }} ${{ inputs.github_image_name }}:${{ inputs.environment }} - docker push ${{ inputs.openshift_image_name }}:${{ inputs.environment }} + docker push ${{ inputs.github_image_name }}:${{ inputs.environment }} - name: Tag the image in the OpenShift container registry as ${{ inputs.environment }} shell: bash diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 86c8d081..968f4f4e 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -12,7 +12,7 @@ concurrency: env: GITHUB_IMAGE_REPO: ghcr.io/bcgov/dts-endorser-service/ - OPENSHIFT_IMAGE_REPO: image-registry.apps.silver.devops.gov.bc.ca/4a9599-tools/ + OPENSHIFT_IMAGE_REPO: imageregistry.operator.openshift.io/4a9599-tools/ APP_NAMES: aries-endorser-agent,aries-endorser-db,aries-endorser-backup,aries-endorser-proxy,aries-endorser-api jobs: From 62d9bc1bea6ddb15a6d5a9d023d01af5ec1e61d0 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Mon, 26 Feb 2024 14:10:53 -0800 Subject: [PATCH 129/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 90 ++++++++++++++++++------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 968f4f4e..329f719f 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -35,13 +35,13 @@ jobs: SOURCE_IMAGE_TAG: "" REGISTRY_USERNAME_SECRET_NAME: ARTIFACTORY_USERNAME REGISTRY_PASSWORD_SECRET_NAME: ARTIFACTORY_PASSWORD - - service: aries-endorser-db - GIT_REPO_URL: hyperledger/aries-endorser-service - GIT_REF: "" - PATH: docker/wallet/config - SOURCE_IMAGE_REGISTRY: "quay.io/" - SOURCE_IMAGE_NAME: "fedora/postgresql-13" - SOURCE_IMAGE_TAG: "13" + # - service: aries-endorser-db + # GIT_REPO_URL: hyperledger/aries-endorser-service + # GIT_REF: "" + # PATH: docker/wallet/config + # SOURCE_IMAGE_REGISTRY: "quay.io/" + # SOURCE_IMAGE_NAME: "fedora/postgresql-13" + # SOURCE_IMAGE_TAG: "13" - service: aries-endorser-backup GIT_REPO_URL: BCDevOps/backup-container GIT_REF: "" @@ -76,7 +76,7 @@ jobs: aries-endorser-backup_digest: ${{ steps.digest.outputs.aries-endorser-backup_digest }} aries-endorser-api_digest: ${{ steps.digest.outputs.aries-endorser-api_digest }} aries-endorser-proxy_digest: ${{ steps.digest.outputs.aries-endorser-proxy_digest }} - aries-endorser-db_digest: ${{ steps.digests.outputs.aries-endorser-db_digest }} + # aries-endorser-db_digest: ${{ steps.digests.outputs.aries-endorser-db_digest }} steps: - name: Checkout @@ -144,37 +144,37 @@ jobs: SOURCE_IMAGE_TAG: ${{ matrix.SOURCE_IMAGE_TAG }} file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} - - name: Extract Tags - id: extract - if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - run: echo "tags=$(echo '${{ steps.meta.outputs.tags }}' | grep -oE ':([^[:space:]]+)' | sed '/workflow/d' | sed 's/://g' | tr '\n' ' ')" >> $GITHUB_OUTPUT + # - name: Extract Tags + # id: extract + # if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + # run: echo "tags=$(echo '${{ steps.meta.outputs.tags }}' | grep -oE ':([^[:space:]]+)' | sed '/workflow/d' | sed 's/://g' | tr '\n' ' ')" >> $GITHUB_OUTPUT - - name: Pull database image - if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - run: | - docker pull ${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }} + # - name: Pull database image + # if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + # run: | + # docker pull ${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }} - - name: Build database image - id: build_image - if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - uses: redhat-actions/s2i-build@v2 - with: - path_context: ${{ matrix.PATH }} - # Builder image for a java projectE_IMAG - builder_image: ${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }} - image: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} - tags: ${{ steps.extract.outputs.tags }} + # - name: Build database image + # id: build_image + # if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + # uses: redhat-actions/s2i-build@v2 + # with: + # path_context: ${{ matrix.PATH }} + # # Builder image for a java projectE_IMAG + # builder_image: ${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }} + # image: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} + # tags: ${{ steps.extract.outputs.tags }} - - name: Push database image - id: push - if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - uses: redhat-actions/push-to-registry@v2 - with: - tags: ${{ steps.build_image.outputs.tags }} - image: ${{ steps.build_image.outputs.image }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - registry: ${{ env.GITHUB_IMAGE_REPO }} + # - name: Push database image + # id: push + # if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + # uses: redhat-actions/push-to-registry@v2 + # with: + # tags: ${{ steps.build_image.outputs.tags }} + # image: ${{ steps.build_image.outputs.image }} + # username: ${{ github.actor }} + # password: ${{ secrets.GITHUB_TOKEN }} + # registry: ${{ env.GITHUB_IMAGE_REPO }} - name: Log in to the GHCR uses: docker/login-action@v3 @@ -194,14 +194,14 @@ jobs: tags: ${{ steps.meta.outputs.tags }} outputs: type=image,name=target - - name: Display ${{ matrix.service }} image results - id: digests - if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - run: | - echo "registry_path=${{ steps.push.outputs.registry-paths }}" - digest=${{ steps.push.outputs.digest }} - echo "digest=${digest}" - echo "${{ matrix.service }}_digest=${digest}" >> $GITHUB_OUTPUT + # - name: Display ${{ matrix.service }} image results + # id: digests + # if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + # run: | + # echo "registry_path=${{ steps.push.outputs.registry-paths }}" + # digest=${{ steps.push.outputs.digest }} + # echo "digest=${digest}" + # echo "${{ matrix.service }}_digest=${digest}" >> $GITHUB_OUTPUT - name: Display ${{ matrix.service}} image results id: digest @@ -226,7 +226,7 @@ jobs: max-parallel: 1 matrix: include: - - service: aries-endorser-db + # - service: aries-endorser-db - service: aries-endorser-agent - service: aries-endorser-backup - service: aries-endorser-proxy From 2f4f7b05db166f42046b93b172f58a9a145b8099 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Mon, 26 Feb 2024 14:15:09 -0800 Subject: [PATCH 130/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 329f719f..08e3754c 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -12,7 +12,7 @@ concurrency: env: GITHUB_IMAGE_REPO: ghcr.io/bcgov/dts-endorser-service/ - OPENSHIFT_IMAGE_REPO: imageregistry.operator.openshift.io/4a9599-tools/ + OPENSHIFT_IMAGE_REPO: image-registry.apps.silver.devops.gov.bc.ca/4a9599-tools/ APP_NAMES: aries-endorser-agent,aries-endorser-db,aries-endorser-backup,aries-endorser-proxy,aries-endorser-api jobs: From cd484133c1d01971f1a844f8e27f008383190ea9 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Mon, 26 Feb 2024 15:03:16 -0800 Subject: [PATCH 131/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 138 ++++++++++++++++++------------------ 1 file changed, 69 insertions(+), 69 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 08e3754c..c08ac15a 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -144,37 +144,37 @@ jobs: SOURCE_IMAGE_TAG: ${{ matrix.SOURCE_IMAGE_TAG }} file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} - # - name: Extract Tags - # id: extract - # if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - # run: echo "tags=$(echo '${{ steps.meta.outputs.tags }}' | grep -oE ':([^[:space:]]+)' | sed '/workflow/d' | sed 's/://g' | tr '\n' ' ')" >> $GITHUB_OUTPUT + - name: Extract Tags + id: extract + if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + run: echo "tags=$(echo '${{ steps.meta.outputs.tags }}' | grep -oE ':([^[:space:]]+)' | sed '/workflow/d' | sed 's/://g' | tr '\n' ' ')" >> $GITHUB_OUTPUT - # - name: Pull database image - # if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - # run: | - # docker pull ${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }} + - name: Pull database image + if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + run: | + docker pull ${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }} - # - name: Build database image - # id: build_image - # if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - # uses: redhat-actions/s2i-build@v2 - # with: - # path_context: ${{ matrix.PATH }} - # # Builder image for a java projectE_IMAG - # builder_image: ${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }} - # image: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} - # tags: ${{ steps.extract.outputs.tags }} + - name: Build database image + id: build_image + if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + uses: redhat-actions/s2i-build@v2 + with: + path_context: ${{ matrix.PATH }} + # Builder image for a java projectE_IMAG + builder_image: ${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }} + image: ${{ matrix.service }} + tags: ${{ steps.extract.outputs.tags }} - # - name: Push database image - # id: push - # if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - # uses: redhat-actions/push-to-registry@v2 - # with: - # tags: ${{ steps.build_image.outputs.tags }} - # image: ${{ steps.build_image.outputs.image }} - # username: ${{ github.actor }} - # password: ${{ secrets.GITHUB_TOKEN }} - # registry: ${{ env.GITHUB_IMAGE_REPO }} + - name: Push database image + id: push + if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + uses: redhat-actions/push-to-registry@v2 + with: + tags: ${{ steps.build_image.outputs.tags }} + image: ${{ steps.build_image.outputs.image }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + registry: ${{ env.GITHUB_IMAGE_REPO }} - name: Log in to the GHCR uses: docker/login-action@v3 @@ -194,14 +194,14 @@ jobs: tags: ${{ steps.meta.outputs.tags }} outputs: type=image,name=target - # - name: Display ${{ matrix.service }} image results - # id: digests - # if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - # run: | - # echo "registry_path=${{ steps.push.outputs.registry-paths }}" - # digest=${{ steps.push.outputs.digest }} - # echo "digest=${digest}" - # echo "${{ matrix.service }}_digest=${digest}" >> $GITHUB_OUTPUT + - name: Display ${{ matrix.service }} image results + id: digests + if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + run: | + echo "registry_path=${{ steps.push.outputs.registry-paths }}" + digest=${{ steps.push.outputs.digest }} + echo "digest=${digest}" + echo "${{ matrix.service }}_digest=${digest}" >> $GITHUB_OUTPUT - name: Display ${{ matrix.service}} image results id: digest @@ -213,41 +213,41 @@ jobs: echo "${{ matrix.service }}_digest=${digest}" >> $GITHUB_OUTPUT cat $GITHUB_OUTPUT - deploy2dev: - needs: build - env: - ENVIRONMENT: dev - permissions: - packages: write - runs-on: ubuntu-latest - environment: dev - strategy: - # Serialize the deployments - max-parallel: 1 - matrix: - include: - # - service: aries-endorser-db - - service: aries-endorser-agent - - service: aries-endorser-backup - - service: aries-endorser-proxy - - service: aries-endorser-api + # deploy2dev: + # needs: build + # env: + # ENVIRONMENT: dev + # permissions: + # packages: write + # runs-on: ubuntu-latest + # environment: dev + # strategy: + # # Serialize the deployments + # max-parallel: 1 + # matrix: + # include: + # # - service: aries-endorser-db + # - service: aries-endorser-agent + # - service: aries-endorser-backup + # - service: aries-endorser-proxy + # - service: aries-endorser-api - steps: - - name: Checkout - uses: actions/checkout@v4 + # steps: + # - name: Checkout + # uses: actions/checkout@v4 - - name: Deploy to ${{ env.ENVIRONMENT }} - uses: ./.github/workflows/actions/deploy - with: - environment: ${{ env.ENVIRONMENT }} - ghcr_token: ${{ secrets.GITHUB_TOKEN }} - github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} - image_digest: ${{ needs.build.outputs[format ('{0}_digest', matrix.service)] }} - openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }} - openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} - namespace: ${{ vars.NAMESPACE }} - deployment_configuration: ${{ matrix.service }} - openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} + # - name: Deploy to ${{ env.ENVIRONMENT }} + # uses: ./.github/workflows/actions/deploy + # with: + # environment: ${{ env.ENVIRONMENT }} + # ghcr_token: ${{ secrets.GITHUB_TOKEN }} + # github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} + # image_digest: ${{ needs.build.outputs[format ('{0}_digest', matrix.service)] }} + # openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }} + # openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} + # namespace: ${{ vars.NAMESPACE }} + # deployment_configuration: ${{ matrix.service }} + # openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} # # deploy2test: From 0f21e23df090b06c5bf35865a85b912eca1c04e1 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Mon, 26 Feb 2024 15:15:56 -0800 Subject: [PATCH 132/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index c08ac15a..b5bba67a 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -35,13 +35,13 @@ jobs: SOURCE_IMAGE_TAG: "" REGISTRY_USERNAME_SECRET_NAME: ARTIFACTORY_USERNAME REGISTRY_PASSWORD_SECRET_NAME: ARTIFACTORY_PASSWORD - # - service: aries-endorser-db - # GIT_REPO_URL: hyperledger/aries-endorser-service - # GIT_REF: "" - # PATH: docker/wallet/config - # SOURCE_IMAGE_REGISTRY: "quay.io/" - # SOURCE_IMAGE_NAME: "fedora/postgresql-13" - # SOURCE_IMAGE_TAG: "13" + - service: aries-endorser-db + GIT_REPO_URL: hyperledger/aries-endorser-service + GIT_REF: "" + PATH: docker/wallet/config + SOURCE_IMAGE_REGISTRY: "quay.io/" + SOURCE_IMAGE_NAME: "fedora/postgresql-13" + SOURCE_IMAGE_TAG: "13" - service: aries-endorser-backup GIT_REPO_URL: BCDevOps/backup-container GIT_REF: "" @@ -76,7 +76,7 @@ jobs: aries-endorser-backup_digest: ${{ steps.digest.outputs.aries-endorser-backup_digest }} aries-endorser-api_digest: ${{ steps.digest.outputs.aries-endorser-api_digest }} aries-endorser-proxy_digest: ${{ steps.digest.outputs.aries-endorser-proxy_digest }} - # aries-endorser-db_digest: ${{ steps.digests.outputs.aries-endorser-db_digest }} + aries-endorser-db_digest: ${{ steps.digests.outputs.aries-endorser-db_digest }} steps: - name: Checkout From 58d43c70289ce4aea4ef911ce9406e31772efa92 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Mon, 26 Feb 2024 15:19:57 -0800 Subject: [PATCH 133/162] deployment Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 66 ++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index b5bba67a..cc246ad1 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -213,41 +213,41 @@ jobs: echo "${{ matrix.service }}_digest=${digest}" >> $GITHUB_OUTPUT cat $GITHUB_OUTPUT - # deploy2dev: - # needs: build - # env: - # ENVIRONMENT: dev - # permissions: - # packages: write - # runs-on: ubuntu-latest - # environment: dev - # strategy: - # # Serialize the deployments - # max-parallel: 1 - # matrix: - # include: - # # - service: aries-endorser-db - # - service: aries-endorser-agent - # - service: aries-endorser-backup - # - service: aries-endorser-proxy - # - service: aries-endorser-api + deploy2dev: + needs: build + env: + ENVIRONMENT: dev + permissions: + packages: write + runs-on: ubuntu-latest + environment: dev + strategy: + # Serialize the deployments + max-parallel: 1 + matrix: + include: + # - service: aries-endorser-db + - service: aries-endorser-agent + - service: aries-endorser-backup + - service: aries-endorser-proxy + - service: aries-endorser-api - # steps: - # - name: Checkout - # uses: actions/checkout@v4 + steps: + - name: Checkout + uses: actions/checkout@v4 - # - name: Deploy to ${{ env.ENVIRONMENT }} - # uses: ./.github/workflows/actions/deploy - # with: - # environment: ${{ env.ENVIRONMENT }} - # ghcr_token: ${{ secrets.GITHUB_TOKEN }} - # github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} - # image_digest: ${{ needs.build.outputs[format ('{0}_digest', matrix.service)] }} - # openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }} - # openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} - # namespace: ${{ vars.NAMESPACE }} - # deployment_configuration: ${{ matrix.service }} - # openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} + - name: Deploy to ${{ env.ENVIRONMENT }} + uses: ./.github/workflows/actions/deploy + with: + environment: ${{ env.ENVIRONMENT }} + ghcr_token: ${{ secrets.GITHUB_TOKEN }} + github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} + image_digest: ${{ needs.build.outputs[format ('{0}_digest', matrix.service)] }} + openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }} + openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} + namespace: ${{ vars.NAMESPACE }} + deployment_configuration: ${{ matrix.service }} + openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} # # deploy2test: From 813056147883d101774e1e4a23951b82137f3ed8 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Mon, 26 Feb 2024 15:23:18 -0800 Subject: [PATCH 134/162] final deployment Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index cc246ad1..3e58d70a 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -226,7 +226,7 @@ jobs: max-parallel: 1 matrix: include: - # - service: aries-endorser-db + - service: aries-endorser-db - service: aries-endorser-agent - service: aries-endorser-backup - service: aries-endorser-proxy From c2a5fc086d3b75999b15eafec4d08aaf974dc8ad Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Tue, 27 Feb 2024 18:23:08 -0800 Subject: [PATCH 135/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 149 ++++++++++++++++++------------------ 1 file changed, 75 insertions(+), 74 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 3e58d70a..b307ef2e 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -38,18 +38,18 @@ jobs: - service: aries-endorser-db GIT_REPO_URL: hyperledger/aries-endorser-service GIT_REF: "" - PATH: docker/wallet/config + SOURCE_CONTEXT_DIR: docker/wallet/config SOURCE_IMAGE_REGISTRY: "quay.io/" SOURCE_IMAGE_NAME: "fedora/postgresql-13" SOURCE_IMAGE_TAG: "13" - service: aries-endorser-backup GIT_REPO_URL: BCDevOps/backup-container - GIT_REF: "" + GIT_REF: 2.5.1 DOCKER_FILE_PATH: Dockerfile # The docker path, file, is the relative path to the docker file from the root of the repo. SOURCE_CONTEXT_DIR: docker # The context dir, context, sets the context for the build. i.e. where the build will source files from - SOURCE_IMAGE_REGISTRY: "" - SOURCE_IMAGE_NAME: "" - SOURCE_IMAGE_TAG: "" + SOURCE_IMAGE_REGISTRY: artifacts.developer.gov.bc.ca/docker-remote/ + SOURCE_IMAGE_NAME: centos/postgresql-13-centos7 + SOURCE_IMAGE_TAG: 20210722-70dc4d3 REGISTRY_USERNAME_SECRET_NAME: ARTIFACTORY_USERNAME REGISTRY_PASSWORD_SECRET_NAME: ARTIFACTORY_PASSWORD - service: aries-endorser-proxy @@ -84,8 +84,6 @@ jobs: with: repository: ${{ matrix.GIT_REPO_URL }} ref: ${{ matrix.GIT_REF }} -# ref: github.ref - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -98,23 +96,23 @@ jobs: username: ${{ secrets[matrix.REGISTRY_USERNAME_SECRET_NAME]}} password: ${{ secrets[matrix.REGISTRY_PASSWORD_SECRET_NAME]}} - - name: Create Docker file + - name: Create Dockerfile for ${{ matrix.service }} if: contains(fromJSON('["aries-endorser-proxy"]'), matrix.service) run: | - BASE_IMAGE="${SOURCE_IMAGE_REGISTRY}${SOURCE_IMAGE_NAME}:${SOURCE_IMAGE_TAG}" + BASE_IMAGE="${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }}" echo "$BASE_IMAGE" - mkdir ${context} && cd ${context} + mkdir ${{ matrix.SOURCE_CONTEXT_DIR }} && cd ${{ matrix.SOURCE_CONTEXT_DIR }} echo "FROM ${BASE_IMAGE}" > Dockerfile echo "RUN chown 1001:root /usr/bin/caddy" >> Dockerfile - env: - context: ${{ matrix.SOURCE_CONTEXT_DIR }} - SOURCE_IMAGE_REGISTRY: ${{ matrix.SOURCE_IMAGE_REGISTRY }} - SOURCE_IMAGE_NAME: ${{ matrix.SOURCE_IMAGE_NAME }} - SOURCE_IMAGE_TAG: ${{ matrix.SOURCE_IMAGE_TAG }} + # env: + # context: ${{ matrix.SOURCE_CONTEXT_DIR }} + # SOURCE_IMAGE_REGISTRY: ${{ matrix.SOURCE_IMAGE_REGISTRY }} + # SOURCE_IMAGE_NAME: ${{ matrix.SOURCE_IMAGE_NAME }} + # SOURCE_IMAGE_TAG: ${{ matrix.SOURCE_IMAGE_TAG }} - name: Prepare docker tags for image id: meta - if: contains(fromJSON('["aries-endorser-db","aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) + # if: contains(fromJSON('["aries-endorser-db","aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) uses: docker/metadata-action@v5 with: images: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} @@ -129,30 +127,30 @@ jobs: type=semver,pattern={{major}} type=sha,value=latest labels: | - io.openshift.build.source-location=${{ github.repositoryUrl }} - io.openshift.build.commit.id=${{ github.sha }} + ca.bc.gov.digitaltrust.build.source-location=${{ github.repositoryUrl }} + ca.bc.gov.digitaltrust.build.commit.id=${{ github.sha }} - name: Update Docker base image if: matrix.SOURCE_IMAGE_REGISTRY != '' && contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) run: | - BASE_IMAGE="${SOURCE_IMAGE_REGISTRY}${SOURCE_IMAGE_NAME}:${SOURCE_IMAGE_TAG}" - sed -i -e "s;FROM .*;FROM ${BASE_IMAGE};g" "$file" - env: - context: ${{ matrix.SOURCE_CONTEXT_DIR }} - SOURCE_IMAGE_REGISTRY: ${{ matrix.SOURCE_IMAGE_REGISTRY }} - SOURCE_IMAGE_NAME: ${{ matrix.SOURCE_IMAGE_NAME }} - SOURCE_IMAGE_TAG: ${{ matrix.SOURCE_IMAGE_TAG }} - file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} + BASE_IMAGE="${{ matrix.SOURCE_IMAGE_REGISTRY }}$${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }}" + sed -i -e "s;FROM .*;FROM ${BASE_IMAGE};g" "${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }}" + # env: + # context: ${{ matrix.SOURCE_CONTEXT_DIR }} + # SOURCE_IMAGE_REGISTRY: ${{ matrix.SOURCE_IMAGE_REGISTRY }} + # SOURCE_IMAGE_NAME: ${{ matrix.SOURCE_IMAGE_NAME }} + # SOURCE_IMAGE_TAG: ${{ matrix.SOURCE_IMAGE_TAG }} + # file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} - name: Extract Tags id: extract if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) run: echo "tags=$(echo '${{ steps.meta.outputs.tags }}' | grep -oE ':([^[:space:]]+)' | sed '/workflow/d' | sed 's/://g' | tr '\n' ' ')" >> $GITHUB_OUTPUT - - name: Pull database image - if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - run: | - docker pull ${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }} + # - name: Pull database image + # if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + # run: | + # docker pull ${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }} - name: Build database image id: build_image @@ -160,10 +158,12 @@ jobs: uses: redhat-actions/s2i-build@v2 with: path_context: ${{ matrix.PATH }} - # Builder image for a java projectE_IMAG - builder_image: ${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }} + builder_image: "${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }}" image: ${{ matrix.service }} tags: ${{ steps.extract.outputs.tags }} + labels: | + ca.bc.gov.digitaltrust.build.source-location=${{ github.repositoryUrl }} + ca.bc.gov.digitaltrust.build.commit.id=${{ github.sha }} - name: Push database image id: push @@ -176,12 +176,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} registry: ${{ env.GITHUB_IMAGE_REPO }} - - name: Log in to the GHCR - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + # - name: Log in to the GHCR + # uses: docker/login-action@v3 + # with: + # registry: ghcr.io + # username: ${{ github.actor }} + # password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker image id: docker_build @@ -193,6 +193,9 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} outputs: type=image,name=target + labels: | + ca.bc.gov.digitaltrust.build.source-location=${{ github.repositoryUrl }} + ca.bc.gov.digitaltrust.build.commit.id=${{ github.sha }} - name: Display ${{ matrix.service }} image results id: digests @@ -213,41 +216,41 @@ jobs: echo "${{ matrix.service }}_digest=${digest}" >> $GITHUB_OUTPUT cat $GITHUB_OUTPUT - deploy2dev: - needs: build - env: - ENVIRONMENT: dev - permissions: - packages: write - runs-on: ubuntu-latest - environment: dev - strategy: - # Serialize the deployments - max-parallel: 1 - matrix: - include: - - service: aries-endorser-db - - service: aries-endorser-agent - - service: aries-endorser-backup - - service: aries-endorser-proxy - - service: aries-endorser-api + # deploy2dev: + # needs: build + # env: + # ENVIRONMENT: dev + # permissions: + # packages: write + # runs-on: ubuntu-latest + # environment: dev + # strategy: + # # Serialize the deployments + # max-parallel: 1 + # matrix: + # include: + # - service: aries-endorser-db + # - service: aries-endorser-agent + # - service: aries-endorser-backup + # - service: aries-endorser-proxy + # - service: aries-endorser-api - steps: - - name: Checkout - uses: actions/checkout@v4 + # steps: + # - name: Checkout + # uses: actions/checkout@v4 - - name: Deploy to ${{ env.ENVIRONMENT }} - uses: ./.github/workflows/actions/deploy - with: - environment: ${{ env.ENVIRONMENT }} - ghcr_token: ${{ secrets.GITHUB_TOKEN }} - github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} - image_digest: ${{ needs.build.outputs[format ('{0}_digest', matrix.service)] }} - openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }} - openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} - namespace: ${{ vars.NAMESPACE }} - deployment_configuration: ${{ matrix.service }} - openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} + # - name: Deploy to ${{ env.ENVIRONMENT }} + # uses: ./.github/workflows/actions/deploy + # with: + # environment: ${{ env.ENVIRONMENT }} + # ghcr_token: ${{ secrets.GITHUB_TOKEN }} + # github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} + # image_digest: ${{ needs.build.outputs[format ('{0}_digest', matrix.service)] }} + # openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }} + # openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} + # namespace: ${{ vars.NAMESPACE }} + # deployment_configuration: ${{ matrix.service }} + # openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} # # deploy2test: @@ -302,6 +305,4 @@ jobs: # # namespace: ${{ vars.NAMESPACE }} # # deployment_configuration: ${{ env.APP_NAME }} # # openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} - # # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} - - # # aries-endorser-db, aries-endorser-backup, aries-endorser-proxy, aries-endorser-api \ No newline at end of file + # # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }}`` \ No newline at end of file From 8d7e6531a4dbbe1504e9e8a04c5f0e816bd2bf6b Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Tue, 27 Feb 2024 18:29:54 -0800 Subject: [PATCH 136/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index b307ef2e..eda58068 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -101,7 +101,7 @@ jobs: run: | BASE_IMAGE="${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }}" echo "$BASE_IMAGE" - mkdir ${{ matrix.SOURCE_CONTEXT_DIR }} && cd ${{ matrix.SOURCE_CONTEXT_DIR }} + mkdir "${{ matrix.SOURCE_CONTEXT_DIR }}" && cd "${{ matrix.SOURCE_CONTEXT_DIR }}" echo "FROM ${BASE_IMAGE}" > Dockerfile echo "RUN chown 1001:root /usr/bin/caddy" >> Dockerfile # env: @@ -133,7 +133,7 @@ jobs: - name: Update Docker base image if: matrix.SOURCE_IMAGE_REGISTRY != '' && contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) run: | - BASE_IMAGE="${{ matrix.SOURCE_IMAGE_REGISTRY }}$${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }}" + BASE_IMAGE="${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }}" sed -i -e "s;FROM .*;FROM ${BASE_IMAGE};g" "${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }}" # env: # context: ${{ matrix.SOURCE_CONTEXT_DIR }} From c4a0fbe58cd551d9ab214b583d73cae73a5177c4 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Tue, 27 Feb 2024 18:51:40 -0800 Subject: [PATCH 137/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index eda58068..034b837c 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -161,9 +161,6 @@ jobs: builder_image: "${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }}" image: ${{ matrix.service }} tags: ${{ steps.extract.outputs.tags }} - labels: | - ca.bc.gov.digitaltrust.build.source-location=${{ github.repositoryUrl }} - ca.bc.gov.digitaltrust.build.commit.id=${{ github.sha }} - name: Push database image id: push From aff51958f250f54c370c261a660f012e00020c57 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Tue, 27 Feb 2024 18:59:52 -0800 Subject: [PATCH 138/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 034b837c..d3dd42b6 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -157,7 +157,7 @@ jobs: if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) uses: redhat-actions/s2i-build@v2 with: - path_context: ${{ matrix.PATH }} + path_context: ${{ matrix.SOURCE_CONTEXT_DIR}} builder_image: "${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }}" image: ${{ matrix.service }} tags: ${{ steps.extract.outputs.tags }} From 77be9fb0cc0216435561fca1ae85cec29f805d5e Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Tue, 27 Feb 2024 19:03:55 -0800 Subject: [PATCH 139/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index d3dd42b6..b45611b7 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -147,10 +147,10 @@ jobs: if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) run: echo "tags=$(echo '${{ steps.meta.outputs.tags }}' | grep -oE ':([^[:space:]]+)' | sed '/workflow/d' | sed 's/://g' | tr '\n' ' ')" >> $GITHUB_OUTPUT - # - name: Pull database image - # if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - # run: | - # docker pull ${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }} + - name: Pull database image + if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + run: | + docker pull ${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }} - name: Build database image id: build_image From f39664bbe13f34b733c63aa33da3591eac5c8c96 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Tue, 27 Feb 2024 19:10:23 -0800 Subject: [PATCH 140/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index b45611b7..5a1db73a 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -89,7 +89,7 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Login to image registry - if: matrix.SOURCE_IMAGE_REGISTRY != '' && contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) + if: matrix.REGISTRY_USERNAME_SECRET_NAME != '' uses: docker/login-action@v3 with: registry: ${{ matrix.SOURCE_IMAGE_REGISTRY }} From 513deb257558fc325cdbef3844da763d12bd8648 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 28 Feb 2024 11:36:10 -0800 Subject: [PATCH 141/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 5a1db73a..145fbe77 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -2,6 +2,11 @@ name: Build and Deploy Image on: workflow_dispatch: + inputs: + git_ref: + description: 'Git ref to build from' + required: true + push: branches: - workflow @@ -38,7 +43,7 @@ jobs: - service: aries-endorser-db GIT_REPO_URL: hyperledger/aries-endorser-service GIT_REF: "" - SOURCE_CONTEXT_DIR: docker/wallet/config + SOURCE_CONTEXT_DIR: docker/wallet/config SOURCE_IMAGE_REGISTRY: "quay.io/" SOURCE_IMAGE_NAME: "fedora/postgresql-13" SOURCE_IMAGE_TAG: "13" @@ -145,12 +150,12 @@ jobs: - name: Extract Tags id: extract if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - run: echo "tags=$(echo '${{ steps.meta.outputs.tags }}' | grep -oE ':([^[:space:]]+)' | sed '/workflow/d' | sed 's/://g' | tr '\n' ' ')" >> $GITHUB_OUTPUT + run: echo "tags=$(echo '${{ steps.meta.outputs.tags }}' | grep -oE ':([^[:space:]]+)' | sed '/workflow/d' | sed 's/://g' | tr '\n' ' ')" >> $GITHUB_OUTPUT - - name: Pull database image - if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - run: | - docker pull ${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }} + # - name: Pull database image + # if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + # run: | + # docker pull ${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }} - name: Build database image id: build_image @@ -173,12 +178,13 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} registry: ${{ env.GITHUB_IMAGE_REPO }} - # - name: Log in to the GHCR - # uses: docker/login-action@v3 - # with: - # registry: ghcr.io - # username: ${{ github.actor }} - # password: ${{ secrets.GITHUB_TOKEN }} + - name: Log in to the GHCR + if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker image id: docker_build From 9ec31a61f5404c3183c01c49a5b7c94e40ff62f2 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 28 Feb 2024 11:38:30 -0800 Subject: [PATCH 142/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 145fbe77..f0bf031d 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -152,10 +152,10 @@ jobs: if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) run: echo "tags=$(echo '${{ steps.meta.outputs.tags }}' | grep -oE ':([^[:space:]]+)' | sed '/workflow/d' | sed 's/://g' | tr '\n' ' ')" >> $GITHUB_OUTPUT - # - name: Pull database image - # if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - # run: | - # docker pull ${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }} + - name: Pull database image + if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + run: | + docker pull ${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }} - name: Build database image id: build_image From 092776e4dc83bbaf5debed6e62c60b5f678ff192 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 28 Feb 2024 11:41:14 -0800 Subject: [PATCH 143/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index f0bf031d..0b520d67 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -38,8 +38,8 @@ jobs: SOURCE_IMAGE_REGISTRY: "" SOURCE_IMAGE_NAME: "" SOURCE_IMAGE_TAG: "" - REGISTRY_USERNAME_SECRET_NAME: ARTIFACTORY_USERNAME - REGISTRY_PASSWORD_SECRET_NAME: ARTIFACTORY_PASSWORD + REGISTRY_USERNAME_SECRET_NAME: "" + REGISTRY_PASSWORD_SECRET_NAME: "" - service: aries-endorser-db GIT_REPO_URL: hyperledger/aries-endorser-service GIT_REF: "" From 83f886dc6c2b5b2a4277281b1d5871b24bf5eadd Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 28 Feb 2024 13:22:02 -0800 Subject: [PATCH 144/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 0b520d67..83f271d2 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -109,15 +109,9 @@ jobs: mkdir "${{ matrix.SOURCE_CONTEXT_DIR }}" && cd "${{ matrix.SOURCE_CONTEXT_DIR }}" echo "FROM ${BASE_IMAGE}" > Dockerfile echo "RUN chown 1001:root /usr/bin/caddy" >> Dockerfile - # env: - # context: ${{ matrix.SOURCE_CONTEXT_DIR }} - # SOURCE_IMAGE_REGISTRY: ${{ matrix.SOURCE_IMAGE_REGISTRY }} - # SOURCE_IMAGE_NAME: ${{ matrix.SOURCE_IMAGE_NAME }} - # SOURCE_IMAGE_TAG: ${{ matrix.SOURCE_IMAGE_TAG }} - name: Prepare docker tags for image id: meta - # if: contains(fromJSON('["aries-endorser-db","aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) uses: docker/metadata-action@v5 with: images: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} @@ -140,12 +134,6 @@ jobs: run: | BASE_IMAGE="${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }}" sed -i -e "s;FROM .*;FROM ${BASE_IMAGE};g" "${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }}" - # env: - # context: ${{ matrix.SOURCE_CONTEXT_DIR }} - # SOURCE_IMAGE_REGISTRY: ${{ matrix.SOURCE_IMAGE_REGISTRY }} - # SOURCE_IMAGE_NAME: ${{ matrix.SOURCE_IMAGE_NAME }} - # SOURCE_IMAGE_TAG: ${{ matrix.SOURCE_IMAGE_TAG }} - # file: ${{ matrix.SOURCE_CONTEXT_DIR }}/${{ matrix.DOCKER_FILE_PATH }} - name: Extract Tags id: extract From 7ce469ee79c60b74b2626092c9502ff8bf4ad778 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 28 Feb 2024 14:05:05 -0800 Subject: [PATCH 145/162] Deploy to dev Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 79 ++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 41 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 83f271d2..1565ec2b 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -2,11 +2,6 @@ name: Build and Deploy Image on: workflow_dispatch: - inputs: - git_ref: - description: 'Git ref to build from' - required: true - push: branches: - workflow @@ -144,7 +139,8 @@ jobs: if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) run: | docker pull ${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }} - + # The docs for redhat-actions/s2i-build imply that the pull should not be needed, yet in practice the build fails if the pull is not done first to make the image local. + - name: Build database image id: build_image if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) @@ -154,7 +150,8 @@ jobs: builder_image: "${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }}" image: ${{ matrix.service }} tags: ${{ steps.extract.outputs.tags }} - + # labels would have to be added to the image after the S2I build + - name: Push database image id: push if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) @@ -207,42 +204,42 @@ jobs: echo "${{ matrix.service }}_digest=${digest}" >> $GITHUB_OUTPUT cat $GITHUB_OUTPUT - # deploy2dev: - # needs: build - # env: - # ENVIRONMENT: dev - # permissions: - # packages: write - # runs-on: ubuntu-latest - # environment: dev - # strategy: - # # Serialize the deployments - # max-parallel: 1 - # matrix: - # include: - # - service: aries-endorser-db - # - service: aries-endorser-agent - # - service: aries-endorser-backup - # - service: aries-endorser-proxy - # - service: aries-endorser-api + deploy2dev: + needs: build + env: + ENVIRONMENT: dev + permissions: + packages: write + runs-on: ubuntu-latest + environment: dev + strategy: + # Serialize the deployments + max-parallel: 1 + matrix: + include: + - service: aries-endorser-db + - service: aries-endorser-agent + - service: aries-endorser-backup + - service: aries-endorser-proxy + - service: aries-endorser-api - # steps: - # - name: Checkout - # uses: actions/checkout@v4 + steps: + - name: Checkout + uses: actions/checkout@v4 - # - name: Deploy to ${{ env.ENVIRONMENT }} - # uses: ./.github/workflows/actions/deploy - # with: - # environment: ${{ env.ENVIRONMENT }} - # ghcr_token: ${{ secrets.GITHUB_TOKEN }} - # github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} - # image_digest: ${{ needs.build.outputs[format ('{0}_digest', matrix.service)] }} - # openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }} - # openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} - # namespace: ${{ vars.NAMESPACE }} - # deployment_configuration: ${{ matrix.service }} - # openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} - # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} + - name: Deploy to ${{ env.ENVIRONMENT }} + uses: ./.github/workflows/actions/deploy + with: + environment: ${{ env.ENVIRONMENT }} + ghcr_token: ${{ secrets.GITHUB_TOKEN }} + github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} + image_digest: ${{ needs.build.outputs[format ('{0}_digest', matrix.service)] }} + openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }} + openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} + namespace: ${{ vars.NAMESPACE }} + deployment_configuration: ${{ matrix.service }} + openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} + rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} # # deploy2test: # # needs: [build, deploy2dev] From 6adeaafd7c8d58086897157a21bbfe681eb7a282 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Wed, 28 Feb 2024 14:11:00 -0800 Subject: [PATCH 146/162] deployment with rocket chat notification Signed-off-by: Rajpal Chauhan --- .github/workflows/actions/deploy/action.yaml | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/actions/deploy/action.yaml b/.github/workflows/actions/deploy/action.yaml index 76cc7584..9e0224fd 100644 --- a/.github/workflows/actions/deploy/action.yaml +++ b/.github/workflows/actions/deploy/action.yaml @@ -100,14 +100,14 @@ runs: echo starting rollout in ${{ inputs.namespace }} oc -n ${{ inputs.namespace }} rollout status dc/${{ inputs.deployment_configuration }} --watch - # - name: Rocket.Chat Notification - # uses: RocketChat/Rocket.Chat.GitHub.Action.Notification@1.1.1 - # if: always() - # with: - # type: ${{ job.status }} - # job_name: '*Deployment to ${{ inputs.environment }}*' - # mention: 'here' - # mention_if: 'failure' - # channel: '#ditp-gha-notifications' - # url: ${{ inputs.rocketchat_webhook }} - # commit: true \ No newline at end of file + - name: Rocket.Chat Notification + uses: RocketChat/Rocket.Chat.GitHub.Action.Notification@1.1.1 + if: always() + with: + type: ${{ job.status }} + job_name: '*Deployment to ${{ inputs.environment }}*' + mention: 'here' + mention_if: 'failure' + channel: '#ditp-gha-notifications' + url: ${{ inputs.rocketchat_webhook }} + commit: true \ No newline at end of file From 51e26810263850aa5456183bdba1149b3e581e00 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 29 Feb 2024 09:53:55 -0800 Subject: [PATCH 147/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 1565ec2b..eaf6e6c2 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -89,7 +89,7 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Login to image registry - if: matrix.REGISTRY_USERNAME_SECRET_NAME != '' + if: matrix.REGISTRY_USERNAME_SECRET_NAME != ''&& matrix.SOURCE_IMAGE_REGISTRY != '' uses: docker/login-action@v3 with: registry: ${{ matrix.SOURCE_IMAGE_REGISTRY }} @@ -151,7 +151,7 @@ jobs: image: ${{ matrix.service }} tags: ${{ steps.extract.outputs.tags }} # labels would have to be added to the image after the S2I build - + - name: Push database image id: push if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) From d08ea485427fcac4f1087ca529252aee36c92431 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 29 Feb 2024 11:37:11 -0800 Subject: [PATCH 148/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 157 +++++++++++++++++++++++------------- 1 file changed, 99 insertions(+), 58 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index eaf6e6c2..3f83028f 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -2,6 +2,47 @@ name: Build and Deploy Image on: workflow_dispatch: + inputs: + service: + description: 'Service to build and deploy' + required: true + default: 'aries-endorser-agent' + git_repo_url: + description: 'Git repository URL' + required: true + default: 'hyperledger/aries-endorser-service' + git_ref: + description: 'Git reference (branch or tag)' + required: false + default: '' + docker_file_path: + description: 'Path to Dockerfile' + required: true + default: 'Dockerfile.acapy' + source_context_dir: + description: 'Source context directory for the build' + required: true + default: 'docker/acapy' + source_image_registry: + description: 'Source image registry' + required: false + default: '' + source_image_name: + description: 'Source image name' + required: false + default: '' + source_image_tag: + description: 'Source image tag' + required: false + default: '' + registry_username_secret_name: + description: 'Secret name for registry username' + required: false + default: 'ARTIFACTORY_USERNAME' + registry_password_secret_name: + description: 'Secret name for registry password' + required: false + default: 'ARTIFACTORY_PASSWORD' push: branches: - workflow @@ -204,69 +245,69 @@ jobs: echo "${{ matrix.service }}_digest=${digest}" >> $GITHUB_OUTPUT cat $GITHUB_OUTPUT - deploy2dev: - needs: build - env: - ENVIRONMENT: dev - permissions: - packages: write - runs-on: ubuntu-latest - environment: dev - strategy: - # Serialize the deployments - max-parallel: 1 - matrix: - include: - - service: aries-endorser-db - - service: aries-endorser-agent - - service: aries-endorser-backup - - service: aries-endorser-proxy - - service: aries-endorser-api + # deploy2dev: + # needs: build + # env: + # ENVIRONMENT: dev + # permissions: + # packages: write + # runs-on: ubuntu-latest + # environment: dev + # strategy: + # # Serialize the deployments + # max-parallel: 1 + # matrix: + # include: + # - service: aries-endorser-db + # - service: aries-endorser-agent + # - service: aries-endorser-backup + # - service: aries-endorser-proxy + # - service: aries-endorser-api - steps: - - name: Checkout - uses: actions/checkout@v4 + # steps: + # - name: Checkout + # uses: actions/checkout@v4 - - name: Deploy to ${{ env.ENVIRONMENT }} - uses: ./.github/workflows/actions/deploy - with: - environment: ${{ env.ENVIRONMENT }} - ghcr_token: ${{ secrets.GITHUB_TOKEN }} - github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} - image_digest: ${{ needs.build.outputs[format ('{0}_digest', matrix.service)] }} - openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }} - openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} - namespace: ${{ vars.NAMESPACE }} - deployment_configuration: ${{ matrix.service }} - openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} - rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} + # - name: Deploy to ${{ env.ENVIRONMENT }} + # uses: ./.github/workflows/actions/deploy + # with: + # environment: ${{ env.ENVIRONMENT }} + # ghcr_token: ${{ secrets.GITHUB_TOKEN }} + # github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} + # image_digest: ${{ needs.build.outputs[format ('{0}_digest', matrix.service)] }} + # openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }} + # openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} + # namespace: ${{ vars.NAMESPACE }} + # deployment_configuration: ${{ matrix.service }} + # openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} + # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} - # # deploy2test: - # # needs: [build, deploy2dev] - # # env: - # # ENVIRONMENT: test - # # permissions: - # # packages: write - # # runs-on: ubuntu-latest - # # environment: test + # deploy2test: + # needs: [build, deploy2dev] + # env: + # ENVIRONMENT: test + # permissions: + # packages: write + # runs-on: ubuntu-latest + # environment: test - # # steps: - # # - name: Checkout - # # uses: actions/checkout@v3 + # steps: + # - name: Checkout + # uses: actions/checkout@v3 - # # - name: deploy to ${{ env.ENVIRONMENT }} - # # uses: ./.github/workflows/actions/deploy - # # with: - # # environment: ${{ env.ENVIRONMENT }} - # # ghcr_token: ${{ secrets.GITHUB_TOKEN }} - # # github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ env.APP_NAME }} - # # image_digest: ${{ needs.build.outputs.image_digest }} - # # openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ env.APP_NAME }} - # # openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} - # # namespace: ${{ vars.NAMESPACE }} - # # deployment_configuration: ${{ env.APP_NAME }} - # # openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} - # # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} + # - name: deploy to ${{ env.ENVIRONMENT }} + # uses: ./.github/workflows/actions/deploy + # with: + # environment: ${{ env.ENVIRONMENT }} + # ghcr_token: ${{ secrets.GITHUB_TOKEN }} + # github_image_name: ${{ env.GITHUB_IMAGE_REPO }}${{ matrix.service }} + # image_digest: ${{ needs.build.outputs[format ('{0}_digest', matrix.service)] }} + # openshift_image_name: ${{ env.OPENSHIFT_IMAGE_REPO }}${{ matrix.service }} + # openshift_server_url: ${{ vars.OPENSHIFT_SERVER_URL }} + # namespace: ${{ vars.NAMESPACE }} + # deployment_configuration: ${{ matrix.service }} + # openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} + # rocketchat_webhook: ${{ secrets.ROCKETCHAT_WEBHOOK }} # # deploy2prod: # # needs: [build, deploy2dev, deploy2test] From 28e651b90d4702f55735152c27b0f8a4744dfd85 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 29 Feb 2024 11:38:31 -0800 Subject: [PATCH 149/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 3f83028f..4fc56610 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -45,7 +45,7 @@ on: default: 'ARTIFACTORY_PASSWORD' push: branches: - - workflow + - enhancement concurrency: group: ${{ github.workflow }}-${{ github.ref }} From 3d048aa34c764022248a58b139b16eb0783da276 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 29 Feb 2024 11:45:16 -0800 Subject: [PATCH 150/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 4fc56610..78c5987c 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -3,10 +3,10 @@ name: Build and Deploy Image on: workflow_dispatch: inputs: - service: - description: 'Service to build and deploy' - required: true - default: 'aries-endorser-agent' + # service: + # description: 'Service to build and deploy' + # required: true + # default: 'aries-endorser-agent' git_repo_url: description: 'Git repository URL' required: true @@ -58,7 +58,7 @@ env: jobs: build: - if: (github.repository == 'bcgov/dts-endorser-service') || (github.event_name == 'workflow_dispatch') + if: (github.repository == 'bcgov/dts-endorser-service') || (github.event_name == 'workflow_dispatch' && github.event.inputs.service) name: Build Image permissions: packages: write From cca759190ff420363cb8559bd1c4abcee06d2b92 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 29 Feb 2024 11:51:26 -0800 Subject: [PATCH 151/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 72 ++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 78c5987c..671d7639 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -7,42 +7,42 @@ on: # description: 'Service to build and deploy' # required: true # default: 'aries-endorser-agent' - git_repo_url: - description: 'Git repository URL' - required: true - default: 'hyperledger/aries-endorser-service' - git_ref: - description: 'Git reference (branch or tag)' - required: false - default: '' - docker_file_path: - description: 'Path to Dockerfile' - required: true - default: 'Dockerfile.acapy' - source_context_dir: - description: 'Source context directory for the build' - required: true - default: 'docker/acapy' - source_image_registry: - description: 'Source image registry' - required: false - default: '' - source_image_name: - description: 'Source image name' - required: false - default: '' - source_image_tag: - description: 'Source image tag' - required: false - default: '' - registry_username_secret_name: - description: 'Secret name for registry username' - required: false - default: 'ARTIFACTORY_USERNAME' - registry_password_secret_name: - description: 'Secret name for registry password' - required: false - default: 'ARTIFACTORY_PASSWORD' + # git_repo_url: + # description: 'Git repository URL' + # required: true + # default: 'hyperledger/aries-endorser-service' + # git_ref: + # description: 'Git reference (branch or tag)' + # required: false + # default: '' + # docker_file_path: + # description: 'Path to Dockerfile' + # required: true + # default: 'Dockerfile.acapy' + # source_context_dir: + # description: 'Source context directory for the build' + # required: true + # default: 'docker/acapy' + # source_image_registry: + # description: 'Source image registry' + # required: false + # default: '' + # source_image_name: + # description: 'Source image name' + # required: false + # default: '' + # source_image_tag: + # description: 'Source image tag' + # required: false + # default: '' + # registry_username_secret_name: + # description: 'Secret name for registry username' + # required: false + # default: 'ARTIFACTORY_USERNAME' + # registry_password_secret_name: + # description: 'Secret name for registry password' + # required: false + # default: 'ARTIFACTORY_PASSWORD' push: branches: - enhancement From 64ce9bb2c39288580b6f21935249fb40535c05c9 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 29 Feb 2024 11:58:52 -0800 Subject: [PATCH 152/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 671d7639..7800579c 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -174,7 +174,7 @@ jobs: - name: Extract Tags id: extract if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - run: echo "tags=$(echo '${{ steps.meta.outputs.tags }}' | grep -oE ':([^[:space:]]+)' | sed '/workflow/d' | sed 's/://g' | tr '\n' ' ')" >> $GITHUB_OUTPUT + run: echo "tags=$(echo '${{ steps.meta.outputs.tags }}' | grep -oE ':([^[:space:]]+)' | sed '/enhancement/d' | sed 's/://g' | tr '\n' ' ')" >> $GITHUB_OUTPUT - name: Pull database image if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) From 269f78d250443797a52c2b6232086c846dceb745 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 29 Feb 2024 12:00:18 -0800 Subject: [PATCH 153/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 80 ++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 7800579c..459e24eb 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -3,46 +3,46 @@ name: Build and Deploy Image on: workflow_dispatch: inputs: - # service: - # description: 'Service to build and deploy' - # required: true - # default: 'aries-endorser-agent' - # git_repo_url: - # description: 'Git repository URL' - # required: true - # default: 'hyperledger/aries-endorser-service' - # git_ref: - # description: 'Git reference (branch or tag)' - # required: false - # default: '' - # docker_file_path: - # description: 'Path to Dockerfile' - # required: true - # default: 'Dockerfile.acapy' - # source_context_dir: - # description: 'Source context directory for the build' - # required: true - # default: 'docker/acapy' - # source_image_registry: - # description: 'Source image registry' - # required: false - # default: '' - # source_image_name: - # description: 'Source image name' - # required: false - # default: '' - # source_image_tag: - # description: 'Source image tag' - # required: false - # default: '' - # registry_username_secret_name: - # description: 'Secret name for registry username' - # required: false - # default: 'ARTIFACTORY_USERNAME' - # registry_password_secret_name: - # description: 'Secret name for registry password' - # required: false - # default: 'ARTIFACTORY_PASSWORD' + service: + description: 'Service to build and deploy' + required: true + default: 'aries-endorser-agent' + git_repo_url: + description: 'Git repository URL' + required: true + default: 'hyperledger/aries-endorser-service' + git_ref: + description: 'Git reference (branch or tag)' + required: false + default: '' + docker_file_path: + description: 'Path to Dockerfile' + required: true + default: 'Dockerfile.acapy' + source_context_dir: + description: 'Source context directory for the build' + required: true + default: 'docker/acapy' + source_image_registry: + description: 'Source image registry' + required: false + default: '' + source_image_name: + description: 'Source image name' + required: false + default: '' + source_image_tag: + description: 'Source image tag' + required: false + default: '' + registry_username_secret_name: + description: 'Secret name for registry username' + required: false + default: 'ARTIFACTORY_USERNAME' + registry_password_secret_name: + description: 'Secret name for registry password' + required: false + default: 'ARTIFACTORY_PASSWORD' push: branches: - enhancement From 2a7ded7ea1a8e51d5333e526e7bfa5420b2d8105 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 29 Feb 2024 19:06:20 -0800 Subject: [PATCH 154/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 459e24eb..3fa59025 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -190,9 +190,16 @@ jobs: path_context: ${{ matrix.SOURCE_CONTEXT_DIR}} builder_image: "${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }}" image: ${{ matrix.service }} - tags: ${{ steps.extract.outputs.tags }} + tags: ${{ steps.extract.outputs.tags }} # labels would have to be added to the image after the S2I build + - name: Apply Labels to Database Image + id: apply_labels + if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) + run: | + docker tag ${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }} ${{ matrix.service }}:${{ steps.extract.outputs.tags }} + docker push ${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }} + - name: Push database image id: push if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) From fbef10432c1688092544481643ff3d0b160ed508 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 29 Feb 2024 19:10:29 -0800 Subject: [PATCH 155/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 3fa59025..3c76283a 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -197,8 +197,9 @@ jobs: id: apply_labels if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) run: | - docker tag ${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }} ${{ matrix.service }}:${{ steps.extract.outputs.tags }} - docker push ${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }} + docker tag "${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }}" "${{ matrix.service }}:${{ steps.extract.outputs.tags }}" + docker push "${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }}" + - name: Push database image id: push From 33069b27a4696e0d116cdfb5a22ecdc7722a31de Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Thu, 29 Feb 2024 19:12:41 -0800 Subject: [PATCH 156/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 3c76283a..93cc3511 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -197,8 +197,9 @@ jobs: id: apply_labels if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) run: | - docker tag "${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }}" "${{ matrix.service }}:${{ steps.extract.outputs.tags }}" - docker push "${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }}" + docker tag "${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }}" "${{ matrix.SERVICE }}:${{ steps.extract.outputs.tags }}" + docker push "${{ matrix.SERVICE }}:${{ steps.extract.outputs.tags }}" + - name: Push database image From 1b5211eac078a81d23863bb30e41dec9b5644fb3 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Fri, 8 Mar 2024 09:52:02 -0800 Subject: [PATCH 157/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 45 ++++--------------------------------- 1 file changed, 4 insertions(+), 41 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 93cc3511..cef34dc9 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -6,46 +6,10 @@ on: service: description: 'Service to build and deploy' required: true - default: 'aries-endorser-agent' - git_repo_url: - description: 'Git repository URL' - required: true - default: 'hyperledger/aries-endorser-service' - git_ref: - description: 'Git reference (branch or tag)' - required: false - default: '' - docker_file_path: - description: 'Path to Dockerfile' - required: true - default: 'Dockerfile.acapy' - source_context_dir: - description: 'Source context directory for the build' - required: true - default: 'docker/acapy' - source_image_registry: - description: 'Source image registry' - required: false - default: '' - source_image_name: - description: 'Source image name' - required: false - default: '' - source_image_tag: - description: 'Source image tag' - required: false - default: '' - registry_username_secret_name: - description: 'Secret name for registry username' - required: false - default: 'ARTIFACTORY_USERNAME' - registry_password_secret_name: - description: 'Secret name for registry password' - required: false - default: 'ARTIFACTORY_PASSWORD' + default: "" push: branches: - - enhancement + - inputs concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -55,6 +19,7 @@ env: GITHUB_IMAGE_REPO: ghcr.io/bcgov/dts-endorser-service/ OPENSHIFT_IMAGE_REPO: image-registry.apps.silver.devops.gov.bc.ca/4a9599-tools/ APP_NAMES: aries-endorser-agent,aries-endorser-db,aries-endorser-backup,aries-endorser-proxy,aries-endorser-api + JSON_INPUT: ${{ github.event.inputs.service }} jobs: build: @@ -174,7 +139,7 @@ jobs: - name: Extract Tags id: extract if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - run: echo "tags=$(echo '${{ steps.meta.outputs.tags }}' | grep -oE ':([^[:space:]]+)' | sed '/enhancement/d' | sed 's/://g' | tr '\n' ' ')" >> $GITHUB_OUTPUT + run: echo "tags=$(echo '${{ steps.meta.outputs.tags }}' | grep -oE ':([^[:space:]]+)' | sed '/inputs/d' | sed 's/://g' | tr '\n' ' ')" >> $GITHUB_OUTPUT - name: Pull database image if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) @@ -199,8 +164,6 @@ jobs: run: | docker tag "${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }}" "${{ matrix.SERVICE }}:${{ steps.extract.outputs.tags }}" docker push "${{ matrix.SERVICE }}:${{ steps.extract.outputs.tags }}" - - - name: Push database image id: push From ffeda5d0015dfd42d9ef317bcbc8a10dd4a3acd4 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Mon, 11 Mar 2024 16:20:45 -0700 Subject: [PATCH 158/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index cef34dc9..af307cfd 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -32,7 +32,7 @@ jobs: matrix: include: - service: aries-endorser-agent - GIT_REPO_URL: hyperledger/aries-endorser-service + GIT_REPO_URL: ${{ inputs.service.endoser.agent_git_repo_url || 'hyperledger/aries-endorser-service' }} GIT_REF: "" DOCKER_FILE_PATH: Dockerfile.acapy # The docker path, file, is the relative path to the docker file from the root of the repo. SOURCE_CONTEXT_DIR: docker/acapy # The context dir, context, sets the context for the build. i.e. where the build will source files from From 43ca18c4828e251717c4eb7b7c0e618df9bc3a9a Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Mon, 11 Mar 2024 17:08:17 -0700 Subject: [PATCH 159/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 39 +++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index af307cfd..fb64ba37 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -33,14 +33,14 @@ jobs: include: - service: aries-endorser-agent GIT_REPO_URL: ${{ inputs.service.endoser.agent_git_repo_url || 'hyperledger/aries-endorser-service' }} - GIT_REF: "" - DOCKER_FILE_PATH: Dockerfile.acapy # The docker path, file, is the relative path to the docker file from the root of the repo. - SOURCE_CONTEXT_DIR: docker/acapy # The context dir, context, sets the context for the build. i.e. where the build will source files from - SOURCE_IMAGE_REGISTRY: "" - SOURCE_IMAGE_NAME: "" - SOURCE_IMAGE_TAG: "" - REGISTRY_USERNAME_SECRET_NAME: "" - REGISTRY_PASSWORD_SECRET_NAME: "" + GIT_REF: ${{ inputs.service.endoser.git_ref || '' }} + DOCKER_FILE_PATH: ${{ inputs.service.endoser.docker_file_path || 'Dockerfile.acapy' }} # The docker path, file, is the relative path to the docker file from the root of the repo. + SOURCE_CONTEXT_DIR: ${{ inputs.service.endoser.source_context_dir || 'docker/acapy' }} # The context dir, context, sets the context for the build. i.e. where the build will source files from + SOURCE_IMAGE_REGISTRY: ${{ inputs.service.endoser.source_image_registry || '' }} + SOURCE_IMAGE_NAME: ${{ inputs.service.endoser.source_image_name || '' }} + SOURCE_IMAGE_TAG: ${{ inputs.service.endoser.source_image_tag || '' }} + REGISTRY_USERNAME_SECRET_NAME: ${{ inputs.service.endoser.username_secret_name || '' }} + REGISTRY_PASSWORD_SECRET_NAME: ${{ inputs.service.endoser.password_secret_name || '' }} - service: aries-endorser-db GIT_REPO_URL: hyperledger/aries-endorser-service GIT_REF: "" @@ -139,7 +139,13 @@ jobs: - name: Extract Tags id: extract if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) - run: echo "tags=$(echo '${{ steps.meta.outputs.tags }}' | grep -oE ':([^[:space:]]+)' | sed '/inputs/d' | sed 's/://g' | tr '\n' ' ')" >> $GITHUB_OUTPUT + run: | + tags=$(echo "${{ steps.meta.outputs.tags }}" | grep -oE ':([^[:space:]]+)' | sed '/label/d' | sed 's/://g' | tr '\n' ' ') + single_tag=$(echo "$tags" | cut -d " " -f 1) + remaining_tags=$(echo "$tags" | cut -d' ' -f2-) + echo "tags=$tags" >> $GITHUB_OUTPUT + echo "single_tag=$single_tag" >> $GITHUB_OUTPUT + echo "remaining_tags=$remaining_tags" >> $GITHUB_OUTPUT - name: Pull database image if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) @@ -158,12 +164,21 @@ jobs: tags: ${{ steps.extract.outputs.tags }} # labels would have to be added to the image after the S2I build - - name: Apply Labels to Database Image + - name: Apply Labels and tags to Database Image id: apply_labels if: contains(fromJSON('["aries-endorser-db"]'), matrix.service) run: | - docker tag "${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }}" "${{ matrix.SERVICE }}:${{ steps.extract.outputs.tags }}" - docker push "${{ matrix.SERVICE }}:${{ steps.extract.outputs.tags }}" + echo "FROM ${{ steps.build_image.outputs.image }}:${{ steps.extract.outputs.single_tag }}" | docker build -t ${{ steps.build_image.outputs.image }}:${{ steps.extract.outputs.single_tag }} --label ca.bc.gov.digitaltrust.build.source-location=${{ github.repositoryUrl }} --label ca.bc.gov.digitaltrust.build.commit.id=${{ github.sha }} - + + - name: Apply Tags to Docker Image + run: | + remaining_tags="${{ steps.extract.outputs.remaining_tags }}" + image_name="${{ steps.build_image.outputs.image }}" + IFS=' ' read -r -a tags_array <<< "$remaining_tags" + # Loop through the tags and apply each one to the Docker image + for tag in "${tags_array[@]}"; do + docker tag "$image_name:${{ steps.extract.outputs.single_tag }}" "$image_name:$tag" + done - name: Push database image id: push From 2c9574f50900c1ec1f60f14daa386d8f3f4cbe58 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Mon, 11 Mar 2024 17:17:15 -0700 Subject: [PATCH 160/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index fb64ba37..5c4a5a97 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -32,18 +32,18 @@ jobs: matrix: include: - service: aries-endorser-agent - GIT_REPO_URL: ${{ inputs.service.endoser.agent_git_repo_url || 'hyperledger/aries-endorser-service' }} - GIT_REF: ${{ inputs.service.endoser.git_ref || '' }} - DOCKER_FILE_PATH: ${{ inputs.service.endoser.docker_file_path || 'Dockerfile.acapy' }} # The docker path, file, is the relative path to the docker file from the root of the repo. - SOURCE_CONTEXT_DIR: ${{ inputs.service.endoser.source_context_dir || 'docker/acapy' }} # The context dir, context, sets the context for the build. i.e. where the build will source files from - SOURCE_IMAGE_REGISTRY: ${{ inputs.service.endoser.source_image_registry || '' }} - SOURCE_IMAGE_NAME: ${{ inputs.service.endoser.source_image_name || '' }} - SOURCE_IMAGE_TAG: ${{ inputs.service.endoser.source_image_tag || '' }} - REGISTRY_USERNAME_SECRET_NAME: ${{ inputs.service.endoser.username_secret_name || '' }} - REGISTRY_PASSWORD_SECRET_NAME: ${{ inputs.service.endoser.password_secret_name || '' }} + GIT_REPO_URL: ${{ inputs.service.endoser-agent.git_repo_url || 'hyperledger/aries-endorser-service' }} + GIT_REF: ${{ inputs.service.endoser-agent.git_ref || '' }} + DOCKER_FILE_PATH: ${{ inputs.service.endoser-agent.docker_file_path || 'Dockerfile.acapy' }} # The docker path, file, is the relative path to the docker file from the root of the repo. + SOURCE_CONTEXT_DIR: ${{ inputs.service.endoser-agent.source_context_dir || 'docker/acapy' }} # The context dir, context, sets the context for the build. i.e. where the build will source files from + SOURCE_IMAGE_REGISTRY: ${{ inputs.service.endoser-agent.source_image_registry || '' }} + SOURCE_IMAGE_NAME: ${{ inputs.service.endoser-agent.source_image_name || '' }} + SOURCE_IMAGE_TAG: ${{ inputs.service.endoser-agent.source_image_tag || '' }} + REGISTRY_USERNAME_SECRET_NAME: ${{ inputs.service.endoser-agent.username_secret_name || '' }} + REGISTRY_PASSWORD_SECRET_NAME: ${{ inputs.service.endoser-agent.password_secret_name || '' }} - service: aries-endorser-db - GIT_REPO_URL: hyperledger/aries-endorser-service - GIT_REF: "" + GIT_REPO_URL: ${{ inputs.service.endoser-db.git_repo_url || 'hyperledger/aries-endorser-db' }} + GIT_REF: ${{ inputs.service.endoser-db.git_ref || '' }} SOURCE_CONTEXT_DIR: docker/wallet/config SOURCE_IMAGE_REGISTRY: "quay.io/" SOURCE_IMAGE_NAME: "fedora/postgresql-13" @@ -161,7 +161,7 @@ jobs: path_context: ${{ matrix.SOURCE_CONTEXT_DIR}} builder_image: "${{ matrix.SOURCE_IMAGE_REGISTRY }}${{ matrix.SOURCE_IMAGE_NAME }}:${{ matrix.SOURCE_IMAGE_TAG }}" image: ${{ matrix.service }} - tags: ${{ steps.extract.outputs.tags }} + tags: ${{ steps.extract.outputs.single_tag }} # labels would have to be added to the image after the S2I build - name: Apply Labels and tags to Database Image From 5ea2ff4305cec2651b14c69a6838dc1f5255a2e6 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Mon, 11 Mar 2024 17:20:33 -0700 Subject: [PATCH 161/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 5c4a5a97..f8c1844e 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -42,7 +42,7 @@ jobs: REGISTRY_USERNAME_SECRET_NAME: ${{ inputs.service.endoser-agent.username_secret_name || '' }} REGISTRY_PASSWORD_SECRET_NAME: ${{ inputs.service.endoser-agent.password_secret_name || '' }} - service: aries-endorser-db - GIT_REPO_URL: ${{ inputs.service.endoser-db.git_repo_url || 'hyperledger/aries-endorser-db' }} + GIT_REPO_URL: ${{ inputs.service.endoser-db.git_repo_url || 'hyperledger/aries-endorser-service' }} GIT_REF: ${{ inputs.service.endoser-db.git_ref || '' }} SOURCE_CONTEXT_DIR: docker/wallet/config SOURCE_IMAGE_REGISTRY: "quay.io/" From 067d73f7e0165a9c9496f71db2b42583c32cd9b6 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Tue, 12 Mar 2024 14:30:46 -0700 Subject: [PATCH 162/162] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index f8c1844e..f3680678 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -44,10 +44,12 @@ jobs: - service: aries-endorser-db GIT_REPO_URL: ${{ inputs.service.endoser-db.git_repo_url || 'hyperledger/aries-endorser-service' }} GIT_REF: ${{ inputs.service.endoser-db.git_ref || '' }} - SOURCE_CONTEXT_DIR: docker/wallet/config - SOURCE_IMAGE_REGISTRY: "quay.io/" - SOURCE_IMAGE_NAME: "fedora/postgresql-13" - SOURCE_IMAGE_TAG: "13" + SOURCE_CONTEXT_DIR: ${{ inputs.service.endoser-db.source_context_dir || 'docker/wallet/config' }} + SOURCE_IMAGE_REGISTRY: ${{ inputs.service.endoser-db.source_image_registry || 'quay.io/' }} + SOURCE_IMAGE_NAME: ${{ inputs.service.endoser-db.source_image_name || 'fedora/postgresql-13' }} + SOURCE_IMAGE_TAG: ${{ inputs.service.endoser-db.source_image_tag || '13' }} + REGISTRY_USERNAME_SECRET_NAME: ${{ inputs.service.endoser-db.username_secret_name || '' }} + REGISTRY_PASSWORD_SECRET_NAME: ${{ inputs.service.endoser-db.password_secret_name || '' }} - service: aries-endorser-backup GIT_REPO_URL: BCDevOps/backup-container GIT_REF: 2.5.1 @@ -56,8 +58,8 @@ jobs: SOURCE_IMAGE_REGISTRY: artifacts.developer.gov.bc.ca/docker-remote/ SOURCE_IMAGE_NAME: centos/postgresql-13-centos7 SOURCE_IMAGE_TAG: 20210722-70dc4d3 - REGISTRY_USERNAME_SECRET_NAME: ARTIFACTORY_USERNAME - REGISTRY_PASSWORD_SECRET_NAME: ARTIFACTORY_PASSWORD + REGISTRY_USERNAME_SECRET_NAME: ${{ inputs.service.endoser-backup.username_secret_name || '' }} + REGISTRY_PASSWORD_SECRET_NAME: ${{ inputs.service.endoser-backup.password_secret_name || '' }} - service: aries-endorser-proxy GIT_REF: "" DOCKER_FILE_PATH: Dockerfile # The docker path, file, is the relative path to the docker file from the root of the repo. @@ -65,18 +67,18 @@ jobs: SOURCE_IMAGE_REGISTRY: "artifacts.developer.gov.bc.ca/docker-remote/" SOURCE_IMAGE_NAME: caddy SOURCE_IMAGE_TAG: latest - REGISTRY_USERNAME_SECRET_NAME: ARTIFACTORY_USERNAME - REGISTRY_PASSWORD_SECRET_NAME: ARTIFACTORY_PASSWORD + REGISTRY_USERNAME_SECRET_NAME: ${{ inputs.service.endoser-proxy.username_secret_name || '' }} + REGISTRY_PASSWORD_SECRET_NAME: ${{ inputs.service.endoser-proxy.password_secret_name || '' }} - service: aries-endorser-api - GIT_REPO_URL: hyperledger/aries-endorser-service - GIT_REF: "" - DOCKER_FILE_PATH: Dockerfile.endorser # The docker path, file, is the relative path to the docker file from the root of the repo. - SOURCE_CONTEXT_DIR: endorser # The context dir, context, sets the context for the build. i.e. where the build will source files from - SOURCE_IMAGE_REGISTRY: artifacts.developer.gov.bc.ca/docker-remote/ - SOURCE_IMAGE_NAME: python - SOURCE_IMAGE_TAG: 3.10-slim-buster - REGISTRY_USERNAME_SECRET_NAME: ARTIFACTORY_USERNAME - REGISTRY_PASSWORD_SECRET_NAME: ARTIFACTORY_PASSWORD + GIT_REPO_URL: ${{ inputs.service.endoser-api.git_repo_url || 'hyperledger/aries-endorser-service' }} + GIT_REF: ${{ inputs.service.endoser-api.git_ref || '' }} + DOCKER_FILE_PATH: ${{ inputs.service.endoser-api.git_ref || 'Dockerfile.endorser' }} # The docker path, file, is the relative path to the docker file from the root of the repo. + SOURCE_CONTEXT_DIR: ${{ inputs.service.endoser-api.git_ref || 'endorser' }} # The context dir, context, sets the context for the build. i.e. where the build will source files from + SOURCE_IMAGE_REGISTRY: ${{ inputs.service.endoser-api.git_ref || 'artifacts.developer.gov.bc.ca/docker-remote/' }} + SOURCE_IMAGE_NAME: ${{ inputs.service.endoser-api.git_ref || 'python' }} + SOURCE_IMAGE_TAG: ${{ inputs.service.endoser-api.git_ref || '3.10-slim-buster' }} + REGISTRY_USERNAME_SECRET_NAME: ${{ inputs.service.endoser-api.username_secret_name || '' }} + REGISTRY_PASSWORD_SECRET_NAME: ${{ inputs.service.endoser-api.password_secret_name || '' }} outputs: aries-endorser-agent_digest: ${{ steps.digest.outputs.aries-endorser-agent_digest }} aries-endorser-backup_digest: ${{ steps.digest.outputs.aries-endorser-backup_digest }}