Skip to content

Commit

Permalink
Dev ops scale schemaspy up and down (#709)
Browse files Browse the repository at this point in the history
* Scale SchemaSpy as part of the pipeline to make sure it is current all the time

* Make it a one step SchemaSpy cycle

* Formatting

* Fix typo
  • Loading branch information
rstens authored Feb 10, 2022
1 parent e6baf51 commit 77d5cf4
Showing 1 changed file with 30 additions and 8 deletions.
38 changes: 30 additions & 8 deletions .github/workflows/deployStatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -516,19 +516,41 @@ jobs:
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
cycleschemaspy:
name: Cycle SchemaSpy to refresh after database update in dev
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.merged == true && github.event.pull_request.draft == false && github.base_ref == 'dev' }}
env:
BUILD_ID: ${{ github.event.number }}
needs:
- checkEnv
- deployDatabaseSetup
steps:
# 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

- name: Scale down
run: |
oc project af2668-dev
oc scale --replicas=0 dc schemaspy
oc scale --replicas=1 dc schemaspy
cypress-run:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.merged == true && github.event.pull_request.draft == false && github.base_ref != 'prod' }}
env:
CYPRESS_RECORD_KEY: ${{ secrets.RECORDING_KEY }}
CYPRESS_username: ${{ secrets.CYPRESS_USER_NAME }}
CYPRESS_password: ${{ secrets.CYPRESS_PASSWORD }}
CYPRESS_BASE_URL: 'https://${{ github.base_ref }}-biohubbc.apps.silver.devops.gov.bc.ca'
CYPRESS_host: 'https://${{ github.base_ref }}-biohubbc.apps.silver.devops.gov.bc.ca'
CYPRESS_BASE_URL: "https://${{ github.base_ref }}-biohubbc.apps.silver.devops.gov.bc.ca"
CYPRESS_host: "https://${{ github.base_ref }}-biohubbc.apps.silver.devops.gov.bc.ca"
CYPRESS_ENVIRONMENT: ${{ github.base_ref }}
CYPRESS_authRealm: '35r1iman'
CYPRESS_authClientId: 'biohubbc'
CYPRESS_authUrl: 'https://${{ github.base_ref }}.oidc.gov.bc.ca'
CYPRESS_authRealm: "35r1iman"
CYPRESS_authClientId: "biohubbc"
CYPRESS_authUrl: "https://${{ github.base_ref }}.oidc.gov.bc.ca"
needs:
- deployDatabase
- deployDatabaseSetup
Expand All @@ -542,15 +564,15 @@ jobs:
- name: Wait for API response
uses: nev7n/[email protected]
with:
url: 'https://api-${{ github.base_ref }}-biohubbc.apps.silver.devops.gov.bc.ca/version'
url: "https://api-${{ github.base_ref }}-biohubbc.apps.silver.devops.gov.bc.ca/version"
responseCode: 200
timeout: 240000
interval: 500

- name: Wait for APP response
uses: nev7n/[email protected]
with:
url: 'https://${{ github.base_ref }}-biohubbc.apps.silver.devops.gov.bc.ca'
url: "https://${{ github.base_ref }}-biohubbc.apps.silver.devops.gov.bc.ca"
responseCode: 200
timeout: 240000
interval: 500
Expand All @@ -562,7 +584,7 @@ jobs:
id: smoke
continue-on-error: false
with:
wait-on: 'https://${{ github.base_ref }}-biohubbc.apps.silver.devops.gov.bc.ca'
wait-on: "https://${{ github.base_ref }}-biohubbc.apps.silver.devops.gov.bc.ca"
wait-on-timeout: 240
record: true
working-directory: testing/e2e
Expand Down

0 comments on commit 77d5cf4

Please sign in to comment.