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