From fff842ed13e18f1338f3fe78cec65f3867417c04 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 28 Aug 2024 14:55:12 -0700 Subject: [PATCH 01/19] chore(ci): deprecate deployment configs --- backend/openshift.deploy.yml | 23 +++++++---------------- frontend/openshift.deploy.yml | 23 +++++++---------------- legacy/openshift.deploy.yml | 23 +++++++---------------- processor/openshift.deploy.yml | 23 +++++++---------------- 4 files changed, 28 insertions(+), 64 deletions(-) diff --git a/backend/openshift.deploy.yml b/backend/openshift.deploy.yml index 2dc13e7cde..dcbc82ec9b 100644 --- a/backend/openshift.deploy.yml +++ b/backend/openshift.deploy.yml @@ -67,28 +67,19 @@ objects: name: ${REGISTRY}/${PROMOTE} referencePolicy: type: Local - - kind: DeploymentConfig - apiVersion: v1 + - kind: Deployment + apiVersion: apps/v1 metadata: labels: app: ${NAME}-${ZONE} name: ${NAME}-${ZONE}-${COMPONENT} spec: replicas: 1 - triggers: - - type: ConfigChange - - type: ImageChange - imageChangeParams: - automatic: true - containerNames: - - ${NAME} - from: - kind: ImageStreamTag - name: ${NAME}-${ZONE}-${COMPONENT}:${IMAGE_TAG} selector: - deploymentconfig: ${NAME}-${ZONE}-${COMPONENT} + matchLabels: + deployment: ${NAME}-${ZONE}-${COMPONENT} strategy: - type: Rolling + type: RollingUpdate template: metadata: annotations: @@ -97,7 +88,7 @@ objects: prometheus.io/path: "/metrics" labels: app: ${NAME}-${ZONE} - deploymentconfig: ${NAME}-${ZONE}-${COMPONENT} + deployment: ${NAME}-${ZONE}-${COMPONENT} spec: volumes: - name: ${COMPONENT}-config @@ -236,7 +227,7 @@ objects: port: 80 targetPort: 8080 selector: - deploymentconfig: ${NAME}-${ZONE}-${COMPONENT} + deployment: ${NAME}-${ZONE}-${COMPONENT} - kind: Route apiVersion: route.openshift.io/v1 metadata: diff --git a/frontend/openshift.deploy.yml b/frontend/openshift.deploy.yml index 2574d362bf..de065abb77 100644 --- a/frontend/openshift.deploy.yml +++ b/frontend/openshift.deploy.yml @@ -111,28 +111,19 @@ objects: window.localStorage.setItem('VITE_LOGOUT_BCSC_URL','${LANDING_URL}'); window.localStorage.setItem('VITE_LOGOUT_BCEIDBUSINESS_URL','${LANDING_URL}'); window.localStorage.setItem('VITE_LOGOUT_IDIR_URL','https://${URL}'); - - kind: DeploymentConfig - apiVersion: v1 + - kind: Deployment + apiVersion: apps/v1 metadata: labels: app: ${NAME}-${ZONE} name: ${NAME}-${ZONE}-${COMPONENT} spec: replicas: 1 - triggers: - - type: ConfigChange - - type: ImageChange - imageChangeParams: - automatic: true - containerNames: - - ${NAME} - from: - kind: ImageStreamTag - name: ${NAME}-${ZONE}-${COMPONENT}:${IMAGE_TAG} selector: - deploymentconfig: ${NAME}-${ZONE}-${COMPONENT} + matchLabels: + deployment: ${NAME}-${ZONE}-${COMPONENT} strategy: - type: Rolling + type: RollingUpdate template: metadata: annotations: @@ -141,7 +132,7 @@ objects: prometheus.io/path: "/metrics" labels: app: ${NAME}-${ZONE} - deploymentconfig: ${NAME}-${ZONE}-${COMPONENT} + deployment: ${NAME}-${ZONE}-${COMPONENT} spec: volumes: - name: app-config @@ -216,7 +207,7 @@ objects: port: 80 targetPort: 3000 selector: - deploymentconfig: ${NAME}-${ZONE}-${COMPONENT} + deployment: ${NAME}-${ZONE}-${COMPONENT} - kind: Route apiVersion: route.openshift.io/v1 metadata: diff --git a/legacy/openshift.deploy.yml b/legacy/openshift.deploy.yml index 03b47922e9..2c19b03a8e 100644 --- a/legacy/openshift.deploy.yml +++ b/legacy/openshift.deploy.yml @@ -73,8 +73,8 @@ objects: requests: storage: ${CERT_PVC_SIZE} storageClassName: netapp-file-standard - - kind: DeploymentConfig - apiVersion: v1 + - kind: Deployment + apiVersion: apps/v1 metadata: labels: app: ${NAME}-${ZONE} @@ -82,20 +82,11 @@ objects: name: ${NAME}-${ZONE}-${COMPONENT} spec: replicas: 1 - triggers: - - type: ConfigChange - - type: ImageChange - imageChangeParams: - automatic: true - containerNames: - - ${NAME} - from: - kind: ImageStreamTag - name: ${NAME}-${ZONE}-${COMPONENT}:${IMAGE_TAG} selector: - deploymentconfig: ${NAME}-${ZONE}-${COMPONENT} + matchLabels: + deployment: ${NAME}-${ZONE}-${COMPONENT} strategy: - type: Rolling + type: RollingUpdate template: metadata: annotations: @@ -104,7 +95,7 @@ objects: prometheus.io/path: "/metrics" labels: app: ${NAME}-${ZONE} - deploymentconfig: ${NAME}-${ZONE}-${COMPONENT} + deployment: ${NAME}-${ZONE}-${COMPONENT} spec: volumes: - name: ${NAME}-${ZONE}-certs @@ -226,4 +217,4 @@ objects: port: 80 targetPort: 9000 selector: - deploymentconfig: ${NAME}-${ZONE}-${COMPONENT} + deployment: ${NAME}-${ZONE}-${COMPONENT} diff --git a/processor/openshift.deploy.yml b/processor/openshift.deploy.yml index 460316267f..5adde4c502 100644 --- a/processor/openshift.deploy.yml +++ b/processor/openshift.deploy.yml @@ -52,28 +52,19 @@ objects: name: ${REGISTRY}/${PROMOTE} referencePolicy: type: Local - - apiVersion: v1 - kind: DeploymentConfig + - kind: Deployment + apiVersion: apps/v1 metadata: labels: app: ${NAME}-${ZONE} name: ${NAME}-${ZONE}-${COMPONENT} spec: replicas: 1 - triggers: - - type: ConfigChange - - type: ImageChange - imageChangeParams: - automatic: true - containerNames: - - ${NAME} - from: - kind: ImageStreamTag - name: ${NAME}-${ZONE}-${COMPONENT}:${IMAGE_TAG} selector: - deploymentconfig: ${NAME}-${ZONE}-${COMPONENT} + matchLabels: + deployment: ${NAME}-${ZONE}-${COMPONENT} strategy: - type: Rolling + type: RollingUpdate template: metadata: annotations: @@ -82,7 +73,7 @@ objects: prometheus.io/path: "/metrics" labels: app: ${NAME}-${ZONE} - deploymentconfig: ${NAME}-${ZONE}-${COMPONENT} + deployment: ${NAME}-${ZONE}-${COMPONENT} spec: containers: - image: ${NAME}-${ZONE}-${COMPONENT}:${IMAGE_TAG} @@ -169,4 +160,4 @@ objects: port: 80 targetPort: 3100 selector: - deploymentconfig: ${NAME}-${ZONE}-${COMPONENT} + deployment: ${NAME}-${ZONE}-${COMPONENT} From 1fbf6a0729ff1800beb35eee359cce14b8117e52 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 28 Aug 2024 15:53:29 -0700 Subject: [PATCH 02/19] Drop image streams --- backend/openshift.deploy.yml | 30 ++++++++++-------------------- frontend/openshift.deploy.yml | 30 ++++++++++-------------------- legacy/openshift.deploy.yml | 33 ++++++++++----------------------- processor/openshift.deploy.yml | 31 +++++++++++-------------------- 4 files changed, 41 insertions(+), 83 deletions(-) diff --git a/backend/openshift.deploy.yml b/backend/openshift.deploy.yml index dcbc82ec9b..44b71ae843 100644 --- a/backend/openshift.deploy.yml +++ b/backend/openshift.deploy.yml @@ -13,9 +13,15 @@ parameters: - name: ZONE description: Deployment zone, e.g. pr-### or prod required: true - - name: IMAGE_TAG - description: Image tag to use - value: latest + - name: TAG + description: Image tag; e.g. PR number, latest or prod + required: true + - name: REGISTRY + description: Container registry to import from (internal is image-registry.openshift-image-registry.svc:5000) + value: ghcr.io + - name: ORG + description: Organization name + value: bcgov - name: DOMAIN value: apps.silver.devops.gov.bc.ca - name: REGISTRY @@ -51,22 +57,6 @@ parameters: description: ConfigMap name specific to each environment value: ${NAME}-${ZONE}-${COMPONENT}-config objects: - - kind: ImageStream - apiVersion: v1 - metadata: - labels: - app: ${NAME}-${ZONE} - name: ${NAME}-${ZONE}-${COMPONENT} - spec: - lookupPolicy: - local: false - tags: - - name: ${IMAGE_TAG} - from: - kind: DockerImage - name: ${REGISTRY}/${PROMOTE} - referencePolicy: - type: Local - kind: Deployment apiVersion: apps/v1 metadata: @@ -95,7 +85,7 @@ objects: configMap: name: ${NAME}-${ZONE}-${COMPONENT}-config containers: - - image: ${NAME}-${ZONE}-${COMPONENT}:${IMAGE_TAG} + - image: ${REGISTRY}/${ORG}/${NAME}/${COMPONENT}:${TAG} imagePullPolicy: Always name: ${NAME} volumeMounts: diff --git a/frontend/openshift.deploy.yml b/frontend/openshift.deploy.yml index de065abb77..957b3e6c79 100644 --- a/frontend/openshift.deploy.yml +++ b/frontend/openshift.deploy.yml @@ -19,9 +19,15 @@ parameters: - name: ZONE description: Deployment zone, e.g. pr-### or prod required: true - - name: IMAGE_TAG - description: Image tag to use - value: latest + - name: TAG + description: Image tag; e.g. PR number, latest or prod + required: true + - name: REGISTRY + description: Container registry to import from (internal is image-registry.openshift-image-registry.svc:5000) + value: ghcr.io + - name: ORG + description: Organization name + value: bcgov - name: DOMAIN value: apps.silver.devops.gov.bc.ca - name: REGISTRY @@ -75,22 +81,6 @@ parameters: required: true objects: objects: - - kind: ImageStream - apiVersion: v1 - metadata: - labels: - app: ${NAME}-${ZONE} - name: ${NAME}-${ZONE}-${COMPONENT} - spec: - lookupPolicy: - local: false - tags: - - name: ${IMAGE_TAG} - from: - kind: DockerImage - name: ${REGISTRY}/${PROMOTE} - referencePolicy: - type: Local - kind: ConfigMap apiVersion: v1 metadata: @@ -142,7 +132,7 @@ objects: configMap: name: ${NAME}-${ZONE}-${COMPONENT}-config containers: - - image: ${NAME}-${ZONE}-${COMPONENT}:${IMAGE_TAG} + - image: ${REGISTRY}/${ORG}/${NAME}/${COMPONENT}:${TAG} securityContext: capabilities: add: ["NET_BIND_SERVICE"] diff --git a/legacy/openshift.deploy.yml b/legacy/openshift.deploy.yml index 2c19b03a8e..9c2c17290c 100644 --- a/legacy/openshift.deploy.yml +++ b/legacy/openshift.deploy.yml @@ -13,12 +13,15 @@ parameters: - name: ZONE description: Deployment zone, e.g. pr-### or prod required: true - - name: ENVIRONMENT - description: Environment name used by the application - value: prod - - name: IMAGE_TAG - description: Image tag to use - value: latest + - name: TAG + description: Image tag; e.g. PR number, latest or prod + required: true + - name: REGISTRY + description: Container registry to import from (internal is image-registry.openshift-image-registry.svc:5000) + value: ghcr.io + - name: ORG + description: Organization name + value: bcgov - name: DOMAIN value: apps.silver.devops.gov.bc.ca - name: REGISTRY @@ -44,22 +47,6 @@ parameters: description: The amount of storage the cert PVC should have value: 25Mi objects: - - kind: ImageStream - apiVersion: v1 - metadata: - labels: - app: ${NAME}-${ZONE} - name: ${NAME}-${ZONE}-${COMPONENT} - spec: - lookupPolicy: - local: false - tags: - - name: ${IMAGE_TAG} - from: - kind: DockerImage - name: ${REGISTRY}/${PROMOTE} - referencePolicy: - type: Local - kind: PersistentVolumeClaim apiVersion: v1 metadata: @@ -129,7 +116,7 @@ objects: cpu: ${CPU_REQUEST} memory: ${MEMORY_REQUEST} containers: - - image: ${NAME}-${ZONE}-${COMPONENT}:${IMAGE_TAG} + - image: ${REGISTRY}/${ORG}/${NAME}/${COMPONENT}:${TAG} imagePullPolicy: Always name: ${NAME} env: diff --git a/processor/openshift.deploy.yml b/processor/openshift.deploy.yml index 5adde4c502..0993981420 100644 --- a/processor/openshift.deploy.yml +++ b/processor/openshift.deploy.yml @@ -13,9 +13,15 @@ parameters: - name: ZONE description: Deployment zone, e.g. pr-### or prod required: true - - name: IMAGE_TAG - description: Image tag to use - value: latest + - name: TAG + description: Image tag; e.g. PR number, latest or prod + required: true + - name: REGISTRY + description: Container registry to import from (internal is image-registry.openshift-image-registry.svc:5000) + value: ghcr.io + - name: ORG + description: Organization name + value: bcgov - name: DOMAIN value: apps.silver.devops.gov.bc.ca - name: REGISTRY @@ -36,22 +42,7 @@ parameters: description: Bc Registry API address required: true objects: - - apiVersion: v1 - kind: ImageStream - metadata: - labels: - app: ${NAME}-${ZONE} - name: ${NAME}-${ZONE}-${COMPONENT} - spec: - lookupPolicy: - local: false - tags: - - name: ${IMAGE_TAG} - from: - kind: DockerImage - name: ${REGISTRY}/${PROMOTE} - referencePolicy: - type: Local + - kind: Deployment apiVersion: apps/v1 metadata: @@ -76,7 +67,7 @@ objects: deployment: ${NAME}-${ZONE}-${COMPONENT} spec: containers: - - image: ${NAME}-${ZONE}-${COMPONENT}:${IMAGE_TAG} + - image: ${REGISTRY}/${ORG}/${NAME}/${COMPONENT}:${TAG} imagePullPolicy: Always name: ${NAME} env: From f760ecc977b3566f54591972f5bf1db06f2253b2 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 28 Aug 2024 16:00:45 -0700 Subject: [PATCH 03/19] Add tags to pr-open --- .github/workflows/pr-open.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index 26b576270c..66ab80180a 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -240,6 +240,7 @@ jobs: overwrite: true parameters: -p ZONE=${{ github.event.number }} + -p TAG=${{ github.event.number }} -p ORACLEDB_USER=${{ secrets.ORACLEDB_USERNAME }} -p ORACLEDB_PASSWORD=${{ secrets.ORACLEDB_PASSWORD }} -p ORACLEDB_USER_W=THE @@ -309,6 +310,7 @@ jobs: verification_path: health parameters: -p ZONE=${{ github.event.number }} + -p TAG=${{ github.event.number }} -p PROMOTE=${{ github.repository }}/legacy:${{ github.event.number }} -p ENVIRONMENT=${{ secrets.OC_NAMESPACE }} -p ORACLEDB_PORT=1521 @@ -325,6 +327,7 @@ jobs: verification_path: health parameters: -p ZONE=${{ github.event.number }} + -p TAG=${{ github.event.number }} -p PROMOTE=${{ github.repository }}/processor:${{ github.event.number }} -p BCREGISTRY_URI='https://bcregistry-prod.apigee.net' @@ -335,10 +338,10 @@ jobs: oc_namespace: ${{ secrets.OC_NAMESPACE }} oc_server: ${{ secrets.OC_SERVER }} oc_token: ${{ secrets.OC_TOKEN }} - oc_version: "4.13" - overwrite: true + overwrite: true parameters: - -p ZONE=${{ github.event.number }} + -p ZONE=${{ github.event.number }} + -p TAG=${{ github.event.number }} - name: Deploy Backend uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -352,6 +355,7 @@ jobs: verification_path: health parameters: -p ZONE=${{ github.event.number }} + -p TAG=${{ github.event.number }} -p PROMOTE=${{ github.repository }}/backend:${{ github.event.number }} -p CHES_TOKEN_URL='https://loginproxy.gov.bc.ca/auth/realms/comsvcauth/protocol/openid-connect/token' -p CHES_API_URL='https://ches.api.gov.bc.ca/api/v1' @@ -368,7 +372,9 @@ jobs: oc_token: ${{ secrets.OC_TOKEN }} oc_version: "4.13" overwrite: true - parameters: -p ZONE=${{ github.event.number }} + parameters: + -p ZONE=${{ github.event.number }} + -p TAG=${{ github.event.number }} - name: Deploy Frontend ConfigMap uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -380,7 +386,8 @@ jobs: oc_version: "4.13" overwrite: true parameters: - -p ZONE=${{ github.event.number }} + -p ZONE=${{ github.event.number }} + -p TAG=${{ github.event.number }} - name: Deploy Frontend uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -393,6 +400,7 @@ jobs: overwrite: true parameters: -p ZONE=${{ github.event.number }} + -p TAG=${{ github.event.number }} -p PROMOTE=${{ github.repository }}/frontend:${{ github.event.number }} -p VITE_NODE_ENV=openshift-dev -p URL=${{ needs.vars.outputs.url }} From aebf063d08010d88128a784c922799a12d6fd073 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 28 Aug 2024 16:03:28 -0700 Subject: [PATCH 04/19] Add tags to merge workflow --- .github/workflows/merge.yml | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index 169aa9cdd1..f8e93a2d60 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -61,6 +61,7 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} + -p TAG=${{ github.event.number }} -p ORACLEDB_USER=${{ secrets.ORACLEDB_USERNAME }} -p ORACLEDB_PASSWORD=${{ secrets.ORACLEDB_PASSWORD }} -p ORACLEDB_USER_W=${{ secrets.ORACLEDB_USERNAME_W }} @@ -124,7 +125,7 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} - -p TAG=${{ env.ZONE }} + -p TAG=${{ github.event.number }} - name: Backup database before update continue-on-error: true @@ -145,7 +146,8 @@ jobs: overwrite: false parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} - -p TAG=${{ env.ZONE }} + -p TAG=${{ github.event.number }} + -p PROMOTE=${{ github.repository }}/database:${{ env.ZONE }} - name: Deploy Legacy uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -159,6 +161,7 @@ jobs: verification_path: health parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} + -p TAG=${{ github.event.number }} -p PROMOTE=${{ github.repository }}/legacy:${{ env.ZONE }} -p ENVIRONMENT=${{ secrets.OC_NAMESPACE }} @@ -187,7 +190,8 @@ jobs: oc_version: "4.13" overwrite: true parameters: - -p ZONE=${{ env.ZONE }} + -p ZONE=${{ env.ZONE }} + -p TAG=${{ github.event.number }} - name: Deploy Backend uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -201,6 +205,7 @@ jobs: verification_path: health parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} + -p TAG=${{ github.event.number }} -p PROMOTE=${{ github.repository }}/backend:${{ env.ZONE }} -p CHES_TOKEN_URL='https://loginproxy.gov.bc.ca/auth/realms/comsvcauth/protocol/openid-connect/token' -p CHES_API_URL='https://ches.api.gov.bc.ca/api/v1' @@ -217,7 +222,9 @@ jobs: oc_token: ${{ secrets.OC_TOKEN }} oc_version: "4.13" overwrite: true - parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} + parameters: + -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} + -p TAG=${{ github.event.number }} - name: Deploy Frontend ConfigMap uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -229,7 +236,8 @@ jobs: oc_version: "4.13" overwrite: true parameters: - -p ZONE=${{ env.ZONE }} + -p ZONE=${{ env.ZONE }} + -p TAG=${{ github.event.number }} - name: Deploy Frontend uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -242,6 +250,7 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} + -p TAG=${{ github.event.number }} -p PROMOTE=${{ github.repository }}/frontend:${{ env.ZONE }} -p GREEN_DOMAIN=${{ secrets.GREEN_DOMAIN }} -p VITE_NODE_ENV=openshift-${{ env.ZONE }} @@ -294,6 +303,7 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} + -p TAG=${{ github.event.number }} -p ORACLEDB_USER=${{ secrets.ORACLEDB_USERNAME }} -p ORACLEDB_PASSWORD=${{ secrets.ORACLEDB_PASSWORD }} -p ORACLEDB_USER_W=${{ secrets.ORACLEDB_USERNAME_W }} @@ -335,7 +345,7 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} - -p TAG=${{ env.PREV }} + -p TAG=${{ github.event.number }} - name: Install CLI tools from OpenShift Mirror uses: redhat-actions/openshift-tools-installer@v1 @@ -362,7 +372,7 @@ jobs: overwrite: false parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} - -p TAG=${{ env.PREV }} + -p TAG=${{ github.event.number }} - name: Deploy Legacy uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -376,8 +386,8 @@ jobs: verification_path: health parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} - -p PROMOTE=${{ github.repository }}/legacy:${{ env.PREV }} - -p ENVIRONMENT=${{ secrets.OC_NAMESPACE }} + -p TAG=${{ github.event.number }} + -p PROMOTE=${{ github.repository }}/legacy:${{ env.PREV }} - name: Deploy Processor uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -391,6 +401,7 @@ jobs: verification_path: health parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} + -p TAG=${{ github.event.number }} -p PROMOTE=${{ github.repository }}/processor:${{ env.PREV }} -p BCREGISTRY_URI='https://bcregistry-prod.apigee.net' @@ -404,7 +415,8 @@ jobs: oc_version: "4.13" overwrite: true parameters: - -p ZONE=${{ env.ZONE }} + -p ZONE=${{ env.ZONE }} + -p TAG=${{ github.event.number }} - name: Deploy Backend uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -418,6 +430,7 @@ jobs: verification_path: health parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} + -p TAG=${{ github.event.number }} -p PROMOTE=${{ github.repository }}/backend:${{ env.PREV }} -p CHES_TOKEN_URL='https://loginproxy.gov.bc.ca/auth/realms/comsvcauth/protocol/openid-connect/token' -p CHES_API_URL='https://ches.api.gov.bc.ca/api/v1' @@ -436,6 +449,7 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} + -p TAG=${{ github.event.number }} - name: Deploy Frontend uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -448,6 +462,7 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} + -p TAG=${{ github.event.number }} -p PROMOTE=${{ github.repository }}/frontend:${{ env.PREV }} -p GREEN_DOMAIN=${{ secrets.GREEN_DOMAIN }} -p VITE_NODE_ENV=openshift-${{ env.ZONE }} From edfe379ff9a345fdaf9545300300985943514796 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 28 Aug 2024 16:14:01 -0700 Subject: [PATCH 05/19] Fix tags in merge workflow --- .github/workflows/merge.yml | 32 ++++++++++++++++---------------- .github/workflows/pr-open.yml | 1 + 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index f8e93a2d60..ec962a6181 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -37,7 +37,7 @@ jobs: with: registry: ghcr.io repository: ${{ github.repository }}/${{ matrix.component }} - target: ${{ needs.vars.outputs.pr}} + target: ${{ needs.vars.outputs.pr }} tags: test test-init: @@ -61,7 +61,7 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} - -p TAG=${{ github.event.number }} + -p TAG=${{ env.ZONE }} -p ORACLEDB_USER=${{ secrets.ORACLEDB_USERNAME }} -p ORACLEDB_PASSWORD=${{ secrets.ORACLEDB_PASSWORD }} -p ORACLEDB_USER_W=${{ secrets.ORACLEDB_USERNAME_W }} @@ -146,7 +146,7 @@ jobs: overwrite: false parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} - -p TAG=${{ github.event.number }} + -p TAG=${{ env.ZONE }} -p PROMOTE=${{ github.repository }}/database:${{ env.ZONE }} - name: Deploy Legacy @@ -161,7 +161,7 @@ jobs: verification_path: health parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} - -p TAG=${{ github.event.number }} + -p TAG=${{ env.ZONE }} -p PROMOTE=${{ github.repository }}/legacy:${{ env.ZONE }} -p ENVIRONMENT=${{ secrets.OC_NAMESPACE }} @@ -191,7 +191,7 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} - -p TAG=${{ github.event.number }} + -p TAG=${{ env.ZONE }} - name: Deploy Backend uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -205,7 +205,7 @@ jobs: verification_path: health parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} - -p TAG=${{ github.event.number }} + -p TAG=${{ env.ZONE }} -p PROMOTE=${{ github.repository }}/backend:${{ env.ZONE }} -p CHES_TOKEN_URL='https://loginproxy.gov.bc.ca/auth/realms/comsvcauth/protocol/openid-connect/token' -p CHES_API_URL='https://ches.api.gov.bc.ca/api/v1' @@ -224,7 +224,7 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} - -p TAG=${{ github.event.number }} + -p TAG=${{ env.ZONE }} - name: Deploy Frontend ConfigMap uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -237,7 +237,7 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} - -p TAG=${{ github.event.number }} + -p TAG=${{ env.ZONE }} - name: Deploy Frontend uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -250,7 +250,7 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} - -p TAG=${{ github.event.number }} + -p TAG=${{ env.ZONE }} -p PROMOTE=${{ github.repository }}/frontend:${{ env.ZONE }} -p GREEN_DOMAIN=${{ secrets.GREEN_DOMAIN }} -p VITE_NODE_ENV=openshift-${{ env.ZONE }} @@ -303,7 +303,7 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} - -p TAG=${{ github.event.number }} + -p TAG=${{ env.ZONE }} -p ORACLEDB_USER=${{ secrets.ORACLEDB_USERNAME }} -p ORACLEDB_PASSWORD=${{ secrets.ORACLEDB_PASSWORD }} -p ORACLEDB_USER_W=${{ secrets.ORACLEDB_USERNAME_W }} @@ -386,7 +386,7 @@ jobs: verification_path: health parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} - -p TAG=${{ github.event.number }} + -p TAG=${{ env.ZONE }} -p PROMOTE=${{ github.repository }}/legacy:${{ env.PREV }} - name: Deploy Processor @@ -401,7 +401,7 @@ jobs: verification_path: health parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} - -p TAG=${{ github.event.number }} + -p TAG=${{ env.ZONE }} -p PROMOTE=${{ github.repository }}/processor:${{ env.PREV }} -p BCREGISTRY_URI='https://bcregistry-prod.apigee.net' @@ -416,7 +416,7 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} - -p TAG=${{ github.event.number }} + -p TAG=${{ env.ZONE }} - name: Deploy Backend uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -430,7 +430,7 @@ jobs: verification_path: health parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} - -p TAG=${{ github.event.number }} + -p TAG=${{ env.ZONE }} -p PROMOTE=${{ github.repository }}/backend:${{ env.PREV }} -p CHES_TOKEN_URL='https://loginproxy.gov.bc.ca/auth/realms/comsvcauth/protocol/openid-connect/token' -p CHES_API_URL='https://ches.api.gov.bc.ca/api/v1' @@ -449,7 +449,7 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} - -p TAG=${{ github.event.number }} + -p TAG=${{ env.ZONE }} - name: Deploy Frontend uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -462,7 +462,7 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} - -p TAG=${{ github.event.number }} + -p TAG=${{ env.ZONE }} -p PROMOTE=${{ github.repository }}/frontend:${{ env.PREV }} -p GREEN_DOMAIN=${{ secrets.GREEN_DOMAIN }} -p VITE_NODE_ENV=openshift-${{ env.ZONE }} diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index 66ab80180a..be8a39083a 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -21,6 +21,7 @@ jobs: - uses: actions/checkout@v4 with: ref: refs/heads/${{ github.event.repository.default_branch }} + - name: Conventional Changelog Update uses: TriPSs/conventional-changelog-action@v5.4.0 id: semver From eb519899fac4d2e3b929fcae399b7c497b321022 Mon Sep 17 00:00:00 2001 From: Paulo Gomes da Cruz Junior Date: Wed, 28 Aug 2024 16:45:55 -0700 Subject: [PATCH 06/19] chore: removing tag param from init --- .github/workflows/pr-open.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index be8a39083a..9a24d053af 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -241,7 +241,6 @@ jobs: overwrite: true parameters: -p ZONE=${{ github.event.number }} - -p TAG=${{ github.event.number }} -p ORACLEDB_USER=${{ secrets.ORACLEDB_USERNAME }} -p ORACLEDB_PASSWORD=${{ secrets.ORACLEDB_PASSWORD }} -p ORACLEDB_USER_W=THE From 21d7e28ee2a220f2c2ee4c8fb77993f4ce0b4333 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 28 Aug 2024 17:20:55 -0700 Subject: [PATCH 07/19] Remove PROMOTE template vars --- .github/workflows/merge.yml | 55 ++++++++++------------------------ .github/workflows/pr-open.yml | 6 ---- backend/openshift.deploy.yml | 3 -- frontend/openshift.deploy.yml | 3 -- legacy/openshift.deploy.yml | 3 -- processor/openshift.deploy.yml | 3 -- 6 files changed, 15 insertions(+), 58 deletions(-) diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index ec962a6181..ed48b612ad 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -25,21 +25,6 @@ jobs: id: pr uses: bcgov-nr/action-get-pr@v0.0.1 - images-test: - name: Promote images to TEST - needs: [vars] - runs-on: ubuntu-24.04 - strategy: - matrix: - component: [backend, database, frontend, legacy, processor] - steps: - - uses: shrink/actions-docker-registry-tag@v4 - with: - registry: ghcr.io - repository: ${{ github.repository }}/${{ matrix.component }} - target: ${{ needs.vars.outputs.pr }} - tags: test - test-init: name: TEST Init needs: [images-test] @@ -147,7 +132,6 @@ jobs: parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} -p TAG=${{ env.ZONE }} - -p PROMOTE=${{ github.repository }}/database:${{ env.ZONE }} - name: Deploy Legacy uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -162,8 +146,6 @@ jobs: parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} -p TAG=${{ env.ZONE }} - -p PROMOTE=${{ github.repository }}/legacy:${{ env.ZONE }} - -p ENVIRONMENT=${{ secrets.OC_NAMESPACE }} - name: Deploy Processor uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -177,7 +159,6 @@ jobs: verification_path: health parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} - -p PROMOTE=${{ github.repository }}/processor:${{ env.ZONE }} -p BCREGISTRY_URI='https://bcregistry-prod.apigee.net' - name: Deploy Backend ConfigMap @@ -206,7 +187,6 @@ jobs: parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} -p TAG=${{ env.ZONE }} - -p PROMOTE=${{ github.repository }}/backend:${{ env.ZONE }} -p CHES_TOKEN_URL='https://loginproxy.gov.bc.ca/auth/realms/comsvcauth/protocol/openid-connect/token' -p CHES_API_URL='https://ches.api.gov.bc.ca/api/v1' -p BCREGISTRY_URI='https://bcregistry-prod.apigee.net' @@ -251,7 +231,6 @@ jobs: parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} -p TAG=${{ env.ZONE }} - -p PROMOTE=${{ github.repository }}/frontend:${{ env.ZONE }} -p GREEN_DOMAIN=${{ secrets.GREEN_DOMAIN }} -p VITE_NODE_ENV=openshift-${{ env.ZONE }} -p URL=${{ env.URL }} @@ -267,21 +246,6 @@ jobs: name: Generating Documentation uses: ./.github/workflows/reusable-doc-gen.yml - images-prod: - name: Promote images to PROD - needs: [test-deploy] - runs-on: ubuntu-24.04 - strategy: - matrix: - component: [backend, frontend, legacy, database, processor] - steps: - - uses: shrink/actions-docker-registry-tag@v4 - with: - registry: ghcr.io - repository: ${{ github.repository }}/${{ matrix.component }} - target: test - tags: prod - prod-init: name: PROD Init needs: [images-prod] @@ -387,7 +351,6 @@ jobs: parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} -p TAG=${{ env.ZONE }} - -p PROMOTE=${{ github.repository }}/legacy:${{ env.PREV }} - name: Deploy Processor uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -402,7 +365,6 @@ jobs: parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} -p TAG=${{ env.ZONE }} - -p PROMOTE=${{ github.repository }}/processor:${{ env.PREV }} -p BCREGISTRY_URI='https://bcregistry-prod.apigee.net' - name: Deploy Backend ConfigMap @@ -431,7 +393,6 @@ jobs: parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} -p TAG=${{ env.ZONE }} - -p PROMOTE=${{ github.repository }}/backend:${{ env.PREV }} -p CHES_TOKEN_URL='https://loginproxy.gov.bc.ca/auth/realms/comsvcauth/protocol/openid-connect/token' -p CHES_API_URL='https://ches.api.gov.bc.ca/api/v1' -p BCREGISTRY_URI='https://bcregistry-prod.apigee.net' @@ -463,7 +424,6 @@ jobs: parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} -p TAG=${{ env.ZONE }} - -p PROMOTE=${{ github.repository }}/frontend:${{ env.PREV }} -p GREEN_DOMAIN=${{ secrets.GREEN_DOMAIN }} -p VITE_NODE_ENV=openshift-${{ env.ZONE }} -p URL=${{ env.URL }} @@ -474,3 +434,18 @@ jobs: -p COGNITO_ENVIRONMENT=PROD -p LANDING_URL='${{ secrets.COGNITO_LOGOUT_URI }}' -p FRONTEND_URL=${{ env.URL }} + + promote-images: + name: Promote images to PROD + needs: [prod-deploy] + runs-on: ubuntu-22.04 + strategy: + matrix: + component: [backend, frontend, legacy, database, common, processor] + steps: + - uses: shrink/actions-docker-registry-tag@v4 + with: + registry: ghcr.io + repository: ${{ github.repository }}/${{ matrix.component }} + target: test + tags: prod diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index 9a24d053af..1404a1d575 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -311,9 +311,6 @@ jobs: parameters: -p ZONE=${{ github.event.number }} -p TAG=${{ github.event.number }} - -p PROMOTE=${{ github.repository }}/legacy:${{ github.event.number }} - -p ENVIRONMENT=${{ secrets.OC_NAMESPACE }} - -p ORACLEDB_PORT=1521 - name: Deploy Processor uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -328,7 +325,6 @@ jobs: parameters: -p ZONE=${{ github.event.number }} -p TAG=${{ github.event.number }} - -p PROMOTE=${{ github.repository }}/processor:${{ github.event.number }} -p BCREGISTRY_URI='https://bcregistry-prod.apigee.net' - name: Deploy Backend ConfigMap @@ -356,7 +352,6 @@ jobs: parameters: -p ZONE=${{ github.event.number }} -p TAG=${{ github.event.number }} - -p PROMOTE=${{ github.repository }}/backend:${{ github.event.number }} -p CHES_TOKEN_URL='https://loginproxy.gov.bc.ca/auth/realms/comsvcauth/protocol/openid-connect/token' -p CHES_API_URL='https://ches.api.gov.bc.ca/api/v1' -p BCREGISTRY_URI='https://bcregistry-prod.apigee.net' @@ -401,7 +396,6 @@ jobs: parameters: -p ZONE=${{ github.event.number }} -p TAG=${{ github.event.number }} - -p PROMOTE=${{ github.repository }}/frontend:${{ github.event.number }} -p VITE_NODE_ENV=openshift-dev -p URL=${{ needs.vars.outputs.url }} -p GREEN_DOMAIN=${{ secrets.GREEN_DOMAIN }} diff --git a/backend/openshift.deploy.yml b/backend/openshift.deploy.yml index 44b71ae843..9618ebdce8 100644 --- a/backend/openshift.deploy.yml +++ b/backend/openshift.deploy.yml @@ -27,9 +27,6 @@ parameters: - name: REGISTRY description: Container registry to import from (internal is image-registry.openshift-image-registry.svc:5000) value: ghcr.io - - name: PROMOTE - description: Image (namespace/name:tag) to promote/import - value: bcgov/nr-forest-client-backend:prod - name: CHES_TOKEN_URL description: CHES service authentication url required: true diff --git a/frontend/openshift.deploy.yml b/frontend/openshift.deploy.yml index 957b3e6c79..75bf216579 100644 --- a/frontend/openshift.deploy.yml +++ b/frontend/openshift.deploy.yml @@ -33,9 +33,6 @@ parameters: - name: REGISTRY description: Container registry to import from (internal is image-registry.openshift-image-registry.svc:5000) value: ghcr.io - - name: PROMOTE - description: Image (namespace/name:tag) to promote/import - value: bcgov/nr-old-growth:prod-frontend - name: CPU_REQUEST value: 10m - name: CPU_LIMIT diff --git a/legacy/openshift.deploy.yml b/legacy/openshift.deploy.yml index 9c2c17290c..89a5547284 100644 --- a/legacy/openshift.deploy.yml +++ b/legacy/openshift.deploy.yml @@ -27,9 +27,6 @@ parameters: - name: REGISTRY description: Container registry to import from (internal is image-registry.openshift-image-registry.svc:5000) value: ghcr.io - - name: PROMOTE - description: Image (namespace/name:tag) to promote/import - value: bcgov/nr-forest-client-legacy:prod - name: ORACLEDB_KEYSTORE description: Oracle database keystore file - name: ORACLEDB_PORT diff --git a/processor/openshift.deploy.yml b/processor/openshift.deploy.yml index 0993981420..026b6e0459 100644 --- a/processor/openshift.deploy.yml +++ b/processor/openshift.deploy.yml @@ -27,9 +27,6 @@ parameters: - name: REGISTRY description: Container registry to import from (internal is image-registry.openshift-image-registry.svc:5000) value: ghcr.io - - name: PROMOTE - description: Image (namespace/name:tag) to promote/import - value: bcgov/nr-old-growth:prod-backend - name: CPU_REQUEST value: 75m - name: CPU_LIMIT From 3413931c499a16d09fbe6b41d33560600fb125ba Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 28 Aug 2024 17:29:01 -0700 Subject: [PATCH 08/19] Use pr numbers through main merge --- .github/workflows/merge.yml | 45 +++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index ed48b612ad..7ad1dc8797 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -27,7 +27,7 @@ jobs: test-init: name: TEST Init - needs: [images-test] + needs: [vars] env: ZONE: test URL: forestclient-tst.nrs.gov.bc.ca @@ -46,7 +46,7 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} - -p TAG=${{ env.ZONE }} + -p TAG=${{ needs.vars.outputs.pr }} -p ORACLEDB_USER=${{ secrets.ORACLEDB_USERNAME }} -p ORACLEDB_PASSWORD=${{ secrets.ORACLEDB_PASSWORD }} -p ORACLEDB_USER_W=${{ secrets.ORACLEDB_USERNAME_W }} @@ -90,7 +90,7 @@ jobs: test-deploy: name: TEST Deployment - needs: [test-init] + needs: [vars, test-init] env: URL: forestclient-tst.nrs.gov.bc.ca ZONE: test @@ -110,7 +110,7 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} - -p TAG=${{ github.event.number }} + -p TAG=${{ needs.vars.outputs.pr }} - name: Backup database before update continue-on-error: true @@ -131,7 +131,7 @@ jobs: overwrite: false parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} - -p TAG=${{ env.ZONE }} + -p TAG=${{ needs.vars.outputs.pr }} - name: Deploy Legacy uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -145,7 +145,7 @@ jobs: verification_path: health parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} - -p TAG=${{ env.ZONE }} + -p TAG=${{ needs.vars.outputs.pr }} - name: Deploy Processor uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -159,6 +159,7 @@ jobs: verification_path: health parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} + -p TAG=${{ needs.vars.outputs.pr }} -p BCREGISTRY_URI='https://bcregistry-prod.apigee.net' - name: Deploy Backend ConfigMap @@ -172,7 +173,7 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} - -p TAG=${{ env.ZONE }} + -p TAG=${{ needs.vars.outputs.pr }} - name: Deploy Backend uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -186,7 +187,7 @@ jobs: verification_path: health parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} - -p TAG=${{ env.ZONE }} + -p TAG=${{ needs.vars.outputs.pr }} -p CHES_TOKEN_URL='https://loginproxy.gov.bc.ca/auth/realms/comsvcauth/protocol/openid-connect/token' -p CHES_API_URL='https://ches.api.gov.bc.ca/api/v1' -p BCREGISTRY_URI='https://bcregistry-prod.apigee.net' @@ -204,7 +205,7 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} - -p TAG=${{ env.ZONE }} + -p TAG=${{ needs.vars.outputs.pr }} - name: Deploy Frontend ConfigMap uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -217,7 +218,7 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} - -p TAG=${{ env.ZONE }} + -p TAG=${{ needs.vars.outputs.pr }} - name: Deploy Frontend uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -230,7 +231,7 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} - -p TAG=${{ env.ZONE }} + -p TAG=${{ needs.vars.outputs.pr }} -p GREEN_DOMAIN=${{ secrets.GREEN_DOMAIN }} -p VITE_NODE_ENV=openshift-${{ env.ZONE }} -p URL=${{ env.URL }} @@ -248,7 +249,7 @@ jobs: prod-init: name: PROD Init - needs: [images-prod] + needs: [vars, test-deploy] env: URL: forestclient.nrs.gov.bc.ca ZONE: prod @@ -267,7 +268,7 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} - -p TAG=${{ env.ZONE }} + -p TAG=${{ needs.vars.outputs.pr }} -p ORACLEDB_USER=${{ secrets.ORACLEDB_USERNAME }} -p ORACLEDB_PASSWORD=${{ secrets.ORACLEDB_PASSWORD }} -p ORACLEDB_USER_W=${{ secrets.ORACLEDB_USERNAME_W }} @@ -288,7 +289,7 @@ jobs: prod-deploy: name: PROD Deployment - needs: [prod-init] + needs: [vars, prod-init] env: PREV: test ZONE: prod @@ -309,7 +310,7 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} - -p TAG=${{ github.event.number }} + -p TAG=${{ needs.vars.outputs.pr }} - name: Install CLI tools from OpenShift Mirror uses: redhat-actions/openshift-tools-installer@v1 @@ -336,7 +337,7 @@ jobs: overwrite: false parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} - -p TAG=${{ github.event.number }} + -p TAG=${{ needs.vars.outputs.pr }} - name: Deploy Legacy uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -350,7 +351,7 @@ jobs: verification_path: health parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} - -p TAG=${{ env.ZONE }} + -p TAG=${{ needs.vars.outputs.pr }} - name: Deploy Processor uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -364,7 +365,7 @@ jobs: verification_path: health parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} - -p TAG=${{ env.ZONE }} + -p TAG=${{ needs.vars.outputs.pr }} -p BCREGISTRY_URI='https://bcregistry-prod.apigee.net' - name: Deploy Backend ConfigMap @@ -378,7 +379,7 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} - -p TAG=${{ env.ZONE }} + -p TAG=${{ needs.vars.outputs.pr }} - name: Deploy Backend uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -392,7 +393,7 @@ jobs: verification_path: health parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} - -p TAG=${{ env.ZONE }} + -p TAG=${{ needs.vars.outputs.pr }} -p CHES_TOKEN_URL='https://loginproxy.gov.bc.ca/auth/realms/comsvcauth/protocol/openid-connect/token' -p CHES_API_URL='https://ches.api.gov.bc.ca/api/v1' -p BCREGISTRY_URI='https://bcregistry-prod.apigee.net' @@ -410,7 +411,7 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} - -p TAG=${{ env.ZONE }} + -p TAG=${{ needs.vars.outputs.pr }} - name: Deploy Frontend uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -423,7 +424,7 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} - -p TAG=${{ env.ZONE }} + -p TAG=${{ needs.vars.outputs.pr }} -p GREEN_DOMAIN=${{ secrets.GREEN_DOMAIN }} -p VITE_NODE_ENV=openshift-${{ env.ZONE }} -p URL=${{ env.URL }} From c203b226aaccccd12d728352dd8f0ef1efd7fc62 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 28 Aug 2024 17:32:23 -0700 Subject: [PATCH 09/19] Drop NAME template param from main merge --- .github/workflows/merge.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index 7ad1dc8797..81f0b4922b 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -45,7 +45,7 @@ jobs: oc_version: "4.13" overwrite: true parameters: - -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} + -p ZONE=${{ env.ZONE }} -p TAG=${{ needs.vars.outputs.pr }} -p ORACLEDB_USER=${{ secrets.ORACLEDB_USERNAME }} -p ORACLEDB_PASSWORD=${{ secrets.ORACLEDB_PASSWORD }} @@ -109,7 +109,7 @@ jobs: oc_version: "4.13" overwrite: true parameters: - -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} + -p ZONE=${{ env.ZONE }} -p TAG=${{ needs.vars.outputs.pr }} - name: Backup database before update @@ -130,7 +130,7 @@ jobs: oc_version: "4.13" overwrite: false parameters: - -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} + -p ZONE=${{ env.ZONE }} -p TAG=${{ needs.vars.outputs.pr }} - name: Deploy Legacy @@ -144,7 +144,7 @@ jobs: overwrite: true verification_path: health parameters: - -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} + -p ZONE=${{ env.ZONE }} -p TAG=${{ needs.vars.outputs.pr }} - name: Deploy Processor @@ -158,7 +158,7 @@ jobs: overwrite: true verification_path: health parameters: - -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} + -p ZONE=${{ env.ZONE }} -p TAG=${{ needs.vars.outputs.pr }} -p BCREGISTRY_URI='https://bcregistry-prod.apigee.net' @@ -186,7 +186,7 @@ jobs: overwrite: true verification_path: health parameters: - -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} + -p ZONE=${{ env.ZONE }} -p TAG=${{ needs.vars.outputs.pr }} -p CHES_TOKEN_URL='https://loginproxy.gov.bc.ca/auth/realms/comsvcauth/protocol/openid-connect/token' -p CHES_API_URL='https://ches.api.gov.bc.ca/api/v1' @@ -204,7 +204,7 @@ jobs: oc_version: "4.13" overwrite: true parameters: - -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} + -p ZONE=${{ env.ZONE }} -p TAG=${{ needs.vars.outputs.pr }} - name: Deploy Frontend ConfigMap @@ -230,7 +230,7 @@ jobs: oc_version: "4.13" overwrite: true parameters: - -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} + -p ZONE=${{ env.ZONE }} -p TAG=${{ needs.vars.outputs.pr }} -p GREEN_DOMAIN=${{ secrets.GREEN_DOMAIN }} -p VITE_NODE_ENV=openshift-${{ env.ZONE }} @@ -267,7 +267,7 @@ jobs: oc_version: "4.13" overwrite: true parameters: - -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} + -p ZONE=${{ env.ZONE }} -p TAG=${{ needs.vars.outputs.pr }} -p ORACLEDB_USER=${{ secrets.ORACLEDB_USERNAME }} -p ORACLEDB_PASSWORD=${{ secrets.ORACLEDB_PASSWORD }} @@ -309,7 +309,7 @@ jobs: oc_version: "4.13" overwrite: true parameters: - -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} + -p ZONE=${{ env.ZONE }} -p TAG=${{ needs.vars.outputs.pr }} - name: Install CLI tools from OpenShift Mirror @@ -336,7 +336,7 @@ jobs: oc_version: "4.13" overwrite: false parameters: - -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} + -p ZONE=${{ env.ZONE }} -p TAG=${{ needs.vars.outputs.pr }} - name: Deploy Legacy @@ -350,7 +350,7 @@ jobs: overwrite: true verification_path: health parameters: - -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} + -p ZONE=${{ env.ZONE }} -p TAG=${{ needs.vars.outputs.pr }} - name: Deploy Processor @@ -364,7 +364,7 @@ jobs: overwrite: true verification_path: health parameters: - -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} + -p ZONE=${{ env.ZONE }} -p TAG=${{ needs.vars.outputs.pr }} -p BCREGISTRY_URI='https://bcregistry-prod.apigee.net' @@ -392,7 +392,7 @@ jobs: overwrite: true verification_path: health parameters: - -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} + -p ZONE=${{ env.ZONE }} -p TAG=${{ needs.vars.outputs.pr }} -p CHES_TOKEN_URL='https://loginproxy.gov.bc.ca/auth/realms/comsvcauth/protocol/openid-connect/token' -p CHES_API_URL='https://ches.api.gov.bc.ca/api/v1' @@ -423,7 +423,7 @@ jobs: oc_version: "4.13" overwrite: true parameters: - -p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }} + -p ZONE=${{ env.ZONE }} -p TAG=${{ needs.vars.outputs.pr }} -p GREEN_DOMAIN=${{ secrets.GREEN_DOMAIN }} -p VITE_NODE_ENV=openshift-${{ env.ZONE }} From ff965c973a8f448b5590a2722dd363aa1e835c6a Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 28 Aug 2024 17:46:10 -0700 Subject: [PATCH 10/19] Clip TAG param from configmap deploys --- .github/workflows/merge.yml | 4 --- .github/workflows/pr-open.yml | 68 +++++++++++++---------------------- 2 files changed, 24 insertions(+), 48 deletions(-) diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index 81f0b4922b..9f7aedcf53 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -173,7 +173,6 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} - -p TAG=${{ needs.vars.outputs.pr }} - name: Deploy Backend uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -218,7 +217,6 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} - -p TAG=${{ needs.vars.outputs.pr }} - name: Deploy Frontend uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -379,7 +377,6 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} - -p TAG=${{ needs.vars.outputs.pr }} - name: Deploy Backend uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -411,7 +408,6 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} - -p TAG=${{ needs.vars.outputs.pr }} - name: Deploy Frontend uses: bcgov-nr/action-deployer-openshift@v3.0.1 diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index 1404a1d575..017a199e67 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -42,50 +42,32 @@ jobs: echo "semver=${{ steps.semver.outputs.tag }}" echo "url=${{ steps.calculate.outputs.url }}" - builds: - name: Builds - runs-on: ubuntu-24.04 - needs: [vars] - permissions: - packages: write - strategy: - matrix: - package: [backend, database, frontend, legacy, processor] - steps: - - uses: actions/checkout@v4 + # builds: + # name: Builds + # runs-on: ubuntu-22.04 + # needs: [vars] + # permissions: + # packages: write + # strategy: + # matrix: + # package: [backend, common, database, frontend, legacy, processor] + # steps: + # - uses: actions/checkout@v4 + + # - uses: bcgov-nr/action-builder-ghcr@v2.2.0 + # name: Build (${{ matrix.package }}) + # with: + # package: ${{ matrix.package }} + # tag: ${{ github.event.number }} + # tag_fallback: test + # triggers: ('${{ matrix.package }}/') + # build_args: | + # APP_VERSION=${{ needs.vars.outputs.semver }}-${{ github.event.number }} - - uses: bcgov-nr/action-builder-ghcr@v2.2.0 - name: Build (${{ matrix.package }}) - with: - package: ${{ matrix.package }} - tag: ${{ github.event.number }} - tag_fallback: test - triggers: ('${{ matrix.package }}/') - build_args: | - APP_VERSION=${{ needs.vars.outputs.semver }}-${{ github.event.number }} - - build-legacydb: - name: Builds (legacydb) - runs-on: ubuntu-24.04 + deploy: + name: Deploy Application + # needs: [builds, vars] needs: [vars] - permissions: - packages: write - steps: - - uses: actions/checkout@v4 - - - uses: bcgov-nr/action-builder-ghcr@v2.2.0 - name: Build (Legacy db) - with: - package: legacydb - tag: latest - tag_fallback: test - triggers: ('legacydb/') - build_args: | - APP_VERSION=${{ needs.vars.outputs.semver }}-${{ github.event.number }} - - pre-tools: - name: Pre Deploy Tools - needs: [build-legacydb, vars] environment: dev runs-on: ubuntu-24.04 steps: @@ -337,7 +319,6 @@ jobs: overwrite: true parameters: -p ZONE=${{ github.event.number }} - -p TAG=${{ github.event.number }} - name: Deploy Backend uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -382,7 +363,6 @@ jobs: overwrite: true parameters: -p ZONE=${{ github.event.number }} - -p TAG=${{ github.event.number }} - name: Deploy Frontend uses: bcgov-nr/action-deployer-openshift@v3.0.1 From c213c15959d751daf1a9a00cd31affd9c5b6db3d Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 28 Aug 2024 17:57:34 -0700 Subject: [PATCH 11/19] Clip TAG param from more templates --- .github/workflows/merge.yml | 4 ---- .github/workflows/pr-open.yml | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index 9f7aedcf53..58cabe4eaa 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -46,7 +46,6 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} - -p TAG=${{ needs.vars.outputs.pr }} -p ORACLEDB_USER=${{ secrets.ORACLEDB_USERNAME }} -p ORACLEDB_PASSWORD=${{ secrets.ORACLEDB_PASSWORD }} -p ORACLEDB_USER_W=${{ secrets.ORACLEDB_USERNAME_W }} @@ -110,7 +109,6 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} - -p TAG=${{ needs.vars.outputs.pr }} - name: Backup database before update continue-on-error: true @@ -204,7 +202,6 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} - -p TAG=${{ needs.vars.outputs.pr }} - name: Deploy Frontend ConfigMap uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -266,7 +263,6 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} - -p TAG=${{ needs.vars.outputs.pr }} -p ORACLEDB_USER=${{ secrets.ORACLEDB_USERNAME }} -p ORACLEDB_PASSWORD=${{ secrets.ORACLEDB_PASSWORD }} -p ORACLEDB_USER_W=${{ secrets.ORACLEDB_USERNAME_W }} diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index 017a199e67..d05dab8396 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -257,6 +257,7 @@ jobs: uses: redhat-actions/openshift-tools-installer@v1 with: oc: "4.13" + - name: Backup database before update continue-on-error: true run: | @@ -350,7 +351,6 @@ jobs: overwrite: true parameters: -p ZONE=${{ github.event.number }} - -p TAG=${{ github.event.number }} - name: Deploy Frontend ConfigMap uses: bcgov-nr/action-deployer-openshift@v3.0.1 From 0d0cd4d003fddd794dab5fd70ffd03ea2bb0158c Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 28 Aug 2024 18:01:01 -0700 Subject: [PATCH 12/19] Keep messing with params --- .github/workflows/merge.yml | 1 + .github/workflows/pr-open.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index 58cabe4eaa..709ca30b6e 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -109,6 +109,7 @@ jobs: overwrite: true parameters: -p ZONE=${{ env.ZONE }} + -p TAG=${{ needs.vars.outputs.pr }} - name: Backup database before update continue-on-error: true diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index d05dab8396..da9e319bda 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -253,6 +253,7 @@ jobs: parameters: -p ZONE=${{ github.event.number }} -p TAG=${{ github.event.number }} + - name: Install CLI tools from OpenShift Mirror uses: redhat-actions/openshift-tools-installer@v1 with: From 2ccd8d197b300fecc853a54490d0558a440d1384 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Thu, 29 Aug 2024 09:30:19 -0700 Subject: [PATCH 13/19] Restore builds --- .github/workflows/pr-open.yml | 45 +++++++++++++++++------------------ 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index da9e319bda..e04517d640 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -42,32 +42,31 @@ jobs: echo "semver=${{ steps.semver.outputs.tag }}" echo "url=${{ steps.calculate.outputs.url }}" - # builds: - # name: Builds - # runs-on: ubuntu-22.04 - # needs: [vars] - # permissions: - # packages: write - # strategy: - # matrix: - # package: [backend, common, database, frontend, legacy, processor] - # steps: - # - uses: actions/checkout@v4 - - # - uses: bcgov-nr/action-builder-ghcr@v2.2.0 - # name: Build (${{ matrix.package }}) - # with: - # package: ${{ matrix.package }} - # tag: ${{ github.event.number }} - # tag_fallback: test - # triggers: ('${{ matrix.package }}/') - # build_args: | - # APP_VERSION=${{ needs.vars.outputs.semver }}-${{ github.event.number }} + builds: + name: Builds + runs-on: ubuntu-22.04 + needs: [vars] + permissions: + packages: write + strategy: + matrix: + package: [backend, common, database, frontend, legacy, processor] + steps: + - uses: actions/checkout@v4 + + - uses: bcgov-nr/action-builder-ghcr@v2.2.0 + name: Build (${{ matrix.package }}) + with: + package: ${{ matrix.package }} + tag: ${{ github.event.number }} + tag_fallback: test + triggers: ('${{ matrix.package }}/') + build_args: | + APP_VERSION=${{ needs.vars.outputs.semver }}-${{ github.event.number }} deploy: name: Deploy Application - # needs: [builds, vars] - needs: [vars] + needs: [builds, vars] environment: dev runs-on: ubuntu-24.04 steps: From 51c59518ff4afe8baf89cc4a9f18be4e6985b0e8 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 2 Oct 2024 20:50:40 -0700 Subject: [PATCH 14/19] Random envar to ensure consistent rollouts --- backend/openshift.deploy.yml | 6 ++++++ database/openshift.deploy.yml | 4 ++++ frontend/openshift.deploy.yml | 6 ++++++ legacy/openshift.deploy.yml | 6 ++++++ processor/openshift.deploy.yml | 6 ++++++ 5 files changed, 28 insertions(+) diff --git a/backend/openshift.deploy.yml b/backend/openshift.deploy.yml index 9618ebdce8..321e57865f 100644 --- a/backend/openshift.deploy.yml +++ b/backend/openshift.deploy.yml @@ -53,6 +53,10 @@ parameters: - name: CONFIG_MAP_NAME description: ConfigMap name specific to each environment value: ${NAME}-${ZONE}-${COMPONENT}-config + - name: RANDOM_EXPRESSION + description: Random expression to make sure deployments update + from: "[a-zA-Z0-9]{32}" + generate: expression objects: - kind: Deployment apiVersion: apps/v1 @@ -181,6 +185,8 @@ objects: value: ${COMPONENT} - name: FEATURES_BCREGISTRY_MULTIADDRESS value: "false" + - name: RANDOM_EXPRESSION + value: ${RANDOM_EXPRESSION} ports: - containerPort: 8080 protocol: TCP diff --git a/database/openshift.deploy.yml b/database/openshift.deploy.yml index 9bb38f79e9..17acd19d53 100644 --- a/database/openshift.deploy.yml +++ b/database/openshift.deploy.yml @@ -91,6 +91,10 @@ parameters: description: Random expression to make sure deployments update from: "[a-zA-Z0-9]{32}" generate: expression + - name: RANDOM_EXPRESSION + description: Random expression to make sure deployments update + from: "[a-zA-Z0-9]{32}" + generate: expression objects: - kind: PersistentVolumeClaim apiVersion: v1 diff --git a/frontend/openshift.deploy.yml b/frontend/openshift.deploy.yml index 75bf216579..51f1d53c4e 100644 --- a/frontend/openshift.deploy.yml +++ b/frontend/openshift.deploy.yml @@ -76,6 +76,10 @@ parameters: - name: FRONTEND_URL description: Frontend URL required: true + - name: RANDOM_EXPRESSION + description: Random expression to make sure deployments update + from: "[a-zA-Z0-9]{32}" + generate: expression objects: objects: - kind: ConfigMap @@ -144,6 +148,8 @@ objects: value: ${COGNITO_REGION} - name: COGNITO_DOMAIN value: ${COGNITO_DOMAIN} + - name: RANDOM_EXPRESSION + value: ${RANDOM_EXPRESSION} imagePullPolicy: Always name: ${NAME} volumeMounts: diff --git a/legacy/openshift.deploy.yml b/legacy/openshift.deploy.yml index 89a5547284..e3b4cc8b5d 100644 --- a/legacy/openshift.deploy.yml +++ b/legacy/openshift.deploy.yml @@ -43,6 +43,10 @@ parameters: - name: CERT_PVC_SIZE description: The amount of storage the cert PVC should have value: 25Mi + - name: RANDOM_EXPRESSION + description: Random expression to make sure deployments update + from: "[a-zA-Z0-9]{32}" + generate: expression objects: - kind: PersistentVolumeClaim apiVersion: v1 @@ -155,6 +159,8 @@ objects: value: /cert/jssecacerts - name: TZ value: America/Vancouver + - name: RANDOM_EXPRESSION + value: ${RANDOM_EXPRESSION} ports: - containerPort: 9000 protocol: TCP diff --git a/processor/openshift.deploy.yml b/processor/openshift.deploy.yml index 026b6e0459..11f36a3d22 100644 --- a/processor/openshift.deploy.yml +++ b/processor/openshift.deploy.yml @@ -38,6 +38,10 @@ parameters: - name: BCREGISTRY_URI description: Bc Registry API address required: true + - name: RANDOM_EXPRESSION + description: Random expression to make sure deployments update + from: "[a-zA-Z0-9]{32}" + generate: expression objects: - kind: Deployment @@ -115,6 +119,8 @@ objects: secretKeyRef: name: ${NAME}-${ZONE} key: processor-service-account-secret + - name: RANDOM_EXPRESSION + value: ${RANDOM_EXPRESSION} ports: - containerPort: 3000 protocol: TCP From 4dbfac101a598ac1792217e47cb850cd629308cc Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Tue, 5 Nov 2024 10:09:35 -0800 Subject: [PATCH 15/19] Any old change to troubleshoot workflows --- .github/workflows/pr-open.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index e04517d640..d427310f32 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -120,10 +120,12 @@ jobs: -p ORACLEDB_USER_W=THE -p ORACLEDB_PASSWORD_W=${{ secrets.ORACLEDB_PASSWORD_W }} -p TAG=latest + - name: Install CLI tools from OpenShift Mirror uses: redhat-actions/openshift-tools-installer@v1 with: oc: "4.13" + - name: Remove the PR database continue-on-error: true run: | From a3c101119fc573cd5f509e86896cca15520ea7bb Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Tue, 5 Nov 2024 11:26:54 -0800 Subject: [PATCH 16/19] Fix job name --- .github/workflows/pr-open.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index d427310f32..4916e21540 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -64,8 +64,8 @@ jobs: build_args: | APP_VERSION=${{ needs.vars.outputs.semver }}-${{ github.event.number }} - deploy: - name: Deploy Application + pre-tools: + name: Pre Deploy Tools needs: [builds, vars] environment: dev runs-on: ubuntu-24.04 From 1b6f04cf168ae3d383b6ea437de0dcd750240cf5 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Tue, 5 Nov 2024 11:30:40 -0800 Subject: [PATCH 17/19] Prereqs --- .github/workflows/pr-open.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index 4916e21540..cebe556fa3 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -97,7 +97,7 @@ jobs: deploy-tools: name: Deploy Tools - needs: [pre-tools, build-legacydb, vars] + needs: [pre-tools, vars] environment: tools env: DOMAIN: apps.silver.devops.gov.bc.ca From dba56a693e68d8d77adaed771e6b4af848041d37 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Tue, 5 Nov 2024 11:54:41 -0800 Subject: [PATCH 18/19] Replace ENVIRONMENT with ZONE for Legacy --- legacy/openshift.deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/legacy/openshift.deploy.yml b/legacy/openshift.deploy.yml index e3b4cc8b5d..b16c124759 100644 --- a/legacy/openshift.deploy.yml +++ b/legacy/openshift.deploy.yml @@ -149,7 +149,7 @@ objects: - name: ORACLEDB_PORT value: ${ORACLEDB_PORT} - name: SPRING_PROFILES_ACTIVE - value: "container,${ENVIRONMENT}" + value: "container,${ZONE}" - name: ORACLEDB_SECRET valueFrom: secretKeyRef: From d6d37f6bf2828d308638474aa63eac4328fc6fa0 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Tue, 5 Nov 2024 15:08:39 -0800 Subject: [PATCH 19/19] Restore Legacy ENVIRONMENT param --- .github/workflows/merge.yml | 4 +++- .github/workflows/pr-open.yml | 1 + legacy/openshift.deploy.yml | 5 ++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index 709ca30b6e..ff01dbf471 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -145,6 +145,7 @@ jobs: parameters: -p ZONE=${{ env.ZONE }} -p TAG=${{ needs.vars.outputs.pr }} + -p ENVIRONMENT=test - name: Deploy Processor uses: bcgov-nr/action-deployer-openshift@v3.0.1 @@ -347,7 +348,8 @@ jobs: parameters: -p ZONE=${{ env.ZONE }} -p TAG=${{ needs.vars.outputs.pr }} - + -p ENVIRONMENT=prod + - name: Deploy Processor uses: bcgov-nr/action-deployer-openshift@v3.0.1 with: diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index cebe556fa3..8f2a1a7c2e 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -296,6 +296,7 @@ jobs: parameters: -p ZONE=${{ github.event.number }} -p TAG=${{ github.event.number }} + -p ENVIRONMENT=dev - name: Deploy Processor uses: bcgov-nr/action-deployer-openshift@v3.0.1 diff --git a/legacy/openshift.deploy.yml b/legacy/openshift.deploy.yml index b16c124759..271b5756cd 100644 --- a/legacy/openshift.deploy.yml +++ b/legacy/openshift.deploy.yml @@ -13,6 +13,9 @@ parameters: - name: ZONE description: Deployment zone, e.g. pr-### or prod required: true + - name: ENVIRONMENT + description: Environment name used by the application + required: true - name: TAG description: Image tag; e.g. PR number, latest or prod required: true @@ -149,7 +152,7 @@ objects: - name: ORACLEDB_PORT value: ${ORACLEDB_PORT} - name: SPRING_PROFILES_ACTIVE - value: "container,${ZONE}" + value: "container,${ENVIRONMENT}" - name: ORACLEDB_SECRET valueFrom: secretKeyRef: