Skip to content

Commit

Permalink
testing base image
Browse files Browse the repository at this point in the history
Signed-off-by: Rajpal Chauhan <[email protected]>
  • Loading branch information
rajpalc7 committed Feb 8, 2024
1 parent 7af21b6 commit 7f442d4
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 62 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/actions/deploy/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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
# - name: Rocket.Chat Notification
# uses: RocketChat/[email protected]
# 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
90 changes: 39 additions & 51 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7f442d4

Please sign in to comment.