Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5492 release process #45

Merged
merged 74 commits into from
Feb 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
a4aa97f
Fixing workflow
pankaj-cgi Feb 1, 2022
12ee5c6
Fixing workflow
pankaj-cgi Feb 1, 2022
5db2d59
Revert "Fixing workflow"
pankaj-cgi Feb 1, 2022
f31d511
Fixing workflow
pankaj-cgi Feb 1, 2022
4cbc2c8
fixing branch name in workflow
pankaj-cgi Feb 1, 2022
c60e19f
testing env variable in other flow
pankaj-cgi Feb 1, 2022
c39ed21
Printing env
pankaj-cgi Feb 1, 2022
d9e985b
fixing error
pankaj-cgi Feb 2, 2022
0d545c1
fixing run issue
pankaj-cgi Feb 2, 2022
737e048
fixing workflow
pankaj-cgi Feb 2, 2022
434ac75
Fixing workflow
pankaj-cgi Feb 2, 2022
bdc8f9a
adding steps to build and push images
pankaj-cgi Feb 2, 2022
c28cc60
updating syntax
pankaj-cgi Feb 2, 2022
bed1900
fixing workflow issue
pankaj-cgi Feb 2, 2022
d2c3502
added the github tagging
pankaj-cgi Feb 2, 2022
431ccf7
added release name as option
pankaj-cgi Feb 2, 2022
c3ff0f7
added release name as option
pankaj-cgi Feb 2, 2022
3ef9257
fixing error
pankaj-cgi Feb 2, 2022
152b5a6
adding additional info
pankaj-cgi Feb 2, 2022
aaea3ff
Rearranging input params
pankaj-cgi Feb 2, 2022
710ad92
Fixing issue
pankaj-cgi Feb 2, 2022
377b3e2
adding tags to repo
pankaj-cgi Feb 2, 2022
a29116d
Removed extra code
pankaj-cgi Feb 2, 2022
f151aff
Cleaned up extra code
pankaj-cgi Feb 2, 2022
ab11456
fixing issue
pankaj-cgi Feb 3, 2022
9e7fe39
Fixing tagging
pankaj-cgi Feb 3, 2022
4740982
fixing issue
pankaj-cgi Feb 3, 2022
33f36a8
using variables
pankaj-cgi Feb 3, 2022
5489c23
fixing error
pankaj-cgi Feb 3, 2022
546a448
Adding steps to to add images in new repo
pankaj-cgi Feb 3, 2022
324f2a4
Fixing issue and adding updates for repo name
pankaj-cgi Feb 3, 2022
dadec6d
Fixing issue
pankaj-cgi Feb 3, 2022
3652979
Merge remote-tracking branch 'origin/main' into 5492-release-process
pankaj-cgi Feb 3, 2022
64e778e
test oc commands
pankaj-cgi Feb 4, 2022
20d6e91
adding deploy job for test run
pankaj-cgi Feb 4, 2022
5a927e0
fixing the workflow
pankaj-cgi Feb 5, 2022
ffae07f
running oc commands
pankaj-cgi Feb 5, 2022
3db0f9e
Adding version in footer using env config
daveb-hni Feb 5, 2022
2d25c57
Merge branch '5492-release-process' of https://github.com/bcgov/moh-h…
daveb-hni Feb 5, 2022
3da494c
trying oc command
pankaj-cgi Feb 5, 2022
cfc4847
getting image digest
pankaj-cgi Feb 5, 2022
ee392a5
Getting image digest
pankaj-cgi Feb 5, 2022
d95eb65
fixing issue
pankaj-cgi Feb 5, 2022
4a69ae9
Fixing issue
pankaj-cgi Feb 5, 2022
e439921
Printing value
pankaj-cgi Feb 5, 2022
8195baf
Ading validate step
pankaj-cgi Feb 5, 2022
455f60c
Adding debug
pankaj-cgi Feb 5, 2022
c7cb6d6
added step for namespace
pankaj-cgi Feb 5, 2022
7242a98
Updating deployment workflow
pankaj-cgi Feb 7, 2022
b739952
fixing error
pankaj-cgi Feb 7, 2022
004bc64
fixing error
pankaj-cgi Feb 7, 2022
fea8273
fixing error
pankaj-cgi Feb 7, 2022
33495be
fixing issue
pankaj-cgi Feb 7, 2022
72dadd6
fixing issue
pankaj-cgi Feb 7, 2022
5d5990e
Fixing issue
pankaj-cgi Feb 7, 2022
ef61689
uncommented push image action
pankaj-cgi Feb 7, 2022
adf92ce
fixing error
pankaj-cgi Feb 7, 2022
79e2a77
Updating test workflow to use test imagestream
pankaj-cgi Feb 7, 2022
e5cf044
triggering test workflow
pankaj-cgi Feb 7, 2022
9a1612f
reverting changes after testing
pankaj-cgi Feb 8, 2022
4318466
Reverting changes
pankaj-cgi Feb 8, 2022
813570c
Merge remote-tracking branch 'origin/main' into 5492-release-process
pankaj-cgi Feb 8, 2022
ce35471
Final release workflow
pankaj-cgi Feb 8, 2022
068b310
Removing test parameter
pankaj-cgi Feb 8, 2022
488c9ef
fixing issue
pankaj-cgi Feb 8, 2022
29f89d4
New release workflow is created
pankaj-cgi Feb 8, 2022
9a8e614
Removed deploying to test step
pankaj-cgi Feb 8, 2022
52875e4
updating workflow
pankaj-cgi Feb 8, 2022
4b2355f
updating deploy workflow
pankaj-cgi Feb 8, 2022
a18cf52
fixing deploy workflow
pankaj-cgi Feb 8, 2022
84590c7
updating ref branch name to main
pankaj-cgi Feb 8, 2022
066d5b8
Removed the extra workflows
pankaj-cgi Feb 8, 2022
b54f222
Added Version: prefix. Fixed alignment.
weskubo-cgi Feb 9, 2022
06025f7
Update as per review comments
pankaj-cgi Feb 9, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions .github/workflows/DevEnv-backend-BuildImageAndPush.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: DevEnv-backend-BuildImageAndPush
# Build the image and deploy in OpenShift environment
env:
# Registries such as GHCR, Quay.io, and Docker Hub are supported.
IMAGE_REGISTRY: image-registry.apps.silver.devops.gov.bc.ca/c5839f-tools
TOOLSNS_IMAGE_REGISTRY: image-registry.apps.silver.devops.gov.bc.ca/c5839f-tools
DEVNS_IMAGE_REGISTRY: image-registry.apps.silver.devops.gov.bc.ca/c5839f-dev
IMAGE_REGISTRY_USER: ${{ secrets.C5839F_OPENSHIFT_GITHUB_ACTIONS_SA_USER }}
IMAGE_REGISTRY_PASSWORD: ${{ secrets.C5839F_OPENSHIFT_GITHUB_ACTIONS_SA_TOKEN }}
IMAGE_NAME: mspdirect-backend
Expand Down Expand Up @@ -37,7 +38,7 @@ jobs:
- name: Determine image tags
if: env.IMAGE_TAGS == ''
run: |
echo "IMAGE_TAGS=latest ${GITHUB_SHA::12} mspdirect-dev" | tee -a $GITHUB_ENV
echo "IMAGE_TAGS=${GITHUB_SHA::12}" | tee -a $GITHUB_ENV


# Build from docker file
Expand All @@ -51,13 +52,24 @@ jobs:
dockerfiles: |
./backend/Dockerfile

- name: Push to registry
id: push-image
- name: Push to tools registry
id: push-image-tools
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-docker.outputs.image }}
tags: ${{ steps.build-docker.outputs.tags }}
registry: ${{ env.IMAGE_REGISTRY }}
registry: ${{ env.TOOLSNS_IMAGE_REGISTRY }}
username: ${{ env.IMAGE_REGISTRY_USER }}
password: ${{ env.IMAGE_REGISTRY_PASSWORD }}


- name: Push to dev registry
id: push-image-dev
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-docker.outputs.image }}
tags: ${{ steps.build-docker.outputs.tags }}
registry: ${{ env.DEVNS_IMAGE_REGISTRY }}
username: ${{ env.IMAGE_REGISTRY_USER }}
password: ${{ env.IMAGE_REGISTRY_PASSWORD }}

Expand Down Expand Up @@ -85,7 +97,7 @@ jobs:
if: ${{ success() }}
run: |
cd mspdirect-devops/overlays/dev
kustomize edit set image "backend-image=image-registry.openshift-image-registry.svc:5000/c5839f-tools/${{ env.IMAGE_NAME }}@${{ steps.push-image.outputs.digest }}"
kustomize edit set image "backend-image=image-registry.openshift-image-registry.svc:5000/c5839f-dev/${{ env.IMAGE_NAME }}@${{ steps.push-image-dev.outputs.digest }}"
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -am "Update Backend API image ID for Dev"
Expand Down
27 changes: 19 additions & 8 deletions .github/workflows/DevEnv-frontend-BuildImageAndPush.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ name: DevEnv-frontend-BuildImageAndPush
# Build the image and deploy in OpenShift environment
env:
# Registries such as GHCR, Quay.io, and Docker Hub are supported.
IMAGE_REGISTRY: image-registry.apps.silver.devops.gov.bc.ca/c5839f-tools
DEVNS_IMAGE_REGISTRY: image-registry.apps.silver.devops.gov.bc.ca/c5839f-dev
TOOLSNS_IMAGE_REGISTRY: image-registry.apps.silver.devops.gov.bc.ca/c5839f-tools
IMAGE_REGISTRY_USER: ${{ secrets.C5839F_OPENSHIFT_GITHUB_ACTIONS_SA_USER }}
IMAGE_REGISTRY_PASSWORD: ${{ secrets.C5839F_OPENSHIFT_GITHUB_ACTIONS_SA_TOKEN }}
IMAGE_NAME: mspdirect-frontend
IMAGE_TAGS:
IMAGE_TAGS:

on:
# Run the workflow manually, instead of on a push.
Expand Down Expand Up @@ -39,8 +40,7 @@ jobs:
- name: Determine image tags
if: env.IMAGE_TAGS == ''
run: |
echo "IMAGE_TAGS=latest ${GITHUB_SHA::12} mspdirect-dev" | tee -a $GITHUB_ENV

echo "IMAGE_TAGS=${GITHUB_SHA::12}" | tee -a $GITHUB_ENV

# Build from docker file
- name: Build from Dockerfile
Expand All @@ -54,16 +54,27 @@ jobs:
dockerfiles: |
./frontend/Dockerfile

- name: Push to registry
id: push-image
- name: Push to tools registry
id: push-image-tools
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-docker.outputs.image }}
tags: ${{ steps.build-docker.outputs.tags }}
registry: ${{ env.IMAGE_REGISTRY }}
registry: ${{ env.TOOLSNS_IMAGE_REGISTRY }}
username: ${{ env.IMAGE_REGISTRY_USER }}
password: ${{ env.IMAGE_REGISTRY_PASSWORD }}


- name: Push to Dev registry
id: push-image-dev
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-docker.outputs.image }}
tags: ${{ steps.build-docker.outputs.tags }}
registry: ${{ env.DEVNS_IMAGE_REGISTRY }}
username: ${{ env.IMAGE_REGISTRY_USER }}
password: ${{ env.IMAGE_REGISTRY_PASSWORD }}

# Update the image ID in the manifest repository used by Argo CD.
# We need to use the SSH deploy key to check out the manifest repo, set up
# Kustomize in the runner, update the image ID, commit the change, and
Expand All @@ -88,7 +99,7 @@ jobs:
if: ${{ success() }}
run: |
cd mspdirect-devops/overlays/dev
kustomize edit set image "frontend-image=image-registry.openshift-image-registry.svc:5000/c5839f-tools/${{ env.IMAGE_NAME }}@${{ steps.push-image.outputs.digest }}"
kustomize edit set image "frontend-image=image-registry.openshift-image-registry.svc:5000/c5839f-dev/${{ env.IMAGE_NAME }}@${{ steps.push-image-dev.outputs.digest }}"
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -am "Update frontend API image ID for Dev"
Expand Down
35 changes: 23 additions & 12 deletions .github/workflows/TestEnv-backend-BuildImageAndPush.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: TestEnv-backend-BuildImageAndPush
# Build the image and deploy in OpenShift environment
env:
# Registries such as GHCR, Quay.io, and Docker Hub are supported.
IMAGE_REGISTRY: image-registry.apps.silver.devops.gov.bc.ca/c5839f-tools
TOOLSNS_IMAGE_REGISTRY: image-registry.apps.silver.devops.gov.bc.ca/c5839f-tools
TESTNS_IMAGE_REGISTRY: image-registry.apps.silver.devops.gov.bc.ca/c5839f-test
IMAGE_REGISTRY_USER: ${{ secrets.C5839F_OPENSHIFT_GITHUB_ACTIONS_SA_USER }}
IMAGE_REGISTRY_PASSWORD: ${{ secrets.C5839F_OPENSHIFT_GITHUB_ACTIONS_SA_TOKEN }}
IMAGE_NAME: mspdirect-backend
Expand All @@ -14,18 +15,18 @@ on:
# API build config.
# --------------------------------------------------------------------------

# workflow_dispatch:
# inputs:
# branch:
# description: 'Enter branch name:'
# required: true
# default: main

push:
branches: [ main ]
paths:
- "backend/**"

workflow_dispatch:
# inputs:
# branch:
# description: 'Enter branch name:'
# required: true
# default: main

jobs:

buildAndPush:
Expand Down Expand Up @@ -57,13 +58,23 @@ jobs:
dockerfiles: |
./backend/Dockerfile

- name: Push to registry
id: push-image
- name: Push to tools registry
id: push-image-tools
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-docker.outputs.image }}
tags: ${{ steps.build-docker.outputs.tags }}
registry: ${{ env.TOOLSNS_IMAGE_REGISTRY }}
username: ${{ env.IMAGE_REGISTRY_USER }}
password: ${{ env.IMAGE_REGISTRY_PASSWORD }}

- name: Push to test registry
id: push-image-test
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-docker.outputs.image }}
tags: ${{ steps.build-docker.outputs.tags }}
registry: ${{ env.IMAGE_REGISTRY }}
registry: ${{ env.TESTNS_IMAGE_REGISTRY }}
username: ${{ env.IMAGE_REGISTRY_USER }}
password: ${{ env.IMAGE_REGISTRY_PASSWORD }}

Expand Down Expand Up @@ -91,7 +102,7 @@ jobs:
if: ${{ success() }}
run: |
cd mspdirect-devops/overlays/test
kustomize edit set image "backend-image=image-registry.openshift-image-registry.svc:5000/c5839f-tools/${{ env.IMAGE_NAME }}@${{ steps.push-image.outputs.digest }}"
kustomize edit set image "backend-image=image-registry.openshift-image-registry.svc:5000/c5839f-test/${{ env.IMAGE_NAME }}@${{ steps.push-image-test.outputs.digest }}"
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -am "Update Backend API image ID for test"
Expand Down
23 changes: 18 additions & 5 deletions .github/workflows/TestEnv-frontend-BuildImageAndPush.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: TestEnv-frontend-BuildImageAndPush
# Build the image and deploy in OpenShift environment
env:
# Registries such as GHCR, Quay.io, and Docker Hub are supported.
IMAGE_REGISTRY: image-registry.apps.silver.devops.gov.bc.ca/c5839f-tools
TOOLSNS_IMAGE_REGISTRY: image-registry.apps.silver.devops.gov.bc.ca/c5839f-tools
TESTNS_IMAGE_REGISTRY: image-registry.apps.silver.devops.gov.bc.ca/c5839f-test
IMAGE_REGISTRY_USER: ${{ secrets.C5839F_OPENSHIFT_GITHUB_ACTIONS_SA_USER }}
IMAGE_REGISTRY_PASSWORD: ${{ secrets.C5839F_OPENSHIFT_GITHUB_ACTIONS_SA_TOKEN }}
IMAGE_NAME: mspdirect-frontend
Expand All @@ -13,6 +14,8 @@ on:
branches: [ main ]
paths:
- "frontend/**"

workflow_dispatch:

jobs:

Expand Down Expand Up @@ -46,13 +49,23 @@ jobs:
dockerfiles: |
./frontend/Dockerfile

- name: Push to registry
id: push-image
- name: Push to tools registry
id: push-image-tools
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-docker.outputs.image }}
tags: ${{ steps.build-docker.outputs.tags }}
registry: ${{ env.TOOLSNS_IMAGE_REGISTRY }}
username: ${{ env.IMAGE_REGISTRY_USER }}
password: ${{ env.IMAGE_REGISTRY_PASSWORD }}

- name: Push to test registry
id: push-image-test
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-docker.outputs.image }}
tags: ${{ steps.build-docker.outputs.tags }}
registry: ${{ env.IMAGE_REGISTRY }}
registry: ${{ env.TESTNS_IMAGE_REGISTRY }}
username: ${{ env.IMAGE_REGISTRY_USER }}
password: ${{ env.IMAGE_REGISTRY_PASSWORD }}

Expand Down Expand Up @@ -80,7 +93,7 @@ jobs:
if: ${{ success() }}
run: |
cd mspdirect-devops/overlays/test
kustomize edit set image "frontend-image=image-registry.openshift-image-registry.svc:5000/c5839f-tools/${{ env.IMAGE_NAME }}@${{ steps.push-image.outputs.digest }}"
kustomize edit set image "frontend-image=image-registry.openshift-image-registry.svc:5000/c5839f-test/${{ env.IMAGE_NAME }}@${{ steps.push-image-test.outputs.digest }}"
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -am "Update frontend API image ID for Test"
Expand Down
Loading