Skip to content

Commit

Permalink
Merge pull request #941 from bcgov/test
Browse files Browse the repository at this point in the history
BHBC-2140: Release to Prod
  • Loading branch information
NickPhura authored Feb 10, 2023
2 parents e2d58e0 + 853e69b commit f1e28b7
Show file tree
Hide file tree
Showing 863 changed files with 66,477 additions and 90,228 deletions.
46 changes: 27 additions & 19 deletions .config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
"api": "biohubbc-api",
"app": "biohubbc-app"
},
"staticBranches": [
"dev",
"test",
"prod"
],
"staticUrls": {
"dev": "dev-biohubbc.apps.silver.devops.gov.bc.ca",
"test": "test-biohubbc.apps.silver.devops.gov.bc.ca",
Expand All @@ -37,31 +32,44 @@
"test": "n8n-af2668-test.apps.silver.devops.gov.bc.ca",
"prod": "n8n-af2668-prod.apps.silver.devops.gov.bc.ca"
},
"certificateURL": {
"dev": "https://dev.oidc.gov.bc.ca/auth/realms/35r1iman/protocol/openid-connect/certs",
"test": "https://test.oidc.gov.bc.ca/auth/realms/35r1iman/protocol/openid-connect/certs",
"prod": "https://oidc.gov.bc.ca/auth/realms/35r1iman/protocol/openid-connect/certs"
},
"siteminderLogoutURL": {
"dev": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi",
"test": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi",
"prod": "https://logon7.gov.bc.ca/clp-cgi/logoff.cgi"
},
"sso": {
"dev": {
"url": "https://dev.oidc.gov.bc.ca/auth",
"clientId": "biohubbc",
"realm": "35r1iman"
"url": "https://dev.loginproxy.gov.bc.ca/auth",
"clientId": "sims-4461",
"realm": "standard",
"integrationId": "4461",
"adminHost": "https://loginproxy.gov.bc.ca/auth",
"adminUserName": "sims-svc-4464",
"apiHost": "https://api.loginproxy.gov.bc.ca/api/v1",
"keycloakSecret": "keycloak-admin-password",
"keycloakSecretAdminPassword": "keycloak_admin_password"
},
"test": {
"url": "https://test.oidc.gov.bc.ca/auth",
"clientId": "biohubbc",
"realm": "35r1iman"
"url": "https://test.loginproxy.gov.bc.ca/auth",
"clientId": "sims-4461",
"realm": "standard",
"integrationId": "4461",
"adminHost": "https://loginproxy.gov.bc.ca/auth",
"adminUserName": "sims-svc-4464",
"apiHost": "https://api.loginproxy.gov.bc.ca/api/v1",
"keycloakSecret": "keycloak-admin-password",
"keycloakSecretAdminPassword": "keycloak_admin_password"
},
"prod": {
"url": "https://oidc.gov.bc.ca/auth",
"clientId": "biohubbc",
"realm": "35r1iman"
"url": "https://loginproxy.gov.bc.ca/auth",
"clientId": "sims-4461",
"realm": "standard",
"integrationId": "4461",
"adminHost": "https://loginproxy.gov.bc.ca/auth",
"adminUserName": "sims-svc-4464",
"apiHost": "https://api.loginproxy.gov.bc.ca/api/v1",
"keycloakSecret": "keycloak-admin-password",
"keycloakSecretAdminPassword": "keycloak_admin_password"
}
}
}
4 changes: 1 addition & 3 deletions .github/workflows/addComments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ name: Add Comments

on:
pull_request:
types: [opened]
branches:
- dev
types: [opened, ready_for_review]

jobs:
addOpenshiftURLComment:
Expand Down
54 changes: 33 additions & 21 deletions .github/workflows/cleanClosedPR.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,45 @@
# Clean out the deployment artifacts when a PR is closed, without a merge.
# This clean out gets rid of the PR artifacts in Dev and in Tools.
name: Clean out Dev from closed PR Artifacts
# Clean out all deployment artifacts when a PR is closed, but not merged.
# Will attempt to remove all artifacts from any PR that was opened against any branch (and then closed), except for test and prod.
name: Clean Closed PR Artifacts

on:
pull_request:
branches: [dev]
branches:
- '*'
- '!test'
- '!prod'
types: [closed]

jobs:
clean:
name: Clean Deployment Artifacts for API and App in Dev and Tools environment
runs-on: ubuntu-latest
# Only do this when the PR was not merged and only for dev
if: ${{ github.event.pull_request.merged != true && github.base_ref == 'dev' && github.event.pull_request.draft == false }}
# Don't run if the PR was merged
if: ${{ github.event.pull_request.merged != true }}
env:
BUILD_ID: ${{ github.event.number }}
PR_NUMBER: ${{ github.event.number }}
steps:
# Checkout the PR branch
- name: Checkout Dev Branch - Contains the Pipeline Code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: 'dev'
ref: "dev"

# Install Node - for `node` and `npm` commands
- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 14

# Cache Node modules
- name: Cache node modules
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/.pipeline/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
Expand All @@ -44,27 +49,34 @@ jobs:
- name: Log in to OpenShift
run: oc login --token=${{ secrets.TOOLS_SA_TOKEN }} --server=https://api.silver.devops.gov.bc.ca:6443

# Clean the database build/deployment artifacts
- name: Clean Database Artifacts
working-directory: "./database/.pipeline/"
run: |
npm install --only=production
DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=build
DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=dev
# Clean the api deployment artifacts
- name: Clean API Deployment
working-directory: "./api/.pipeline/"
run: |
npm ci
DEBUG=* npm run clean -- --pr=$BUILD_ID --env=build
DEBUG=* npm run clean -- --pr=$BUILD_ID --env=dev
npm install --only=production
DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=build
DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=dev
# Clean the app deployment artifacts
- name: Clean APP Deployment
working-directory: "./app/.pipeline/"
run: |
npm install
# npm ci
DEBUG=* npm run clean -- --pr=$BUILD_ID --env=build
DEBUG=* npm run clean -- --pr=$BUILD_ID --env=dev
npm install --only=production
DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=build
DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=dev
# Clean the reamaining build/deployment artifacts
- name: Clean remaining Artifacts
run: |
oc project af2668-dev
oc get all,pvc,secret,pods,ReplicationController,DeploymentConfig,HorizontalPodAutoscaler,imagestreamtag -o name | grep biohubbc | grep $BUILD_ID | awk '{print "oc delete " $1}' | bash
oc get all,pvc,secret,pods,ReplicationController,DeploymentConfig,HorizontalPodAutoscaler,imagestreamtag -o name | grep biohubbc | grep $PR_NUMBER | awk '{print "oc delete " $1}' | bash
oc project af2668-tools
oc get all,pvc,secret,pods,ReplicationController,DeploymentConfig,HorizontalPodAutoscaler,imagestreamtag -o name | grep biohubbc | grep $BUILD_ID | awk '{print "oc delete " $1}' | bash
oc get all,pvc,secret,pods,ReplicationController,DeploymentConfig,HorizontalPodAutoscaler,imagestreamtag -o name | grep biohubbc | grep $PR_NUMBER | awk '{print "oc delete " $1}' | bash
Loading

0 comments on commit f1e28b7

Please sign in to comment.