Skip to content

Commit

Permalink
Merge pull request #1010 from bcgov/dev
Browse files Browse the repository at this point in the history
BHBC-2254: Promote Dev to Test
  • Loading branch information
curtisupshall authored Apr 25, 2023
2 parents 55c37bc + 21374b7 commit e79e0bd
Show file tree
Hide file tree
Showing 398 changed files with 23,950 additions and 27,444 deletions.
5 changes: 0 additions & 5 deletions .config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@
"test": "api-test-biohubbc.apps.silver.devops.gov.bc.ca",
"prod": "api-biohubbc.apps.silver.devops.gov.bc.ca"
},
"staticUrlsN8N": {
"dev": "n8n-af2668-dev.apps.silver.devops.gov.bc.ca",
"test": "n8n-af2668-test.apps.silver.devops.gov.bc.ca",
"prod": "n8n-af2668-prod.apps.silver.devops.gov.bc.ca"
},
"siteminderLogoutURL": {
"dev": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi",
"test": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi",
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/addComments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
addOpenshiftURLComment:
name: Add Openshift URL Comment
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Add Comment
uses: peter-evans/create-or-update-comment@v2
Expand Down
72 changes: 36 additions & 36 deletions .github/workflows/cleanClosedPR.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# 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.
# Will attempt to remove all artifacts from any PR that was opened against any branch (and then closed (not merged)), except for test and prod.
name: Clean Closed PR Artifacts

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

jobs:
Expand All @@ -19,64 +19,64 @@ jobs:
env:
PR_NUMBER: ${{ github.event.number }}
steps:
# Checkout the PR branch
- name: Checkout Dev Branch - Contains the Pipeline Code
uses: actions/checkout@v3
with:
ref: "dev"

# Install Node - for `node` and `npm` commands
# Note: This already uses actions/cache internally, so repeat calls in subsequent jobs are not a performance hit
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 14

# Cache Node modules
- name: Cache node modules
# Load repo from cache
- name: Cache repo
uses: actions/cache@v3
id: cache-repo
env:
cache-name: cache-node-modules
cache-name: cache-repo
with:
path: ${{ github.workspace }}/*
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }}

# Checkout the branch if not restored via cache
- name: Checkout Target Branch
if: steps.cache-repo.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/.pipeline/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
persist-credentials: false

# Log in to OpenShift.
# Note: The secrets needed to log in are NOT available if the PR comes from a FORK.
# PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail.
- 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/"
# Clean the app deployment artifacts
- name: Clean APP Deployment
working-directory: "app/.pipeline/"
run: |
npm install --only=production
npm ci
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/"
# Clean the database build/deployment artifacts
- name: Clean Database Artifacts
working-directory: "database/.pipeline/"
run: |
npm install --only=production
npm ci
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/"
# Clean the api deployment artifacts
- name: Clean API Deployment
working-directory: "api/.pipeline/"
run: |
npm install --only=production
npm ci
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
env:
POD_SELECTOR: biohubbc
run: |
oc project af2668-dev
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 $PR_NUMBER | awk '{print "oc delete " $1}' | bash
oc --namespace af2668-dev get all,pvc,secret,pods,ReplicationController,DeploymentConfig,HorizontalPodAutoscaler,imagestreamtag -o name | grep $POD_SELECTOR | grep $PR_NUMBER | awk '{print "oc delete --ignore-not-found" $1}' | bash
oc --namespace af2668-tools get all,pvc,secret,pods,ReplicationController,DeploymentConfig,HorizontalPodAutoscaler,imagestreamtag -o name | grep $POD_SELECTOR | grep $PR_NUMBER | awk '{print "oc delete --ignore-not-found" $1}' | bash
Loading

0 comments on commit e79e0bd

Please sign in to comment.