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

SIMSBIOHUB-540/528: Pipeline Enhancements #1204

Draft
wants to merge 70 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
0ef387f
Pipeline enhancements 2
NickPhura Jan 25, 2024
bb21ad6
Fix merge issues
NickPhura Jan 25, 2024
2f2e852
Fix --env deploy.yaml setting
NickPhura Jan 25, 2024
7afb9b0
Debugging
NickPhura Jan 25, 2024
f6be3c0
Fixes
NickPhura Jan 25, 2024
c740af8
Fix api build config
NickPhura Jan 25, 2024
f94446d
Add missing nodeEnv
NickPhura Jan 25, 2024
8bffc86
Updates
NickPhura Jan 27, 2024
b72f7f8
Fix configmap zod schema
NickPhura Jan 27, 2024
62b5f0f
ignore-skip
NickPhura Jan 27, 2024
df40f96
Change biohubbc to sims
NickPhura Jan 27, 2024
6d16720
Updates
NickPhura Jan 27, 2024
1074051
Add configmap
NickPhura Jan 27, 2024
5423351
Fixes
NickPhura Jan 27, 2024
d9ecf81
Fixes
NickPhura Jan 27, 2024
077b54c
Fixes
NickPhura Jan 27, 2024
7bb9932
ignore-skip
NickPhura Jan 27, 2024
ee6593e
Updates
NickPhura Jan 27, 2024
f1b3a36
ignore-skip
NickPhura Jan 27, 2024
75be2ff
Fix bad log
NickPhura Jan 27, 2024
4a8ac9b
Fix secret name
NickPhura Jan 27, 2024
0cb233f
Updates
NickPhura Jan 27, 2024
440424c
Tweaks
NickPhura Jan 27, 2024
b0fd43c
Minor tweaks, cleanup. ignore-skip
NickPhura Feb 5, 2024
b708afb
Remove old pipelien files
NickPhura Feb 5, 2024
8502e7d
Test lazy require. ignore-skip
NickPhura Feb 5, 2024
57546f2
Remove zod schema
NickPhura Feb 5, 2024
eead043
ignore-skip
NickPhura Feb 5, 2024
3ce01a2
Merge remote-tracking branch 'origin/dev' into pipeline-enhancements-2
NickPhura Feb 5, 2024
7bc3b4a
ignore-skip
NickPhura Feb 5, 2024
cd7f581
Fix type (ignore-skip)
NickPhura Feb 5, 2024
3e8f838
Merge remote-tracking branch 'origin/dev' into pipeline-enhancements-2
NickPhura Feb 24, 2024
bb51e1b
ignore-skip
NickPhura Feb 24, 2024
242ec88
Update database seed pipeline config settings. ignore-skip
NickPhura Feb 24, 2024
f9735c7
Update seed default value
NickPhura Feb 24, 2024
855edaf
Fix db setup yaml
NickPhura Feb 24, 2024
f4aca5c
Merge remote-tracking branch 'origin/dev' into pipeline-enhancements-2
NickPhura Mar 11, 2024
f170c15
Tweak node options
NickPhura Mar 11, 2024
b4bcac0
Remove logging
NickPhura Mar 11, 2024
22f84f1
Merge remote-tracking branch 'origin/dev' into pipeline-enhancements-2
NickPhura Mar 13, 2024
b9bb0ca
Revert sims to biohubbc to reduce possible conflicts
NickPhura Mar 14, 2024
0605d14
Revert more sims to biohubbc
NickPhura Mar 14, 2024
575cf4a
Update values ignore-skip
NickPhura Mar 14, 2024
d0232b9
Update config env ignore-skip
NickPhura Mar 14, 2024
e1d9831
Updates ignore-skip
NickPhura Mar 14, 2024
6429444
Add logging when in PR phase
NickPhura Mar 14, 2024
618c30d
tweak
NickPhura Mar 14, 2024
ba966a8
move logging
NickPhura Mar 14, 2024
eb16571
Tweaks
NickPhura Mar 14, 2024
dce8a82
Fix log issue
NickPhura Mar 14, 2024
57ee728
Updates
NickPhura Mar 14, 2024
f6664ed
Fix api loglevel env var
NickPhura Mar 15, 2024
47fedd2
Merge branch 'dev' into pipeline-enhancements-2
NickPhura Mar 15, 2024
0de35be
Minor cleanup
NickPhura Mar 15, 2024
f196e9f
More misc doc
NickPhura Mar 15, 2024
ed8b75d
Update
NickPhura Mar 15, 2024
397840c
Merge branch 'dev' into pipeline-enhancements-2
NickPhura Mar 18, 2024
99bfaad
Update env var names
NickPhura Mar 18, 2024
fa2c414
ignore-skip
NickPhura Mar 18, 2024
4ec9e8b
Minor cleanup. ignore-skip
NickPhura Mar 18, 2024
c7ef338
Fix typo
NickPhura Mar 18, 2024
4d564c0
Merge branch 'dev' into pipeline-enhancements-2
NickPhura Mar 18, 2024
bdd2b7b
Add more env vars to pipeline, rename some env vars.
NickPhura Mar 18, 2024
1a95f77
Add missing env vars to deploy yaml
NickPhura Mar 18, 2024
7383f78
ignore-skip
NickPhura Mar 18, 2024
4eff567
Update database env vars
NickPhura Mar 18, 2024
da7620f
Fixes
NickPhura Mar 18, 2024
fff534d
Fix db_name
NickPhura Mar 19, 2024
40aecf8
Merge remote-tracking branch 'origin/dev' into pipeline-enhancements-2
NickPhura Mar 21, 2024
59e7113
Updates
NickPhura Mar 22, 2024
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
3 changes: 0 additions & 3 deletions .config/README.md

This file was deleted.

89 changes: 0 additions & 89 deletions .config/config.json

This file was deleted.

12 changes: 6 additions & 6 deletions .github/workflows/cleanClosedPR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,24 @@ jobs:
working-directory: "app/.pipeline/"
run: |
npm ci
DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=build
DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=dev
DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=pr --phase=build
DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=pr --phase=pr

# Clean the database build/deployment artifacts
- name: Clean Database Artifacts
working-directory: "database/.pipeline/"
run: |
npm ci
DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=build
DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=dev
DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=pr --phase=build
DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=pr --phase=pr

# Clean the api deployment artifacts
- name: Clean API Deployment
working-directory: "api/.pipeline/"
run: |
npm ci
DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=build
DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=dev
DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=pr --phase=build
DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=pr --phase=pr

# Clean the reamaining build/deployment artifacts
- name: Clean remaining Artifacts
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/cleanMergedPR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,23 @@ jobs:
run: |
npm ci
DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=build
DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=dev
DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=pr

# Clean the database build/deployment artifacts
- name: Clean Database Artifacts
working-directory: "database/.pipeline/"
run: |
npm ci
DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=build
DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=dev
DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=pr

# Clean the api deployment artifacts
- name: Clean API Deployment
working-directory: "api/.pipeline/"
run: |
npm ci
DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=build
DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=dev
DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=pr

# Clean the reamaining build/deployment artifacts
- name: Clean remaining Artifacts
Expand Down
63 changes: 54 additions & 9 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ jobs:
# Set to `true` if the latest commit message contains `ignore-skip` anywhere in the message OR the base branch
# is dev, test, or prod.
# Used to disable duplicate action skipping, if needed.
ignore_skip: ${{ contains(steps.head_commit_message.outputs.commit_message, 'ignore-skip') ||
ignore_skip:
${{ contains(steps.head_commit_message.outputs.commit_message, 'ignore-skip') ||
github.head_ref == 'dev' || github.head_ref == 'test' || github.head_ref == 'prod' }}
steps:
- id: skip_check
Expand Down Expand Up @@ -129,6 +130,29 @@ jobs:
with:
node-version: 14

# Fetch the pipeline config map from Openshift
getPipelineConfigMap:
name: Get Pipeline Config
runs-on: ubuntu-latest
timeout-minutes: 20
if: ${{ github.event.pull_request.merged == false }}
env:
PR_NUMBER: ${{ github.event.number }}
outputs:
pipeline_config: ${{ steps.get_config.outputs.pipeline_config }}
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

# Fetch config map named 'sims-pipeline-config' from the tools environment and store in 'pipeline_config' variable for use by subsequent jobs
- name: Fetch pipeline config map
id: "get_config"
run: |
echo "pipeline_config=$( oc -n af2668-tools get configmap sims-pipeline-config -o jsonpath={.data.config} | jq -c )" >> "$GITHUB_OUTPUT"

# Build the web frontend app image
buildAPP:
name: Build APP Image
Expand All @@ -142,9 +166,11 @@ jobs:
env:
PR_NUMBER: ${{ github.event.number }}
APP_NAME: "biohubbc-app"
PIPELINE_CONFIG: ${{ needs.getPipelineConfigMap.outputs.pipeline_config }}
needs:
- checkoutRepo
- skipDuplicateActions
- getPipelineConfigMap
steps:
# Install Node - for `node` and `npm` commands
- name: Setup Node.js
Expand Down Expand Up @@ -189,7 +215,7 @@ jobs:
- name: Build APP Image
working-directory: app/.pipeline/
run: |
DEBUG=* npm run build -- --pr=$PR_NUMBER
DEBUG=* npm run build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=pr --phase=build

# Build the Database image
buildDatabase:
Expand All @@ -204,9 +230,11 @@ jobs:
env:
PR_NUMBER: ${{ github.event.number }}
APP_NAME: "biohubbc-db"
PIPELINE_CONFIG: ${{ needs.getPipelineConfigMap.outputs.pipeline_config }}
needs:
- checkoutRepo
- skipDuplicateActions
- getPipelineConfigMap
steps:
# Install Node - for `node` and `npm` commands
- name: Setup Node.js
Expand Down Expand Up @@ -251,7 +279,7 @@ jobs:
- name: Build Database Image
working-directory: database/.pipeline/
run: |
DEBUG=* npm run db:build -- --pr=$PR_NUMBER
DEBUG=* npm run db:build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=pr --phase=build

# Build the Database Setup image
buildDatabaseSetup:
Expand All @@ -265,9 +293,11 @@ jobs:
fromJSON(needs.skipDuplicateActions.outputs.paths_result).database.skipped_by.branch != github.head_ref ) }}
env:
PR_NUMBER: ${{ github.event.number }}
PIPELINE_CONFIG: ${{ needs.getPipelineConfigMap.outputs.pipeline_config }}
needs:
- checkoutRepo
- skipDuplicateActions
- getPipelineConfigMap
steps:
# Install Node - for `node` and `npm` commands
- name: Setup Node.js
Expand Down Expand Up @@ -306,7 +336,7 @@ jobs:
- name: Build Database Setup Image
working-directory: database/.pipeline/
run: |
DEBUG=* npm run db-setup:build -- --pr=$PR_NUMBER
DEBUG=* npm run db-setup:build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=pr --phase=build

# Build the API image
buildAPI:
Expand All @@ -321,9 +351,11 @@ jobs:
env:
PR_NUMBER: ${{ github.event.number }}
APP_NAME: "biohubbc-api"
PIPELINE_CONFIG: ${{ needs.getPipelineConfigMap.outputs.pipeline_config }}
needs:
- checkoutRepo
- skipDuplicateActions
- getPipelineConfigMap
steps:
# Install Node - for `node` and `npm` commands
- name: Setup Node.js
Expand Down Expand Up @@ -368,7 +400,7 @@ jobs:
- name: Build API Image
working-directory: api/.pipeline/
run: |
DEBUG=* npm run build -- --pr=$PR_NUMBER
DEBUG=* npm run build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=pr --phase=build

# Deploy APP image
deployAPP:
Expand All @@ -382,7 +414,10 @@ jobs:
fromJSON(needs.skipDuplicateActions.outputs.paths_result).app.skipped_by.branch != github.head_ref ) }}
env:
PR_NUMBER: ${{ github.event.number }}
PIPELINE_CONFIG: ${{ needs.getPipelineConfigMap.outputs.pipeline_config }}
needs:
- skipDuplicateActions
- getPipelineConfigMap
- buildAPP
steps:
# Install Node - for `node` and `npm` commands
Expand Down Expand Up @@ -422,7 +457,7 @@ jobs:
- name: Deploy APP Image
working-directory: app/.pipeline
run: |
DEBUG=* npm run deploy -- --pr=$PR_NUMBER --env=dev
DEBUG=* npm run deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=pr --phase=deploy

# Deploy Database image
deployDatabase:
Expand All @@ -436,7 +471,10 @@ jobs:
fromJSON(needs.skipDuplicateActions.outputs.paths_result).database.skipped_by.branch != github.head_ref ) }}
env:
PR_NUMBER: ${{ github.event.number }}
PIPELINE_CONFIG: ${{ needs.getPipelineConfigMap.outputs.pipeline_config }}
needs:
- skipDuplicateActions
- getPipelineConfigMap
- buildDatabase
steps:
# Install Node - for `node` and `npm` commands
Expand Down Expand Up @@ -476,7 +514,7 @@ jobs:
- name: Deploy Database Image
working-directory: database/.pipeline/
run: |
DEBUG=* npm run db:deploy -- --pr=$PR_NUMBER --env=dev
DEBUG=* npm run db:deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=pr --phase=deploy

# Deploy Database image
deployDatabaseSetup:
Expand All @@ -490,7 +528,10 @@ jobs:
fromJSON(needs.skipDuplicateActions.outputs.paths_result).database.skipped_by.branch != github.head_ref ) }}
env:
PR_NUMBER: ${{ github.event.number }}
PIPELINE_CONFIG: ${{ needs.getPipelineConfigMap.outputs.pipeline_config }}
needs:
- skipDuplicateActions
- getPipelineConfigMap
- buildDatabaseSetup
- deployDatabase
steps:
Expand Down Expand Up @@ -531,7 +572,7 @@ jobs:
- name: Deploy Database Setup Image
working-directory: database/.pipeline/
run: |
DEBUG=* npm run db-setup:deploy -- --pr=$PR_NUMBER --env=dev
DEBUG=* npm run db-setup:deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=pr --phase=deploy

# Deploy API image
deployAPI:
Expand All @@ -547,7 +588,10 @@ jobs:
fromJSON(needs.skipDuplicateActions.outputs.paths_result).api.skipped_by.branch != github.head_ref ) }}
env:
PR_NUMBER: ${{ github.event.number }}
PIPELINE_CONFIG: ${{ needs.getPipelineConfigMap.outputs.pipeline_config }}
needs:
- skipDuplicateActions
- getPipelineConfigMap
- buildAPI
- deployDatabase
steps:
Expand Down Expand Up @@ -588,7 +632,7 @@ jobs:
- name: Deploy API Image
working-directory: api/.pipeline/
run: |
DEBUG=* npm run deploy -- --pr=$PR_NUMBER --env=dev
DEBUG=* npm run deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=pr --phase=deploy

# Report the overall status of all jobs.
# Why? Skipped jobs are not considered successes when specifying requird jobs in the GitHub PR settings. Rather than
Expand All @@ -605,6 +649,7 @@ jobs:
- checkEnv
- skipDuplicateActions
- checkoutRepo
- getPipelineConfigMap
- buildAPP
- buildDatabase
- buildDatabaseSetup
Expand Down
Loading
Loading