generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): workflows and templates (#170)
- Loading branch information
1 parent
79a567e
commit 10a6e68
Showing
9 changed files
with
212 additions
and
232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,3 @@ | ||
# EXPRESS API | ||
API_PORT= | ||
API_HOST= | ||
|
||
# POSTGRES | ||
POSTGRES_USER= | ||
POSTGRES_PASSWORD= | ||
POSTGRES_DB= | ||
POSTGRES_HOST= | ||
POSTGRES_PORT= | ||
POSTGRES_DATABASE= | ||
|
||
# POSTGRES ADMIN PAGE | ||
PGADMIN_DEFAULT_EMAIL= | ||
PGADMIN_DEFAULT_PASSWORD= | ||
|
||
# VITE FRONTEND | ||
VITE_PORT= | ||
VITE_BACKEND_URL= | ||
|
||
# KEYCLOAK SETTINGS | ||
SSO_CLIENT_ID= | ||
SSO_CLIENT_SECRET= | ||
SSO_REDIRECT_URL= | ||
FRONTEND_URL= | ||
BACKEND_URL= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,20 +3,39 @@ name: .Deploys | |
on: | ||
workflow_call: | ||
inputs: | ||
### Required | ||
# Nothing! Only `secrets: inherit` is required | ||
|
||
### Typical / recommended | ||
environment: | ||
description: GitHub environment; e.g. PR number (omit), TEST or PROD | ||
default: "dev" | ||
required: false | ||
type: string | ||
tag: | ||
description: Image tag; e.g. PR number or latest | ||
default: ${{ github.event.number }} | ||
required: false | ||
type: string | ||
target: | ||
description: Deployment target; e.g. PR number (omit), test or prod | ||
default: ${{ github.event.number }} | ||
required: false | ||
type: string | ||
|
||
### Optional / per-environment | ||
db-pvc-size: | ||
description: Database PVC size; e.g. 1Gi | ||
default: "128Mi" | ||
type: string | ||
db-cpu-request: | ||
description: Database CPU request; e.g. 50m | ||
default: "50m" | ||
type: string | ||
backend-cpu-request: | ||
description: Backend CPU request; e.g. 50m | ||
default: "50m" | ||
type: string | ||
frontend-cpu-request: | ||
description: Frontend CPU request; e.g. 50m | ||
default: "50m" | ||
type: string | ||
|
||
jobs: | ||
|
@@ -40,62 +59,46 @@ jobs: | |
-p DB_PASSWORD=${{ secrets.DB_PASSWORD }} | ||
-p DB_USER=${{ secrets.DB_USER }} | ||
-p DB_NAME=${{ secrets.DB_NAME }} | ||
-p DB_PORT=${{ secrets.DB_PORT }} | ||
-p SSO_CLIENT_ID=${{ vars.SSO_CLIENT_ID }} | ||
-p SSO_CLIENT_SECRET=${{ secrets.SSO_CLIENT_SECRET }} | ||
|
||
database: | ||
name: Database | ||
needs: [init] | ||
deploy: | ||
name: Deploy | ||
environment: ${{ inputs.environment }} | ||
runs-on: ubuntu-22.04 | ||
needs: [init] | ||
runs-on: ubuntu-24.04 | ||
timeout-minutes: 10 | ||
strategy: | ||
matrix: | ||
name: [database, backend, frontend] | ||
include: | ||
- name: database | ||
overwrite: false | ||
parameters: | ||
-p DB_PVC_SIZE=${{ inputs.db-pvc-size }} | ||
-p CPU_REQUEST=${{ inputs.db-cpu-request }} | ||
- name: backend | ||
overwrite: true | ||
parameters: | ||
-p SSO_AUTH_SERVER_URL=${{ vars.SSO_AUTH_SERVER_URL }} | ||
-p CPU_REQUEST=${{ inputs.backend-cpu-request }} | ||
verification_path: /healthcheck/ | ||
- name: frontend | ||
overwrite: true | ||
parameters: | ||
-p CPU_REQUEST=${{ inputs.frontend-cpu-request }} | ||
steps: | ||
- name: Deploy Database | ||
uses: bcgov-nr/[email protected] | ||
- uses: bcgov-nr/[email protected] | ||
with: | ||
file: ${{ matrix.name }}/openshift.deploy.yml | ||
oc_namespace: ${{ secrets.OC_NAMESPACE }} | ||
oc_server: ${{ vars.OC_SERVER }} | ||
oc_token: ${{ secrets.OC_TOKEN }} | ||
file: database/openshift.deploy.yml | ||
overwrite: false | ||
parameters: | ||
-p IMAGE_TAG=${{ inputs.tag }} | ||
parameters: | ||
-p TAG=${{ inputs.tag }} | ||
-p TARGET=${{ inputs.target }} | ||
|
||
backend: | ||
name: Backend | ||
needs: [init, database] | ||
environment: ${{ inputs.environment }} | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Deploy Backend | ||
uses: bcgov-nr/[email protected] | ||
with: | ||
oc_namespace: ${{ secrets.OC_NAMESPACE }} | ||
oc_server: ${{ vars.OC_SERVER }} | ||
oc_token: ${{ secrets.OC_TOKEN }} | ||
file: backend/openshift.deploy.yml | ||
overwrite: true | ||
parameters: | ||
-p IMAGE_TAG=${{ inputs.tag }} | ||
-p TARGET=${{ inputs.target }} | ||
-p SSOAUTH=${{ vars.SSO_AUTH_SERVER_URL }} | ||
verification_path: /healthcheck/ | ||
${{ matrix.parameters }} | ||
verification_path: ${{ matrix.verification_path }} | ||
verification_retry_attempts: "5" | ||
verification_retry_seconds: "15" | ||
|
||
frontend: | ||
name: Frontend | ||
needs: [init, database, backend] | ||
environment: ${{ inputs.environment }} | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Deploy Frontend | ||
uses: bcgov-nr/[email protected] | ||
with: | ||
oc_namespace: ${{ secrets.OC_NAMESPACE }} | ||
oc_server: ${{ vars.OC_SERVER }} | ||
oc_token: ${{ secrets.OC_TOKEN }} | ||
file: frontend/openshift.deploy.yml | ||
overwrite: true | ||
parameters: | ||
-p TAG=${{ inputs.tag }} -p TARGET=${{ inputs.target }} | ||
-p SSOAUTH=${{ vars.SSO_AUTH_SERVER_URL }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,8 +15,8 @@ jobs: | |
uses: bcgov/quickstart-openshift-helpers/.github/workflows/[email protected] | ||
with: | ||
markdown_links: | | ||
- [Frontend](https://${{ github.event.repository.name }}-${{ github.event.number }}-frontend.apps.silver.devops.gov.bc.ca) | ||
- [Backend](https://${{ github.event.repository.name }}-${{ github.event.number }}-frontend.apps.silver.devops.gov.bc.ca/api) | ||
- [Frontend](https://${{ github.event.repository.name }}-${{ github.event.number }}.apps.silver.devops.gov.bc.ca) | ||
- [Backend](https://${{ github.event.repository.name }}-${{ github.event.number }}-backend.apps.silver.devops.gov.bc.ca/healthcheck/) | ||
results: | ||
name: Validate Results | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.