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

BHBC-2130: Merge Dev to Test #914

Merged
merged 10 commits into from
Jan 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
36 changes: 27 additions & 9 deletions .config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,37 @@
},
"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-4466",
"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-4466",
"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-4466",
"apiHost": "https://api.loginproxy.gov.bc.ca/api/v1",
"keycloakSecret": "keycloak-admin-password",
"keycloakSecretAdminPassword": "keycloak_admin_password"
}
}
}
45 changes: 26 additions & 19 deletions .github/workflows/cleanClosedPR.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 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:
Expand All @@ -14,32 +14,32 @@ 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
# 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 @@ -49,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