Skip to content

Commit

Permalink
chore: rearranging resources for openshift (#421)
Browse files Browse the repository at this point in the history
* chore: rearranging resources for openshift

* chore: rearranging resources for openshift

* ci: grouping deploy workflows for test and prod
  • Loading branch information
Paulo Gomes da Cruz Junior authored Mar 24, 2023
1 parent 62dbeeb commit b58020e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 88 deletions.
99 changes: 16 additions & 83 deletions .github/workflows/merge-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,17 +188,19 @@ jobs:
name: ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}

test-database:
name: TEST Database
test-deploy:
name: TEST Deployment
needs:
- test-init
env:
ZONE: test
DOMAIN: apps.silver.devops.gov.bc.ca
environment: test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Deploys

- name: Deploy Database
uses: bcgov-nr/[email protected]
with:
file: database/openshift.deploy.yml
Expand All @@ -211,17 +213,7 @@ jobs:
-p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }}
-p PROMOTE=${{ github.repository }}/database:${{ env.ZONE }}

test-backend:
name: TEST Backend
needs:
- test-database
env:
ZONE: test
environment: test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Deploys
- name: Deploy Backend
uses: bcgov-nr/[email protected]
with:
file: backend/openshift.deploy.yml
Expand All @@ -238,19 +230,7 @@ jobs:
-p CHES_API_URL='https://ches-test.api.gov.bc.ca/api/v1'
-p BCREGISTRY_URI='https://bcregistry-sandbox.apigee.net'

test-legacy:
name: TEST Legacy
needs:
- test-init
env:
ZONE: test
DOMAIN: apps.silver.devops.gov.bc.ca
environment: test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- name: Deploys
- name: Deplo Legacy
uses: bcgov-nr/[email protected]
with:
file: legacy/openshift.deploy.yml
Expand All @@ -265,17 +245,7 @@ jobs:
-p PROMOTE=${{ github.repository }}/legacy:${{ env.ZONE }}
-p FOREST_API_URL=https://${{ github.event.repository.name }}-${{ env.ZONE }}-backend.${{ env.DOMAIN }}

test-frontend:
name: TEST Frontend
needs:
- test-init
env:
ZONE: test
environment: test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Deploys
- name: Deploy Frontend
uses: bcgov-nr/[email protected]
with:
file: frontend/openshift.deploy.yml
Expand All @@ -293,9 +263,7 @@ jobs:
image-promotions:
name: Promote images to PROD
needs:
- test-backend
- test-frontend
- test-legacy
- test-deploy
runs-on: ubuntu-22.04
strategy:
matrix:
Expand All @@ -311,9 +279,6 @@ jobs:
prod-init:
name: PROD Init
needs:
- test-backend
- test-frontend
- test-legacy
- image-promotions
env:
ZONE: prod
Expand Down Expand Up @@ -364,18 +329,20 @@ jobs:
-p CHES_CLIENT_ID=${{ secrets.CHES_CLIENT_ID }}
-p CHES_CLIENT_SECRET=${{ secrets.CHES_CLIENT_SECRET }}

prod-database:
prod-deploy:
name: PROD Database
needs:
- prod-init
env:
PREV: test
ZONE: prod
DOMAIN: apps.silver.devops.gov.bc.ca
environment: prod
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Deploys

- name: Deploy Database
uses: bcgov-nr/[email protected]
with:
file: database/openshift.deploy.yml
Expand All @@ -388,18 +355,7 @@ jobs:
-p ZONE=${{ env.ZONE }} -p NAME=${{ github.event.repository.name }}
-p PROMOTE=${{ github.repository }}/database:${{ env.PREV }}

prod-backend:
name: PROD Backend
needs:
- prod-database
env:
PREV: test
ZONE: prod
environment: prod
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Deploys
- name: Deploy Backend
uses: bcgov-nr/[email protected]
with:
file: backend/openshift.deploy.yml
Expand All @@ -416,19 +372,7 @@ jobs:
-p CHES_API_URL='https://ches.api.gov.bc.ca/api/v1'
-p BCREGISTRY_URI='https://bcregistry-prod.apigee.net'

prod-legacy:
name: PROD Legacy
needs:
- prod-init
env:
PREV: test
ZONE: prod
DOMAIN: apps.silver.devops.gov.bc.ca
environment: prod
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Deploys
- name: Deploy Legacy
uses: bcgov-nr/[email protected]
with:
file: legacy/openshift.deploy.yml
Expand All @@ -443,18 +387,7 @@ jobs:
-p PROMOTE=${{ github.repository }}/legacy:${{ env.PREV }}
-p FOREST_API_URL=https://${{ github.event.repository.name }}-${{ env.ZONE }}-backend.${{ env.DOMAIN }}

prod-frontend:
name: PROD Frontend
needs:
- prod-init
env:
PREV: test
ZONE: prod
environment: prod
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Deploys
- name: Deploy Frontend
uses: bcgov-nr/[email protected]
with:
file: frontend/openshift.deploy.yml
Expand Down
4 changes: 2 additions & 2 deletions backend/openshift.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ parameters:
- name: CPU_LIMIT
value: 200m
- name: MEMORY_REQUEST
value: 125Mi
value: 75Mi
- name: MEMORY_LIMIT
value: 250Mi
value: 75Mi
- name: BCREGISTRY_URI
description: Bc Registry API address
required: true
Expand Down
2 changes: 1 addition & 1 deletion frontend/openshift.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ parameters:
- name: MEMORY_REQUEST
value: 50Mi
- name: MEMORY_LIMIT
value: 150Mi
value: 50Mi
- name: VITE_NODE_ENV
value: ""
- name: VITE_KEYCLOAK_URL
Expand Down
4 changes: 2 additions & 2 deletions legacy/openshift.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ parameters:
- name: CPU_LIMIT
value: 200m
- name: MEMORY_REQUEST
value: 125Mi
value: 75Mi
- name: MEMORY_LIMIT
value: 250Mi
value: 75Mi
objects:
- apiVersion: v1
kind: ImageStream
Expand Down

0 comments on commit b58020e

Please sign in to comment.