From 0ef387f3b7da974edf18ffd749d5889d6b9973c5 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Wed, 24 Jan 2024 22:05:18 -0800 Subject: [PATCH 01/62] Pipeline enhancements 2 --- .config/README.md | 3 - .config/config.json | 89 ---- .github/workflows/cleanClosedPR.yml | 12 +- .github/workflows/cleanMergedPR.yml | 12 +- .github/workflows/deploy.yml | 63 ++- .github/workflows/deployStatic.yml | 20 +- .pipeline/README.md | 17 + .pipeline/templates/sims-configmap.json | 265 ++++++++++ .pipeline/templates/sims.configmap.yaml | 236 +++++++++ api/.pipeline/config.js | 291 +++++++---- api/.pipeline/lib/api.build.js | 8 +- api/.pipeline/package-lock.json | 5 + api/.pipeline/package.json | 3 +- api/.pipeline/utils/configMapSchema.js | 271 ++++++++++ api/.pipeline2/templates/api.bc.yaml | 114 +++++ api/.pipeline2/templates/api.dc.yaml | 483 ++++++++++++++++++ api/.pipeline2/templates/db.secret.yaml | 13 + .../templates/object-store.secret.yaml | 10 + app/.pipeline/config.js | 228 ++++++--- app/.pipeline/lib/app.build.js | 10 +- app/.pipeline/package-lock.json | 5 + app/.pipeline/package.json | 3 +- app/.pipeline/scripts/app.build.js | 3 +- app/.pipeline/utils/configMapSchema.js | 271 ++++++++++ app/.pipeline2/templates/app.bc.yaml | 119 +++++ app/.pipeline2/templates/app.dc.yaml | 263 ++++++++++ .../templates/github-webhook.secret.yaml | 8 + database/.pipeline/config.js | 165 ++++-- database/.pipeline/lib/db.build.js | 10 +- database/.pipeline/lib/db.setup.build.js | 6 +- database/.pipeline/package-lock.json | 5 + database/.pipeline/package.json | 3 +- database/.pipeline/scripts/db.setup.build.js | 2 +- database/.pipeline/utils/configMapSchema.js | 271 ++++++++++ database/.pipeline/utils/utils.js | 1 + database/.pipeline2/templates/db.bc.yaml | 37 ++ database/.pipeline2/templates/db.dc.yaml | 251 +++++++++ .../.pipeline2/templates/db.setup.bc.yaml | 120 +++++ .../.pipeline2/templates/db.setup.dc.yaml | 104 ++++ .../.pipeline2/templates/db.setup.is.yaml | 18 + 40 files changed, 3420 insertions(+), 398 deletions(-) delete mode 100644 .config/README.md delete mode 100644 .config/config.json create mode 100644 .pipeline/README.md create mode 100644 .pipeline/templates/sims-configmap.json create mode 100644 .pipeline/templates/sims.configmap.yaml create mode 100644 api/.pipeline/utils/configMapSchema.js create mode 100644 api/.pipeline2/templates/api.bc.yaml create mode 100644 api/.pipeline2/templates/api.dc.yaml create mode 100644 api/.pipeline2/templates/db.secret.yaml create mode 100644 api/.pipeline2/templates/object-store.secret.yaml create mode 100644 app/.pipeline/utils/configMapSchema.js create mode 100644 app/.pipeline2/templates/app.bc.yaml create mode 100644 app/.pipeline2/templates/app.dc.yaml create mode 100644 app/.pipeline2/templates/github-webhook.secret.yaml create mode 100644 database/.pipeline/utils/configMapSchema.js create mode 100644 database/.pipeline2/templates/db.bc.yaml create mode 100644 database/.pipeline2/templates/db.dc.yaml create mode 100644 database/.pipeline2/templates/db.setup.bc.yaml create mode 100644 database/.pipeline2/templates/db.setup.dc.yaml create mode 100644 database/.pipeline2/templates/db.setup.is.yaml diff --git a/.config/README.md b/.config/README.md deleted file mode 100644 index 0183c517b4..0000000000 --- a/.config/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Configuration - -Overall configuration for the solution, used in our GitHub Actions Pipeline diff --git a/.config/config.json b/.config/config.json deleted file mode 100644 index 035648c7a3..0000000000 --- a/.config/config.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "name": "biohubbc", - "namespaceSuffix": "af2668", - "namespace": { - "tools": "tools", - "dev": "dev", - "test": "test", - "prod": "prod" - }, - "version": "1.0.0", - "timezone": { - "db": "America/Vancouver", - "api": "America/Vancouver" - }, - "module": { - "db": "biohubbc-db", - "api": "biohubbc-api", - "app": "biohubbc-app" - }, - "staticUrls": { - "dev": "dev-biohubbc.apps.silver.devops.gov.bc.ca", - "test": "test-biohubbc.apps.silver.devops.gov.bc.ca", - "prod": "biohubbc.apps.silver.devops.gov.bc.ca", - "prodVanityUrl": "sims.nrs.gov.bc.ca" - }, - "staticUrlsAPI": { - "dev": "api-dev-biohubbc.apps.silver.devops.gov.bc.ca", - "test": "api-test-biohubbc.apps.silver.devops.gov.bc.ca", - "prod": "api-biohubbc.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", - "prod": "https://logon7.gov.bc.ca/clp-cgi/logoff.cgi" - }, - "sso": { - "dev": { - "host": "https://dev.loginproxy.gov.bc.ca/auth", - "realm": "standard", - "clientId": "sims-4461", - "keycloakSecret": "keycloak", - "serviceClient": { - "serviceClientName": "sims-svc-4464", - "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" - }, - "cssApi": { - "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", - "cssApiClientId": "service-account-team-1190-4229", - "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", - "keycloakSecretCssApiSecretKey": "css_api_client_secret", - "cssApiEnvironment": "dev" - } - }, - "test": { - "host": "https://test.loginproxy.gov.bc.ca/auth", - "realm": "standard", - "clientId": "sims-4461", - "keycloakSecret": "keycloak", - "serviceClient": { - "serviceClientName": "sims-svc-4464", - "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" - }, - "cssApi": { - "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", - "cssApiClientId": "service-account-team-1190-4229", - "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", - "keycloakSecretCssApiSecretKey": "css_api_client_secret", - "cssApiEnvironment": "test" - } - }, - "prod": { - "host": "https://loginproxy.gov.bc.ca/auth", - "realm": "standard", - "clientId": "sims-4461", - "keycloakSecret": "keycloak", - "serviceClient": { - "serviceClientName": "sims-svc-4464", - "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" - }, - "cssApi": { - "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", - "cssApiClientId": "service-account-team-1190-4229", - "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", - "keycloakSecretCssApiSecretKey": "css_api_client_secret", - "cssApiEnvironment": "prod" - } - } - } -} diff --git a/.github/workflows/cleanClosedPR.yml b/.github/workflows/cleanClosedPR.yml index dd49ecd25d..f716dc3a8d 100644 --- a/.github/workflows/cleanClosedPR.yml +++ b/.github/workflows/cleanClosedPR.yml @@ -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 --phase=build + DEBUG=* npm run clean -- --pr=$PR_NUMBER --phase=dev # 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 --phase=build + DEBUG=* npm run clean -- --pr=$PR_NUMBER --phase=dev # 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 --phase=build + DEBUG=* npm run clean -- --pr=$PR_NUMBER --phase=dev # Clean the reamaining build/deployment artifacts - name: Clean remaining Artifacts diff --git a/.github/workflows/cleanMergedPR.yml b/.github/workflows/cleanMergedPR.yml index 680c34c0b3..19a8a85462 100644 --- a/.github/workflows/cleanMergedPR.yml +++ b/.github/workflows/cleanMergedPR.yml @@ -55,24 +55,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 --phase=build + DEBUG=* npm run clean -- --pr=$PR_NUMBER --phase=dev # 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 --phase=build + DEBUG=* npm run clean -- --pr=$PR_NUMBER --phase=dev # 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 --phase=build + DEBUG=* npm run clean -- --pr=$PR_NUMBER --phase=dev # Clean the reamaining build/deployment artifacts - name: Clean remaining Artifacts diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d7133f990e..675304e2c7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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 @@ -130,6 +131,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 and store in pipeline_config for use by subsequent jobs + - name: Fetch pipeline config map + id: "get_config" + run: | + echo "pipeline_config=$( oc get configmap sims-pipeline-config -o jsonpath={.data.config} | jq -c )" >> "$GITHUB_OUTPUT" + # Build the web frontend app image buildAPP: name: Build APP Image @@ -143,9 +167,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 @@ -190,7 +216,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 # Build the Database image buildDatabase: @@ -205,9 +231,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 @@ -252,7 +280,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 # Build the Database Setup image buildDatabaseSetup: @@ -266,9 +294,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 @@ -307,7 +337,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 # Build the API image buildAPI: @@ -322,9 +352,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 @@ -369,7 +401,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 # Deploy APP image deployAPP: @@ -383,7 +415,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 @@ -423,7 +458,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 --phase=pr # Deploy Database image deployDatabase: @@ -437,7 +472,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 @@ -477,7 +515,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 --phase=pr # Deploy Database image deployDatabaseSetup: @@ -491,7 +529,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: @@ -532,7 +573,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 --phase=pr # Deploy API image deployAPI: @@ -548,7 +589,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: @@ -589,7 +633,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 --phase=pr # 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 @@ -606,6 +650,7 @@ jobs: - checkEnv - skipDuplicateActions - checkoutRepo + - getPipelineConfigMap - buildAPP - buildDatabase - buildDatabaseSetup diff --git a/.github/workflows/deployStatic.yml b/.github/workflows/deployStatic.yml index 16cce447ba..fec94b4f60 100644 --- a/.github/workflows/deployStatic.yml +++ b/.github/workflows/deployStatic.yml @@ -334,7 +334,7 @@ jobs: - name: Deploy APP Image working-directory: "app/.pipeline" run: | - DEBUG=* npm run deploy -- --pr=$PR_NUMBER --env=$BRANCH --branch=$BRANCH --type=static + DEBUG=* npm run deploy -- --pr=$PR_NUMBER --phase=$BRANCH --branch=$BRANCH --type=static # Deploy Database image deployDatabase: @@ -385,7 +385,7 @@ jobs: - name: Deploy Database Image working-directory: "database/.pipeline/" run: | - DEBUG=* npm run db:deploy -- --pr=$PR_NUMBER --env=$BRANCH --branch=$BRANCH --type=static + DEBUG=* npm run db:deploy -- --pr=$PR_NUMBER --phase=$BRANCH --branch=$BRANCH --type=static # Deploy Database setup image deployDatabaseSetup: @@ -437,7 +437,7 @@ jobs: - name: Deploy Database Setup Image working-directory: "database/.pipeline/" run: | - DEBUG=* npm run db-setup:deploy -- --pr=$PR_NUMBER --env=$BRANCH --branch=$BRANCH --type=static + DEBUG=* npm run db-setup:deploy -- --pr=$PR_NUMBER --phase=$BRANCH --branch=$BRANCH --type=static # Deploy API image deployAPI: @@ -489,7 +489,7 @@ jobs: - name: Deploy API Image working-directory: "api/.pipeline/" run: | - DEBUG=* npm run deploy -- --pr=$PR_NUMBER --env=$BRANCH --branch=$BRANCH --type=static + DEBUG=* npm run deploy -- --pr=$PR_NUMBER --phase=$BRANCH --branch=$BRANCH --type=static # Clean build/deployment artifacts clean: @@ -538,24 +538,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 --phase=build + DEBUG=* npm run clean -- --pr=$PR_NUMBER --phase=dev # 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 --phase=build + DEBUG=* npm run clean -- --pr=$PR_NUMBER --phase=dev # 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 --phase=build + DEBUG=* npm run clean -- --pr=$PR_NUMBER --phase=dev # Clean the reamaining build/deployment artifacts - name: Clean remaining Artifacts diff --git a/.pipeline/README.md b/.pipeline/README.md new file mode 100644 index 0000000000..a7364ccb5f --- /dev/null +++ b/.pipeline/README.md @@ -0,0 +1,17 @@ +# Openshift Config Map + +`sims-pipeline-config.json` is a sample of the config map that should be created in each openshift environment. + +It is not guaranteed to contain the correct values. + +The config map is validated at build time against the `PipelineConfigMapSchema` zod schema, which should always be kept up to date. See `configMapSchema.js` in each of the api, app, and database `/.pipeline` folders. + +**Note: This config map should never contain secrets, passwords, or other sensitive values. Those should always be stored in Openshift secrets.** + +## Create Config Map in Openshift + +Under `Workloads` -> `ConfigMaps` + +- **name:** `sims-pipeline-config` + - **key:** `config` + - **value:** A JSON object containing the config map settings. diff --git a/.pipeline/templates/sims-configmap.json b/.pipeline/templates/sims-configmap.json new file mode 100644 index 0000000000..4d92ae2fcf --- /dev/null +++ b/.pipeline/templates/sims-configmap.json @@ -0,0 +1,265 @@ +{ + "name": "sims", + "namespaceSuffix": "af2668", + "namespace": { + "tools": "tools", + "dev": "dev", + "test": "test", + "prod": "prod" + }, + "version": "1.0.0", + "module": { + "db": "sims-db", + "api": "sims-api", + "app": "sims-app" + }, + "api": { + "build": { + "tz": "America/Vancouver", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "3Gi" + }, + "deploy": { + "dev": { + "staticApiUrl": "api-dev-sims.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "dev-sims.apps.silver.devops.gov.bc.ca", + "tz": "America/Vancouver", + "backboneApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", + "backboneIntakePath": "/api/dwc/submission/queue", + "backboneArtifactIntakePath": "/api/artifact/intake", + "backboneIntakeEnabled": false, + "bctwApiHost": "https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca", + "critterbaseApiHost": "https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api", + "elasticsearchURL": "http://es01.a0ec71-dev:9200", + "elasticsearchTaxonomyIndex": "taxonomy_3.0.0", + "s3KeyPrefix": "sims", + "logLevel": "debug", + "cpuRequest": "50m", + "cpuLimit": "400m", + "memoryRequest": "100Mi", + "memoryLimit": "2Gi", + "replicas": "1", + "replicasMax": "2" + }, + "test": { + "staticApiUrl": "api-test-sims.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "test-sims.apps.silver.devops.gov.bc.ca", + "tz": "America/Vancouver", + "backboneApiHost": "https://api-test-biohub-platform.apps.silver.devops.gov.bc.ca", + "backboneIntakePath": "/api/dwc/submission/queue", + "backboneArtifactIntakePath": "/api/artifact/intake", + "backboneIntakeEnabled": false, + "bctwApiHost": "https://moe-bctw-api-test.apps.silver.devops.gov.bc.ca", + "critterbaseApiHost": "https://moe-critterbase-api-test.apps.silver.devops.gov.bc.ca/api", + "elasticsearchURL": "http://es01.a0ec71-dev:9200", + "elasticsearchTaxonomyIndex": "taxonomy_3.0.0", + "s3KeyPrefix": "sims", + "logLevel": "info", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "3Gi", + "replicas": "2", + "replicasMax": "4" + }, + "prod": { + "staticApiUrl": "api-sims.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "sims.apps.silver.devops.gov.bc.ca", + "staticAppVanityUrl": "sims.nrs.gov.bc.ca", + "tz": "America/Vancouver", + "backboneApiHost": "https://api-biohub-platform.apps.silver.devops.gov.bc.ca", + "backboneIntakePath": "/api/dwc/submission/queue", + "backboneArtifactIntakePath": "/api/artifact/intake", + "backboneIntakeEnabled": false, + "bctwApiHost": "https://moe-bctw-api-prod.apps.silver.devops.gov.bc.ca", + "critterbaseApiHost": "https://moe-critterbase-api-prod.apps.silver.devops.gov.bc.ca/api", + "elasticsearchURL": "http://es01.a0ec71-prod:9200", + "elasticsearchTaxonomyIndex": "taxonomy_3.0.0", + "s3KeyPrefix": "sims", + "logLevel": "warn", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "3Gi", + "replicas": "2", + "replicasMax": "4" + } + } + }, + "app": { + "build": { + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "5Gi" + }, + "deploy": { + "pr": { + "siteminderLogoutURL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", + "maxUploadNumFiles": 10, + "maxUploadFileSize": 52428800, + "cpuRequest": "50m", + "cpuLimit": "200m", + "memoryRequest": "100Mi", + "memoryLimit": "333Mi", + "replicas": "1", + "replicasMax": "1" + }, + "dev": { + "staticApiUrl": "api-dev-sims.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "dev-sims.apps.silver.devops.gov.bc.ca", + "siteminderLogoutURL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", + "maxUploadNumFiles": 10, + "maxUploadFileSize": 52428800, + "cpuRequest": "50m", + "cpuLimit": "200m", + "memoryRequest": "100Mi", + "memoryLimit": "333Mi", + "replicas": "1", + "replicasMax": "1" + }, + "test": { + "staticApiUrl": "api-test-sims.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "test-sims.apps.silver.devops.gov.bc.ca", + "siteminderLogoutURL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", + "maxUploadNumFiles": 10, + "maxUploadFileSize": 52428800, + "cpuRequest": "50m", + "cpuLimit": "500m", + "memoryRequest": "100Mi", + "memoryLimit": "500Mi", + "replicas": "2", + "replicasMax": "3" + }, + "prod": { + "staticApiUrl": "api-sims.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "sims.apps.silver.devops.gov.bc.ca", + "staticAppVanityUrl": "sims.nrs.gov.bc.ca", + "siteminderLogoutURL": "https://logon7.gov.bc.ca/clp-cgi/logoff.cgi", + "maxUploadNumFiles": 10, + "maxUploadFileSize": 52428800, + "cpuRequest": "50m", + "cpuLimit": "500m", + "memoryRequest": "100Mi", + "memoryLimit": "500Mi", + "replicas": "2", + "replicasMax": "3" + } + } + }, + "database": { + "build": { + "tz": "America/Vancouver" + }, + "deploy": { + "pr": { + "tz": "America/Vancouver", + "volumeCapacity": "500Mi", + "cpuRequest": "50m", + "cpuLimit": "400m", + "memoryRequest": "100Mi", + "memoryLimit": "2Gi", + "replicas": "1" + }, + "dev": { + "tz": "America/Vancouver", + "volumeCapacity": "3Gi", + "cpuRequest": "50m", + "cpuLimit": "400m", + "memoryRequest": "100Mi", + "memoryLimit": "2Gi", + "replicas": "1" + }, + "test": { + "tz": "America/Vancouver", + "volumeCapacity": "3Gi", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "3Gi", + "replicas": "1" + }, + "prod": { + "tz": "America/Vancouver", + "volumeCapacity": "5Gi", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "3Gi", + "replicas": "1" + } + } + }, + "sso": { + "pr": { + "host": "https://dev.loginproxy.gov.bc.ca/auth", + "realm": "standard", + "clientId": "sims-4461", + "keycloakSecret": "keycloak", + "serviceClient": { + "serviceClientName": "sims-svc-4464", + "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" + }, + "cssApi": { + "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", + "cssApiClientId": "service-account-team-1190-4229", + "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", + "keycloakSecretCssApiSecretKey": "css_api_client_secret", + "cssApiEnvironment": "dev" + } + }, + "dev": { + "host": "https://dev.loginproxy.gov.bc.ca/auth", + "realm": "standard", + "clientId": "sims-4461", + "keycloakSecret": "keycloak", + "serviceClient": { + "serviceClientName": "sims-svc-4464", + "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" + }, + "cssApi": { + "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", + "cssApiClientId": "service-account-team-1190-4229", + "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", + "keycloakSecretCssApiSecretKey": "css_api_client_secret", + "cssApiEnvironment": "dev" + } + }, + "test": { + "host": "https://test.loginproxy.gov.bc.ca/auth", + "realm": "standard", + "clientId": "sims-4461", + "keycloakSecret": "keycloak", + "serviceClient": { + "serviceClientName": "sims-svc-4464", + "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" + }, + "cssApi": { + "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", + "cssApiClientId": "service-account-team-1190-4229", + "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", + "keycloakSecretCssApiSecretKey": "css_api_client_secret", + "cssApiEnvironment": "test" + } + }, + "prod": { + "host": "https://loginproxy.gov.bc.ca/auth", + "realm": "standard", + "clientId": "sims-4461", + "keycloakSecret": "keycloak", + "serviceClient": { + "serviceClientName": "sims-svc-4464", + "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" + }, + "cssApi": { + "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", + "cssApiClientId": "service-account-team-1190-4229", + "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", + "keycloakSecretCssApiSecretKey": "css_api_client_secret", + "cssApiEnvironment": "prod" + } + } + } +} diff --git a/.pipeline/templates/sims.configmap.yaml b/.pipeline/templates/sims.configmap.yaml new file mode 100644 index 0000000000..24feef08d7 --- /dev/null +++ b/.pipeline/templates/sims.configmap.yaml @@ -0,0 +1,236 @@ +kind: ConfigMap +apiVersion: v1 +metadata: + name: sims-pipeline-config + namespace: af2668-dev +immutable: false +data: + config: | + { + "name": "sims", + "namespaceSuffix": "af2668", + "namespace": { + "tools": "tools", + "dev": "dev", + "test": "test", + "prod": "prod" + }, + "version": "1.0.0", + "module": { + "db": "sims-db", + "api": "sims-api", + "app": "sims-app" + }, + "api": { + "build": { + "tz": "America/Vancouver", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "3Gi" + }, + "deploy": { + "dev": { + "staticApiUrl": "api-dev-sims.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "dev-sims.apps.silver.devops.gov.bc.ca", + "tz": "America/Vancouver", + "backboneApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", + "backboneIntakePath": "/api/dwc/submission/queue", + "backboneArtifactIntakePath": "/api/artifact/intake", + "backboneIntakeEnabled": false, + "bctwApiHost": "https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca", + "critterbaseApiHost": "https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api", + "elasticsearchURL": "http://es01.a0ec71-dev:9200", + "elasticsearchTaxonomyIndex": "taxonomy_3.0.0", + "s3KeyPrefix": "sims", + "logLevel": "debug", + "cpuRequest": "50m", + "cpuLimit": "400m", + "memoryRequest": "100Mi", + "memoryLimit": "2Gi", + "replicas": "1", + "replicasMax": "2" + }, + "test": { + "staticApiUrl": "api-test-sims.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "test-sims.apps.silver.devops.gov.bc.ca", + "tz": "America/Vancouver", + "backboneApiHost": "https://api-test-biohub-platform.apps.silver.devops.gov.bc.ca", + "backboneIntakePath": "/api/dwc/submission/queue", + "backboneArtifactIntakePath": "/api/artifact/intake", + "backboneIntakeEnabled": false, + "bctwApiHost": "https://moe-bctw-api-test.apps.silver.devops.gov.bc.ca", + "critterbaseApiHost": "https://moe-critterbase-api-test.apps.silver.devops.gov.bc.ca/api", + "elasticsearchURL": "http://es01.a0ec71-dev:9200", + "elasticsearchTaxonomyIndex": "taxonomy_3.0.0", + "s3KeyPrefix": "sims", + "logLevel": "info", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "3Gi", + "replicas": "2", + "replicasMax": "4" + }, + "prod": { + "staticApiUrl": "api-sims.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "sims.apps.silver.devops.gov.bc.ca", + "staticAppVanityUrl": "sims.nrs.gov.bc.ca", + "tz": "America/Vancouver", + "backboneApiHost": "https://api-biohub-platform.apps.silver.devops.gov.bc.ca", + "backboneIntakePath": "/api/dwc/submission/queue", + "backboneArtifactIntakePath": "/api/artifact/intake", + "backboneIntakeEnabled": false, + "bctwApiHost": "https://moe-bctw-api-prod.apps.silver.devops.gov.bc.ca", + "critterbaseApiHost": "https://moe-critterbase-api-prod.apps.silver.devops.gov.bc.ca/api", + "elasticsearchURL": "http://es01.a0ec71-prod:9200", + "elasticsearchTaxonomyIndex": "taxonomy_3.0.0", + "s3KeyPrefix": "sims", + "logLevel": "warn", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "3Gi", + "replicas": "2", + "replicasMax": "4" + } + } + }, + "app": { + "build": { + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "5Gi" + }, + "deploy": { + "dev": { + "staticApiUrl": "api-dev-sims.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "dev-sims.apps.silver.devops.gov.bc.ca", + "siteminderLogoutURL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", + "maxUploadNumFiles": 10, + "maxUploadFileSize": 52428800, + "cpuRequest": "50m", + "cpuLimit": "200m", + "memoryRequest": "100Mi", + "memoryLimit": "333Mi", + "replicas": "1", + "replicasMax": "1" + }, + "test": { + "staticApiUrl": "api-test-sims.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "test-sims.apps.silver.devops.gov.bc.ca", + "siteminderLogoutURL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", + "maxUploadNumFiles": 10, + "maxUploadFileSize": 52428800, + "cpuRequest": "50m", + "cpuLimit": "500m", + "memoryRequest": "100Mi", + "memoryLimit": "500Mi", + "replicas": "2", + "replicasMax": "3" + }, + "prod": { + "staticApiUrl": "api-sims.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "sims.apps.silver.devops.gov.bc.ca", + "staticAppVanityUrl": "sims.nrs.gov.bc.ca", + "siteminderLogoutURL": "https://logon7.gov.bc.ca/clp-cgi/logoff.cgi", + "maxUploadNumFiles": 10, + "maxUploadFileSize": 52428800, + "cpuRequest": "50m", + "cpuLimit": "500m", + "memoryRequest": "100Mi", + "memoryLimit": "500Mi", + "replicas": "2", + "replicasMax": "3" + } + } + }, + "database": { + "build": { + "tz": "America/Vancouver" + }, + "deploy": { + "dev": { + "tz": "America/Vancouver", + "volumeCapacity": "3Gi", + "cpuRequest": "50m", + "cpuLimit": "400m", + "memoryRequest": "100Mi", + "memoryLimit": "2Gi", + "replicas": "1" + }, + "test": { + "tz": "America/Vancouver", + "volumeCapacity": "3Gi", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "3Gi", + "replicas": "1" + }, + "prod": { + "tz": "America/Vancouver", + "volumeCapacity": "5Gi", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "3Gi", + "replicas": "1" + } + } + }, + "sso": { + "dev": { + "host": "https://dev.loginproxy.gov.bc.ca/auth", + "realm": "standard", + "clientId": "sims-4461", + "keycloakSecret": "keycloak", + "serviceClient": { + "serviceClientName": "sims-svc-4464", + "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" + }, + "cssApi": { + "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", + "cssApiClientId": "service-account-team-1190-4229", + "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", + "keycloakSecretCssApiSecretKey": "css_api_client_secret", + "cssApiEnvironment": "dev" + } + }, + "test": { + "host": "https://test.loginproxy.gov.bc.ca/auth", + "realm": "standard", + "clientId": "sims-4461", + "keycloakSecret": "keycloak", + "serviceClient": { + "serviceClientName": "sims-svc-4464", + "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" + }, + "cssApi": { + "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", + "cssApiClientId": "service-account-team-1190-4229", + "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", + "keycloakSecretCssApiSecretKey": "css_api_client_secret", + "cssApiEnvironment": "test" + } + }, + "prod": { + "host": "https://loginproxy.gov.bc.ca/auth", + "realm": "standard", + "clientId": "sims-4461", + "keycloakSecret": "keycloak", + "serviceClient": { + "serviceClientName": "sims-svc-4464", + "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" + }, + "cssApi": { + "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", + "cssApiClientId": "service-account-team-1190-4229", + "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", + "keycloakSecretCssApiSecretKey": "css_api_client_secret", + "cssApiEnvironment": "prod" + } + } + } + } diff --git a/api/.pipeline/config.js b/api/.pipeline/config.js index dc197dd2f9..21c1af5446 100644 --- a/api/.pipeline/config.js +++ b/api/.pipeline/config.js @@ -1,30 +1,55 @@ 'use strict'; -let options = require('pipeline-cli').Util.parseArguments(); +const { PipelineConfigMapSchema } = require('./utils/configMapSchema'); +const PipelineCli = require('pipeline-cli'); -// The root config for common values -const config = require('../../.config/config.json'); +// Options passed in from the git action +const rawOptions = PipelineCli.Util.parseArguments(); -const appName = config.module.app; -const name = config.module.api; -const dbName = config.module.db; +// Pull-request number or branch name +const changeId = rawOptions.pr; -const version = config.version; - -const changeId = options.pr; // pull-request number or branch name +// Pipeline config map from openshift +const rawPipelineConfigMap = rawOptions.config; +// Validate the pipeline config map is not missing any fields +const pipelineConfigMap = PipelineConfigMapSchema.parse(JSON.parse(rawPipelineConfigMap)); // A static deployment is when the deployment is updating dev, test, or prod (rather than a temporary PR) // See `--type=static` in the `deployStatic.yml` git workflow -const isStaticDeployment = options.type === 'static'; - -const deployChangeId = (isStaticDeployment && 'deploy') || changeId; -const branch = (isStaticDeployment && options.branch) || null; -const tag = (branch && `build-${version}-${changeId}-${branch}`) || `build-${version}-${changeId}`; - -const staticUrlsAPI = config.staticUrlsAPI; -const staticUrls = config.staticUrls; - -const processOptions = (options) => { +const isStaticDeployment = rawOptions.type === 'static'; + +const branch = (isStaticDeployment && rawOptions.branch) || null; +const tag = + (branch && `build-${pipelineConfigMap.version}-${changeId}-${branch}`) || + `build-${pipelineConfigMap.version}-${changeId}`; + +/** + * Parses the npm cli command options and the git action context. + * + * @param {*} options + * @return {{ + * git: { + * dir: '', + * branch: { + * name: '', + * remote: '', + * merge: '' + * }, + * url: 'https://github.com/bcgov/biohubbc.git', + * uri: 'https://github.com/bcgov/biohubbc', + * http_url: 'https://github.com/bcgov/biohubbc.git', + * owner: 'bcgov', + * repository: 'biohubbc', + * pull_request: '', + * ref: '', + * branch_ref: '' + * }, + * pr: '', + * config: {}, // JSON config map + * type?: 'static' + * }} + */ +function processOptions(options) { const result = { ...options }; // Check git @@ -44,127 +69,167 @@ const processOptions = (options) => { } return result; -}; +} -options = processOptions(options); +const options = processOptions(rawOptions); const phases = { build: { + ...pipelineConfigMap.api.build.pr, namespace: 'af2668-tools', - name: `${name}`, - dbName: `${dbName}`, + name: pipelineConfigMap.module.api, + dbName: pipelineConfigMap.module.db, phase: 'build', changeId: changeId, suffix: `-build-${changeId}`, - instance: `${name}-build-${changeId}`, - version: `${version}-${changeId}`, + instance: `${pipelineConfigMap.module.api}-build-${changeId}`, + version: `${pipelineConfigMap.version}-${changeId}`, tag: tag, - tz: config.timezone.api, - branch: branch, - cpuRequest: '50m', - cpuLimit: '1000m', - memoryRequest: '100Mi', - memoryLimit: '3Gi' + // tz: pipelineConfigMap.tz.api, + branch: branch + // cpuRequest: '50m', + // cpuLimit: '1000m', + // memoryRequest: '100Mi', + // memoryLimit: '3Gi' + }, + pr: { + ...pipelineConfigMap.api.deploy.pr, + namespace: 'af2668-dev', + name: pipelineConfigMap.module.api, + dbName: pipelineConfigMap.module.db, + phase: 'pr', + changeId: changeId, + suffix: `-dev-${changeId}`, + instance: `${pipelineConfigMap.module.api}-dev-${changeId}`, + version: `${changeId}-${changeId}`, + tag: `dev-${pipelineConfigMap.version}-${changeId}`, + host: `${pipelineConfigMap.module.api}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, + appHost: `${pipelineConfigMap.module.app}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, + // backboneApiHost: 'https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca', + // backboneIntakePath: '/api/dwc/submission/queue', + // backboneArtifactIntakePath: '/api/artifact/intake', + // backboneIntakeEnabled: false, + // bctwApiHost: 'https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca', + // critterbaseApiHost: 'https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api', + env: 'dev', + // elasticsearchURL: 'http://es01.a0ec71-dev:9200', + // elasticsearchTaxonomyIndex: 'taxonomy_3.0.0', + s3KeyPrefix: `local/${changeId}/sims`, + // tz: pipelineConfigMap.tz.api, + sso: pipelineConfigMap.sso.dev + // logLevel: 'debug', + // cpuRequest: '50m', + // cpuLimit: '400m', + // memoryRequest: '100Mi', + // memoryLimit: '2Gi', + // replicas: '1', + // replicasMax: '1', }, dev: { + ...pipelineConfigMap.api.deploy.dev, namespace: 'af2668-dev', - name: `${name}`, - dbName: `${dbName}`, + name: pipelineConfigMap.module.api, + dbName: pipelineConfigMap.module.db, phase: 'dev', - changeId: deployChangeId, - suffix: `-dev-${deployChangeId}`, - instance: `${name}-dev-${deployChangeId}`, - version: `${deployChangeId}-${changeId}`, - tag: `dev-${version}-${deployChangeId}`, - host: (isStaticDeployment && staticUrlsAPI.dev) || `${name}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, - appHost: (isStaticDeployment && staticUrls.dev) || `${appName}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, - backboneApiHost: 'https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca', - backboneIntakePath: '/api/dwc/submission/queue', - backboneArtifactIntakePath: '/api/artifact/intake', - backboneIntakeEnabled: false, - bctwApiHost: 'https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca', - critterbaseApiHost: 'https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api', + changeId: 'deploy', + suffix: '-dev-deploy', + instance: `${pipelineConfigMap.module.api}-dev-deploy`, + version: `deploy-${changeId}`, + tag: `dev-${pipelineConfigMap.version}-deploy`, + host: pipelineConfigMap.api.deploy.dev.staticApiUrl, + appHost: pipelineConfigMap.api.deploy.dev.staticAppUrl, + // backboneApiHost: 'https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca', + // backboneIntakePath: '/api/dwc/submission/queue', + // backboneArtifactIntakePath: '/api/artifact/intake', + // backboneIntakeEnabled: false, + // bctwApiHost: 'https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca', + // critterbaseApiHost: 'https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api', nodeEnv: 'development', - elasticsearchURL: 'http://es01.a0ec71-dev:9200', - elasticsearchTaxonomyIndex: 'taxonomy_3.0.0', - s3KeyPrefix: (isStaticDeployment && 'sims') || `local/${deployChangeId}/sims`, - tz: config.timezone.api, - sso: config.sso.dev, - logLevel: 'info', - nodeOptions: '--max_old_space_size=2250', // 75% of memoryLimit (bytes) - cpuRequest: '50m', - cpuLimit: '600m', - memoryRequest: '100Mi', - memoryLimit: '3Gi', - replicas: (isStaticDeployment && '1') || '1', - replicasMax: (isStaticDeployment && '2') || '1' + // elasticsearchURL: 'http://es01.a0ec71-dev:9200', + // elasticsearchTaxonomyIndex: 'taxonomy_3.0.0', + // s3KeyPrefix: 'sims', + // tz: pipelineConfigMap.tz.api, + sso: pipelineConfigMap.sso.dev + // logLevel: 'info', + // cpuRequest: '50m', + // cpuLimit: '600m', + // memoryRequest: '100Mi', + // memoryLimit: '3Gi', + // replicas: '1', + // replicasMax: '2', }, test: { + ...pipelineConfigMap.api.deploy.test, namespace: 'af2668-test', - name: `${name}`, - dbName: `${dbName}`, + name: pipelineConfigMap.module.api, + dbName: pipelineConfigMap.module.db, phase: 'test', - changeId: deployChangeId, + changeId: 'deploy', suffix: `-test`, - instance: `${name}-test`, - version: `${version}`, - tag: `test-${version}`, - host: staticUrlsAPI.test, - appHost: staticUrls.test, - backboneApiHost: 'https://api-test-biohub-platform.apps.silver.devops.gov.bc.ca', - backboneIntakePath: '/api/dwc/submission/queue', - backboneArtifactIntakePath: '/api/artifact/intake', - backboneIntakeEnabled: false, - bctwApiHost: 'https://moe-bctw-api-test.apps.silver.devops.gov.bc.ca', - critterbaseApiHost: 'https://moe-critterbase-api-test.apps.silver.devops.gov.bc.ca/api', + instance: `${pipelineConfigMap.module.api}-test`, + version: `deploy-${changeId}`, + tag: `test-${pipelineConfigMap.version}`, + host: pipelineConfigMap.api.deploy.test.staticApiUrl, + appHost: pipelineConfigMap.api.deploy.test.staticAppUrl, + // backboneApiHost: 'https://api-test-biohub-platform.apps.silver.devops.gov.bc.ca', + // backboneIntakePath: '/api/dwc/submission/queue', + // backboneArtifactIntakePath: '/api/artifact/intake', + // backboneIntakeEnabled: false, + // bctwApiHost: 'https://moe-bctw-api-test.apps.silver.devops.gov.bc.ca', + // critterbaseApiHost: 'https://moe-critterbase-api-test.apps.silver.devops.gov.bc.ca/api', nodeEnv: 'production', - elasticsearchURL: 'http://es01.a0ec71-dev:9200', - elasticsearchTaxonomyIndex: 'taxonomy_3.0.0', - s3KeyPrefix: 'sims', - tz: config.timezone.api, - sso: config.sso.test, - logLevel: 'info', - nodeOptions: '--max_old_space_size=2250', // 75% of memoryLimit (bytes) - cpuRequest: '50m', - cpuLimit: '1000m', - memoryRequest: '100Mi', - memoryLimit: '3Gi', - replicas: '2', - replicasMax: '4' + // elasticsearchURL: 'http://es01.a0ec71-dev:9200', + // elasticsearchTaxonomyIndex: 'taxonomy_3.0.0', + // s3KeyPrefix: 'sims', + // tz: pipelineConfigMap.tz.api, + sso: pipelineConfigMap.sso.test + // logLevel: 'info', + // cpuRequest: '50m', + // cpuLimit: '1000m', + // memoryRequest: '100Mi', + // memoryLimit: '3Gi', + // replicas: '2', + // replicasMax: '4' }, prod: { + ...pipelineConfigMap.api.deploy.prod, namespace: 'af2668-prod', - name: `${name}`, - dbName: `${dbName}`, + name: pipelineConfigMap.module.api, + dbName: pipelineConfigMap.module.db, phase: 'prod', - changeId: deployChangeId, + changeId: 'deploy', suffix: `-prod`, - instance: `${name}-prod`, - version: `${version}`, - tag: `prod-${version}`, - host: staticUrlsAPI.prod, - appHost: staticUrls.prodVanityUrl, - backboneApiHost: 'https://api-biohub-platform.apps.silver.devops.gov.bc.ca', - backboneIntakePath: '/api/dwc/submission/queue', - backboneArtifactIntakePath: '/api/artifact/intake', - backboneIntakeEnabled: false, - bctwApiHost: 'https://moe-bctw-api-prod.apps.silver.devops.gov.bc.ca', - critterbaseApiHost: 'https://moe-critterbase-api-prod.apps.silver.devops.gov.bc.ca/api', + instance: `${pipelineConfigMap.module.api}-prod`, + version: `deploy-${changeId}`, + tag: `prod-${pipelineConfigMap.version}`, + host: pipelineConfigMap.api.deploy.prod.staticApiUrl, + appHost: pipelineConfigMap.api.deploy.prod.staticAppVanityUrl, + // backboneApiHost: 'https://api-biohub-platform.apps.silver.devops.gov.bc.ca', + // backboneIntakePath: '/api/dwc/submission/queue', + // backboneArtifactIntakePath: '/api/artifact/intake', + // backboneIntakeEnabled: false, + // bctwApiHost: 'https://moe-bctw-api-prod.apps.silver.devops.gov.bc.ca', + // critterbaseApiHost: 'https://moe-critterbase-api-prod.apps.silver.devops.gov.bc.ca/api', nodeEnv: 'production', - elasticsearchURL: 'http://es01.a0ec71-prod:9200', - elasticsearchTaxonomyIndex: 'taxonomy_3.0.0', - s3KeyPrefix: 'sims', - tz: config.timezone.api, - sso: config.sso.prod, - logLevel: 'warn', - nodeOptions: '--max_old_space_size=2250', // 75% of memoryLimit (bytes) - cpuRequest: '50m', - cpuLimit: '1000m', - memoryRequest: '100Mi', - memoryLimit: '3Gi', - replicas: '2', - replicasMax: '4' + // elasticsearchURL: 'http://es01.a0ec71-prod:9200', + // elasticsearchTaxonomyIndex: 'taxonomy_3.0.0', + // s3KeyPrefix: 'sims', + // tz: pipelineConfigMap.tz.api, + sso: pipelineConfigMap.sso.prod + // logLevel: 'info', + // cpuRequest: '50m', + // cpuLimit: '1000m', + // memoryRequest: '100Mi', + // memoryLimit: '3Gi', + // replicas: '2', + // replicasMax: '4' } }; +console.log('1=============================================='); +console.log('api phases', phases); +console.log('2=============================================='); +console.log('api options', options); +console.log('3=============================================='); + module.exports = exports = { phases, options }; diff --git a/api/.pipeline/lib/api.build.js b/api/.pipeline/lib/api.build.js index 301c0971d5..d2c94eb48e 100644 --- a/api/.pipeline/lib/api.build.js +++ b/api/.pipeline/lib/api.build.js @@ -6,11 +6,9 @@ const path = require('path'); /** * Build the api image. * - * @param {*} settings + * @param {*} { phases, options } */ -const apiBuild = (settings) => { - const phases = settings.phases; - const options = settings.options; +const apiBuild = ({ phases, options }) => { const phase = settings.phase; const oc = new OpenShiftClientX(Object.assign({ namespace: phases[phase].namespace }, options)); @@ -26,7 +24,7 @@ const apiBuild = (settings) => { SUFFIX: phases[phase].suffix, VERSION: phases[phase].tag, SOURCE_REPOSITORY_URL: oc.git.http_url, - SOURCE_REPOSITORY_REF: phases[phase].branch || oc.git.ref, + SOURCE_REPOSITORY_REF: phases[phase].branch, CPU_REQUEST: phases[phase].cpuRequest, CPU_LIMIT: phases[phase].cpuLimit, MEMORY_REQUEST: phases[phase].memoryRequest, diff --git a/api/.pipeline/package-lock.json b/api/.pipeline/package-lock.json index a469f9f2c8..8692f80f08 100644 --- a/api/.pipeline/package-lock.json +++ b/api/.pipeline/package-lock.json @@ -53,6 +53,11 @@ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz", "integrity": "sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==", "dev": true + }, + "zod": { + "version": "3.22.4", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.4.tgz", + "integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==" } } } diff --git a/api/.pipeline/package.json b/api/.pipeline/package.json index acb6cbe7c4..9d5f7a9e5d 100644 --- a/api/.pipeline/package.json +++ b/api/.pipeline/package.json @@ -26,7 +26,8 @@ "lodash.isfunction": "^3.0.9", "lodash.isplainobject": "^4.0.6", "lodash.isstring": "^4.0.1", - "pipeline-cli": "git+https://github.com/NickPhura/pipeline-cli.git" + "pipeline-cli": "git+https://github.com/NickPhura/pipeline-cli.git", + "zod": "^3.21.4" }, "devDependencies": { "prettier": "~2.3.2" diff --git a/api/.pipeline/utils/configMapSchema.js b/api/.pipeline/utils/configMapSchema.js new file mode 100644 index 0000000000..d0d62010c9 --- /dev/null +++ b/api/.pipeline/utils/configMapSchema.js @@ -0,0 +1,271 @@ +const z = require('zod'); + +const PipelineConfigMapSchema = z.object({ + name: z.string(), + namespaceSuffix: z.string(), + namespace: z.object({ + tools: z.string(), + dev: z.string(), + test: z.string(), + prod: z.string() + }), + version: z.string(), + module: z.object({ + db: z.string(), + api: z.string(), + app: z.string() + }), + api: z.object({ + build: z.object({ + tz: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() + }), + deploy: z.object({ + pr: z.object({ + tz: z.string(), + backboneApiHost: z.string(), + backboneIntakePath: z.string(), + backboneArtifactIntakePath: z.string(), + backboneIntakeEnabled: z.boolean(), + bctwApiHost: z.string(), + critterbaseApiHost: z.string(), + elasticsearchURL: z.string(), + elasticsearchTaxonomyIndex: z.string(), + s3KeyPrefix: z.string(), + logLevel: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + replicasMax: z.string() + }), + dev: z.object({ + staticApiUrl: z.string(), + staticAppUrl: z.string(), + tz: z.string(), + backboneApiHost: z.string(), + backboneIntakePath: z.string(), + backboneArtifactIntakePath: z.string(), + backboneIntakeEnabled: z.boolean(), + bctwApiHost: z.string(), + critterbaseApiHost: z.string(), + elasticsearchURL: z.string(), + elasticsearchTaxonomyIndex: z.string(), + s3KeyPrefix: z.string(), + logLevel: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + replicasMax: z.string() + }), + test: z.object({ + staticApiUrl: z.string(), + staticAppUrl: z.string(), + tz: z.string(), + backboneApiHost: z.string(), + backboneIntakePath: z.string(), + backboneArtifactIntakePath: z.string(), + backboneIntakeEnabled: z.boolean(), + bctwApiHost: z.string(), + critterbaseApiHost: z.string(), + elasticsearchURL: z.string(), + elasticsearchTaxonomyIndex: z.string(), + s3KeyPrefix: z.string(), + logLevel: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + replicasMax: z.string() + }), + prod: z.object({ + staticApiUrl: z.string(), + staticAppUrl: z.string(), + staticAppVanityUrl: z.string(), + tz: z.string(), + backboneApiHost: z.string(), + backboneIntakePath: z.string(), + backboneArtifactIntakePath: z.string(), + backboneIntakeEnabled: z.boolean(), + bctwApiHost: z.string(), + critterbaseApiHost: z.string(), + elasticsearchURL: z.string(), + elasticsearchTaxonomyIndex: z.string(), + s3KeyPrefix: z.string(), + logLevel: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + replicasMax: z.string() + }) + }) + }), + app: z.object({ + build: z.object({ + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() + }), + deploy: z.object({ + pr: z.object({ + siteminderLogoutURL: z.string(), + maxUploadNumFiles: z.number(), + maxUploadFileSize: z.number(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + replicasMax: z.string() + }), + dev: z.object({ + staticApiUrl: z.string(), + staticAppUrl: z.string(), + siteminderLogoutURL: z.string(), + maxUploadNumFiles: z.number(), + maxUploadFileSize: z.number(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + replicasMax: z.string() + }), + test: z.object({ + staticApiUrl: z.string(), + staticAppUrl: z.string(), + siteminderLogoutURL: z.string(), + maxUploadNumFiles: z.number(), + maxUploadFileSize: z.number(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + replicasMax: z.string() + }), + prod: z.object({ + staticApiUrl: z.string(), + staticAppUrl: z.string(), + staticAppVanityUrl: z.string(), + siteminderLogoutURL: z.string(), + maxUploadNumFiles: z.number(), + maxUploadFileSize: z.number(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + replicasMax: z.string() + }) + }) + }), + database: z.object({ + build: z.object({ + tz: z.string() + }), + deploy: z.object({ + pr: z.object({ + tz: z.string(), + volumeCapacity: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string() + }), + dev: z.object({ + tz: z.string(), + volumeCapacity: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string() + }), + test: z.object({ + tz: z.string(), + volumeCapacity: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string() + }), + prod: z.object({ + tz: z.string(), + volumeCapacity: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string() + }) + }) + }), + sso: z.object({ + dev: z.object({ + host: z.string(), + realm: z.string(), + clientId: z.string(), + keycloakSecret: z.string(), + serviceClient: z.object({ + serviceClientName: z.string(), + keycloakSecretServiceClientPasswordKey: z.string() + }), + cssApi: z.object({ + cssApiTokenUrl: z.string(), + cssApiClientId: z.string(), + cssApiHost: z.string(), + keycloakSecretCssApiSecretKey: z.string(), + cssApiEnvironment: z.string() + }) + }), + test: z.object({ + host: z.string(), + realm: z.string(), + clientId: z.string(), + keycloakSecret: z.string(), + serviceClient: z.object({ + serviceClientName: z.string(), + keycloakSecretServiceClientPasswordKey: z.string() + }), + cssApi: z.object({ + cssApiTokenUrl: z.string(), + cssApiClientId: z.string(), + cssApiHost: z.string(), + keycloakSecretCssApiSecretKey: z.string(), + cssApiEnvironment: z.string() + }) + }), + prod: z.object({ + host: z.string(), + realm: z.string(), + clientId: z.string(), + keycloakSecret: z.string(), + serviceClient: z.object({ + serviceClientName: z.string(), + keycloakSecretServiceClientPasswordKey: z.string() + }), + cssApi: z.object({ + cssApiTokenUrl: z.string(), + cssApiClientId: z.string(), + cssApiHost: z.string(), + keycloakSecretCssApiSecretKey: z.string(), + cssApiEnvironment: z.string() + }) + }) + }) +}); + +module.exports = exports = { PipelineConfigMapSchema }; diff --git a/api/.pipeline2/templates/api.bc.yaml b/api/.pipeline2/templates/api.bc.yaml new file mode 100644 index 0000000000..b23547271c --- /dev/null +++ b/api/.pipeline2/templates/api.bc.yaml @@ -0,0 +1,114 @@ +apiVersion: template.openshift.io/v1 +kind: Template +metadata: + name: sims-api-bc + labels: + build: sims-api +parameters: + - name: NAME + description: Image name + required: true + value: sims-api + - name: SUFFIX + description: A suffix appended to all objects + required: true + value: '-dev' + - name: VERSION + required: true + value: '1.0' + - name: SOURCE_CONTEXT_DIR + required: true + value: api + - name: SOURCE_REPOSITORY_URL + required: true + value: https://github.com/bcgov/biohubbc + - name: SOURCE_REPOSITORY_REF + required: false + value: dev + - name: BASE_IMAGE_URL + required: true + value: image-registry.openshift-image-registry.svc:5000/openshift/nodejs:14-ubi8 + - name: SOURCE_IMAGE_NAME + required: true + value: nodejs + - name: SOURCE_IMAGE_TAG + required: true + value: 14-ubi8 + - name: CPU_REQUEST + value: '50m' + - name: CPU_LIMIT + value: '1000m' + - name: MEMORY_REQUEST + value: '100Mi' + - name: MEMORY_LIMIT + value: '3Gi' +objects: + - kind: ImageStream + apiVersion: image.openshift.io/v1 + metadata: + name: ${SOURCE_IMAGE_NAME} + annotations: + description: Nodejs Base Image + labels: + shared: 'true' + spec: + lookupPolicy: + local: false + tags: + - name: ${SOURCE_IMAGE_TAG} + annotations: null + from: + kind: DockerImage + name: ${BASE_IMAGE_URL} + importPolicy: {} + referencePolicy: + type: Local + - kind: ImageStream + apiVersion: image.openshift.io/v1 + metadata: + name: '${NAME}' + annotations: + description: Nodejs Runtime Image + labels: + shared: 'true' + spec: + lookupPolicy: + local: false + - apiVersion: v1 + kind: BuildConfig + metadata: + name: '${NAME}${SUFFIX}' + labels: {} + annotations: {} + spec: + failedBuildsHistoryLimit: 5 + nodeSelector: + output: + to: + kind: ImageStreamTag + name: '${NAME}:${VERSION}' + postCommit: {} + resources: + requests: + cpu: ${CPU_REQUEST} + memory: ${MEMORY_REQUEST} + limits: + cpu: ${CPU_LIMIT} + memory: ${MEMORY_LIMIT} + runPolicy: SerialLatestOnly + source: + contextDir: '${SOURCE_CONTEXT_DIR}' + git: + uri: '${SOURCE_REPOSITORY_URL}' + ref: '${SOURCE_REPOSITORY_REF}' + type: Git + strategy: + dockerStrategy: + from: + kind: ImageStreamTag + name: ${SOURCE_IMAGE_NAME}:${SOURCE_IMAGE_TAG} + type: Docker + successfulBuildsHistoryLimit: 5 + triggers: + - type: ConfigChange + - type: ImageChange diff --git a/api/.pipeline2/templates/api.dc.yaml b/api/.pipeline2/templates/api.dc.yaml new file mode 100644 index 0000000000..07444b78e1 --- /dev/null +++ b/api/.pipeline2/templates/api.dc.yaml @@ -0,0 +1,483 @@ +apiVersion: template.openshift.io/v1 +kind: Template +metadata: + name: sims-api-dc + labels: + build: sims-api +parameters: + - name: NAME + value: sims-api + - name: SUFFIX + value: '-dev' + - name: VERSION + description: Version of the application + value: '1.0.0' + - name: HOST + description: Host name of the application + required: true + - name: APP_HOST + description: APP host for application frontend + value: '' + - name: CHANGE_ID + description: Change id of the project. This will help to pull image stream + required: true + value: '0' + - name: NODE_ENV + description: Application Environment type variable + required: true + value: 'dev' + - name: API_PORT_DEFAULT + value: '6100' + - name: API_PORT_DEFAULT_NAME + description: Api default port name + value: '6100-tcp' + # Clamav + - name: ENABLE_FILE_VIRUS_SCAN + value: 'true' + - name: CLAMAV_HOST + value: 'clamav' + - name: CLAMAV_PORT + value: '3310' + # BioHub Platform (aka: Backbone) + - name: BACKBONE_API_HOST + required: true + description: API host for BioHub Platform Backbone. Example "https://platform.com". + - name: BACKBONE_INTAKE_PATH + required: true + description: API path for BioHub Platform Backbone DwCA submission intake endpoint. Example "/api/path/to/intake". + - name: BACKBONE_ARTIFACT_INTAKE_PATH + required: true + description: API path for BioHub Platform Backbone artifact submission intake endpoint. Example "/api/path/to/artifact/intake". + - name: BACKBONE_INTAKE_ENABLED + required: true + description: Controls whether or not SIMS will submit DwCA datasets to the BioHub Platform Backbone. Set to "true" to enable it, will be disabled by default otherwise. + # BCTW / Critterbase + - name: CB_API_HOST + description: API host for the Critterbase service, SIMS API will hit this to retrieve critter metadata. Example "https://critterbase.com". + required: true + - name: BCTW_API_HOST + description: API host for the BC Telemetry Warehouse service. SIMS API will hit this for device deployments and other telemetry operations. Example "https://bctw.com". + required: true + # Elastic Search + - name: ELASTICSEARCH_URL + description: Platform Elasticsearch URL + required: true + value: 'http://es01:9200' + - name: ELASTICSEARCH_TAXONOMY_INDEX + description: Platform Elasticsearch Taxonomy Index + required: true + value: 'taxonomy_3.0.0' + # Database + - name: TZ + description: Application timezone + required: false + value: 'America/Vancouver' + - name: DB_SERVICE_NAME + description: 'Database service name associated with deployment' + required: true + # Keycloak + - name: KEYCLOAK_HOST + description: Key clock login url + required: true + - name: KEYCLOAK_REALM + description: Realm identifier or name + required: true + - name: KEYCLOAK_CLIENT_ID + description: Client Id for application + required: true + # Keycloak secret + - name: KEYCLOAK_SECRET + description: The name of the keycloak secret + required: true + # Keycloak Service Client + - name: KEYCLOAK_ADMIN_USERNAME + description: keycloak host admin username + required: true + - name: KEYCLOAK_SECRET_ADMIN_PASSWORD_KEY + description: The key of the admin password in the keycloak secret + required: true + # Keycloak CSS API + - name: KEYCLOAK_API_TOKEN_URL + description: The url to fetch a css api access token, which is needed to call the css rest api + required: true + - name: KEYCLOAK_API_CLIENT_ID + description: The css api client id + required: true + - name: KEYCLOAK_API_CLIENT_SECRET_KEY + description: The css api client secret + required: true + - name: KEYCLOAK_API_HOST + description: The url of the css rest api + required: true + - name: KEYCLOAK_API_ENVIRONMENT + description: The css api environment to query (dev, test, prod) + required: true + # Object Store (S3) + - name: OBJECT_STORE_SECRETS + description: Secrets used to read and write to the S3 storage + value: 'sims-object-store' + - name: S3_KEY_PREFIX + description: S3 key optional prefix + required: false + value: 'sims' + # Log level + - name: LOG_LEVEL + value: 'info' + # GCNotify + - name: GCNOTIFY_API_SECRET + description: Secret for gcnotify api key + value: 'gcnotify-api-key' + - name: GCNOTIFY_ADMIN_EMAIL + description: admin email for gcnotify api + value: biohub@gov.bc.ca + - name: GCNOTIFY_ONBOARDING_REQUEST_EMAIL_TEMPLATE + description: gcnotify email template id + value: 7779a104-b863-40ac-902f-1aa607d2071a + - name: GCNOTIFY_ONBOARDING_REQUEST_SMS_TEMPLATE + description: gcnotify sms template id + value: af2f1e40-bd72-4612-9c5a-567ee5b26ca5 + - name: GCNOTIFY_REQUEST_RESUBMIT_TEMPLATE + description: gcnotify request resubmit email template + value: c973da33-1f2b-435a-9429-d8ab4fd273c5 + - name: GCNOTIFY_EMAIL_URL + value: https://api.notification.canada.ca/v2/notifications/email + - name: GCNOTIFY_SMS_URL + value: https://api.notification.canada.ca/v2/notifications/sms + # Openshift Resources + - name: CPU_REQUEST + value: '50m' + - name: CPU_LIMIT + value: '500m' + - name: MEMORY_REQUEST + value: '100Mi' + - name: MEMORY_LIMIT + value: '2Gi' + - name: REPLICAS + value: '1' + - name: REPLICAS_MAX + value: '1' +objects: + - apiVersion: image.openshift.io/v1 + kind: ImageStream + metadata: + annotations: + description: Nodejs Runtime Image + labels: + shared: 'true' + generation: 0 + name: ${NAME} + spec: + lookupPolicy: + local: false + status: + dockerImageRepository: null + + - kind: DeploymentConfig + apiVersion: apps.openshift.io/v1 + metadata: + annotations: + openshift.io/generated-by: OpenShiftWebConsole + generation: 0 + labels: + role: api + name: ${NAME}${SUFFIX} + spec: + replicas: ${{REPLICAS}} + revisionHistoryLimit: 10 + selector: + deploymentConfig: ${NAME}${SUFFIX} + strategy: + activeDeadlineSeconds: 21600 + recreateParams: + timeoutSeconds: 600 + resources: + requests: + cpu: ${CPU_REQUEST} + memory: ${MEMORY_REQUEST} + limits: + cpu: ${CPU_LIMIT} + memory: ${MEMORY_LIMIT} + type: Rolling + template: + metadata: + annotations: null + labels: + deploymentConfig: ${NAME}${SUFFIX} + role: api + spec: + containers: + - env: + - name: API_HOST + value: ${HOST} + - name: API_PORT + value: ${API_PORT_DEFAULT} + - name: APP_HOST + value: ${APP_HOST} + - name: VERSION + value: ${VERSION} + - name: CHANGE_VERSION + value: ${CHANGE_ID} + - name: NODE_ENV + value: ${NODE_ENV} + # BioHub Platform (aka: Backbone) + - name: BACKBONE_API_HOST + value: ${BACKBONE_API_HOST} + - name: BACKBONE_INTAKE_PATH + value: ${BACKBONE_INTAKE_PATH} + - name: BACKBONE_ARTIFACT_INTAKE_PATH + value: ${BACKBONE_ARTIFACT_INTAKE_PATH} + - name: BACKBONE_INTAKE_ENABLED + value: ${BACKBONE_INTAKE_ENABLED} + # BCTW / Critterbase + - name: CB_API_HOST + value: ${CB_API_HOST} + - name: BCTW_API_HOST + value: ${BCTW_API_HOST} + # Clamav + - name: ENABLE_FILE_VIRUS_SCAN + value: ${ENABLE_FILE_VIRUS_SCAN} + - name: CLAMAV_HOST + value: ${CLAMAV_HOST} + - name: CLAMAV_PORT + value: ${CLAMAV_PORT} + # Database + - name: TZ + value: ${TZ} + - name: DB_HOST + value: ${DB_SERVICE_NAME} + - name: DB_USER_API + valueFrom: + secretKeyRef: + key: database-user-api + name: ${DB_SERVICE_NAME} + - name: DB_USER_API_PASS + valueFrom: + secretKeyRef: + key: database-user-api-password + name: ${DB_SERVICE_NAME} + - name: DB_DATABASE + valueFrom: + secretKeyRef: + key: database-name + name: ${DB_SERVICE_NAME} + - name: DB_PORT + value: '5432' + - name: PROJECT_SEEDER_USER_IDENTIFIER + value: ${PROJECT_SEEDER_USER_IDENTIFIER} + # Keycloak + - name: KEYCLOAK_HOST + value: ${KEYCLOAK_HOST} + - name: KEYCLOAK_REALM + value: ${KEYCLOAK_REALM} + - name: KEYCLOAK_CLIENT_ID + value: ${KEYCLOAK_CLIENT_ID} + # Keycloak Service Client + - name: KEYCLOAK_ADMIN_USERNAME + value: ${KEYCLOAK_ADMIN_USERNAME} + - name: KEYCLOAK_ADMIN_PASSWORD + valueFrom: + secretKeyRef: + name: ${KEYCLOAK_SECRET} + key: ${KEYCLOAK_SECRET_ADMIN_PASSWORD_KEY} + # Keycloak CSS API + - name: KEYCLOAK_API_TOKEN_URL + value: ${KEYCLOAK_API_TOKEN_URL} + - name: KEYCLOAK_API_CLIENT_ID + value: ${KEYCLOAK_API_CLIENT_ID} + - name: KEYCLOAK_API_CLIENT_SECRET + valueFrom: + secretKeyRef: + name: ${KEYCLOAK_SECRET} + key: ${KEYCLOAK_API_CLIENT_SECRET_KEY} + - name: KEYCLOAK_API_HOST + value: ${KEYCLOAK_API_HOST} + - name: KEYCLOAK_API_ENVIRONMENT + value: ${KEYCLOAK_API_ENVIRONMENT} + # Elastic Search + - name: ELASTICSEARCH_URL + value: ${ELASTICSEARCH_URL} + - name: ELASTICSEARCH_TAXONOMY_INDEX + value: ${ELASTICSEARCH_TAXONOMY_INDEX} + - name: S3_KEY_PREFIX + value: ${S3_KEY_PREFIX} + # Object Store (S3) + - name: OBJECT_STORE_URL + valueFrom: + secretKeyRef: + key: object_store_url + name: ${OBJECT_STORE_SECRETS} + - name: OBJECT_STORE_ACCESS_KEY_ID + valueFrom: + secretKeyRef: + key: object_store_access_key_id + name: ${OBJECT_STORE_SECRETS} + - name: OBJECT_STORE_SECRET_KEY_ID + valueFrom: + secretKeyRef: + key: object_store_secret_key_id + name: ${OBJECT_STORE_SECRETS} + - name: OBJECT_STORE_BUCKET_NAME + valueFrom: + secretKeyRef: + key: object_store_bucket_name + name: ${OBJECT_STORE_SECRETS} + # Log level + - name: LOG_LEVEL + value: ${LOG_LEVEL} + # GCNotify + - name: GCNOTIFY_SECRET_API_KEY + valueFrom: + secretKeyRef: + key: key + name: ${GCNOTIFY_API_SECRET} + - name: GCNOTIFY_ADMIN_EMAIL + value: ${GCNOTIFY_ADMIN_EMAIL} + - name: GCNOTIFY_ONBOARDING_REQUEST_EMAIL_TEMPLATE + value: ${GCNOTIFY_ONBOARDING_REQUEST_EMAIL_TEMPLATE} + - name: GCNOTIFY_ONBOARDING_REQUEST_SMS_TEMPLATE + value: ${GCNOTIFY_ONBOARDING_REQUEST_SMS_TEMPLATE} + - name: GCNOTIFY_EMAIL_URL + value: ${GCNOTIFY_EMAIL_URL} + - name: GCNOTIFY_SMS_URL + value: ${GCNOTIFY_SMS_URL} + image: ' ' + imagePullPolicy: Always + name: api + ports: + - containerPort: ${{API_PORT_DEFAULT}} + protocol: TCP + resources: + requests: + cpu: ${CPU_REQUEST} + memory: ${MEMORY_REQUEST} + limits: + cpu: ${CPU_LIMIT} + memory: ${MEMORY_LIMIT} + readinessProbe: + httpGet: + path: /api/version + port: ${{API_PORT_DEFAULT}} + scheme: HTTP + initialDelaySeconds: 60 + periodSeconds: 30 + timeoutSeconds: 15 + successThreshold: 1 + failureThreshold: 20 + livenessProbe: + httpGet: + path: /api/version + port: ${{API_PORT_DEFAULT}} + scheme: HTTP + initialDelaySeconds: 60 + periodSeconds: 30 + timeoutSeconds: 15 + successThreshold: 1 + failureThreshold: 20 + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /opt/app-root/app + name: ${NAME}${SUFFIX} + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 + volumes: + - emptyDir: {} + name: ${NAME}${SUFFIX} + test: false + triggers: + - imageChangeParams: + automatic: true + containerNames: + - api + from: + kind: ImageStreamTag + name: ${NAME}:${VERSION} + type: ImageChange + - type: ConfigChange + status: + availableReplicas: 0 + latestVersion: 0 + observedGeneration: 0 + replicas: 0 + unavailableReplicas: 0 + updatedReplicas: 0 + + - kind: Secret + apiVersion: v1 + stringData: + database-name: '' + database-user-api-password: '' + database-user-api: '' + metadata: + annotations: + as-copy-of: ${DB_SERVICE_NAME} + name: ${NAME}${SUFFIX} + type: Opaque + + - apiVersion: v1 + kind: Service + metadata: + annotations: null + labels: {} + name: ${NAME}${SUFFIX} + spec: + ports: + - name: ${NAME}-${API_PORT_DEFAULT_NAME} + port: ${{API_PORT_DEFAULT}} + protocol: TCP + targetPort: ${{API_PORT_DEFAULT}} + selector: + deploymentconfig: ${NAME}${SUFFIX} + sessionAffinity: None + type: ClusterIP + status: + loadBalancer: {} + + - kind: Route + apiVersion: route.openshift.io/v1 + metadata: + annotations: + # These 2 annotations (haproxy.router.openshift.io/balance and haproxy.router.openshift.io/disable_cookies) are set in order to prevent 'sticky sessions' + # 'sticky sessions': If an API pod is busy fullfilling a request, subsequent requests will go to other API pods rather than wait for the same pod (when pod replicas is > 1) + haproxy.router.openshift.io/balance: 'leastconn' + haproxy.router.openshift.io/disable_cookies: 'true' + labels: {} + name: ${NAME}${SUFFIX} + spec: + host: ${HOST} + tls: + insecureEdgeTerminationPolicy: Redirect + termination: edge + port: + targetPort: ${NAME}-${API_PORT_DEFAULT_NAME} + to: + kind: Service + name: ${NAME}${SUFFIX} + weight: 100 + wildcardPolicy: None + status: + ingress: null + + - kind: HorizontalPodAutoscaler + apiVersion: autoscaling/v2 + metadata: + annotations: {} + labels: {} + name: ${NAME}${SUFFIX} + spec: + minReplicas: ${{REPLICAS}} + maxReplicas: ${{REPLICAS_MAX}} + scaleTargetRef: + apiVersion: apps.openshift.io/v1 + kind: DeploymentConfig + name: ${NAME}${SUFFIX} + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: 80 diff --git a/api/.pipeline2/templates/db.secret.yaml b/api/.pipeline2/templates/db.secret.yaml new file mode 100644 index 0000000000..b60dfe7412 --- /dev/null +++ b/api/.pipeline2/templates/db.secret.yaml @@ -0,0 +1,13 @@ +kind: Secret +apiVersion: v1 +metadata: + name: sims-database +data: + database-admin: + database-admin-password: + database-name: + database-user: + database-user-api: + database-user-api-password: + database-user-password: +type: Opaque diff --git a/api/.pipeline2/templates/object-store.secret.yaml b/api/.pipeline2/templates/object-store.secret.yaml new file mode 100644 index 0000000000..00a4e2fcac --- /dev/null +++ b/api/.pipeline2/templates/object-store.secret.yaml @@ -0,0 +1,10 @@ +kind: Secret +apiVersion: v1 +metadata: + name: sims-object-store +data: + object_store_access_key_id: + object_store_bucket_name: + object_store_secret_key_id: + object_store_url: +type: Opaque diff --git a/app/.pipeline/config.js b/app/.pipeline/config.js index b2308d2a52..dad1daf5ca 100644 --- a/app/.pipeline/config.js +++ b/app/.pipeline/config.js @@ -1,32 +1,59 @@ 'use strict'; -let options = require('pipeline-cli').Util.parseArguments(); +const { PipelineConfigMapSchema } = require('./utils/configMapSchema'); +const PipelineCli = require('pipeline-cli'); -// The root config for common values -const config = require('../../.config/config.json'); +// Options passed in from the git action +const rawOptions = PipelineCli.Util.parseArguments(); -const name = config.module.app; -const apiName = config.module.api; +// Pull-request number or branch name +const changeId = rawOptions.pr; -const version = config.version; - -const changeId = options.pr; // pull-request number or branch name +// Pipeline config map from openshift +const rawPipelineConfigMap = rawOptions.config; +// Validate the pipeline config map is not missing any fields +const pipelineConfigMap = PipelineConfigMapSchema.parse(JSON.parse(rawPipelineConfigMap)); // A static deployment is when the deployment is updating dev, test, or prod (rather than a temporary PR) // See `--type=static` in the `deployStatic.yml` git workflow -const isStaticDeployment = options.type === 'static'; - -const deployChangeId = (isStaticDeployment && 'deploy') || changeId; -const branch = (isStaticDeployment && options.branch) || null; -const tag = (branch && `build-${version}-${changeId}-${branch}`) || `build-${version}-${changeId}`; - -const staticUrls = config.staticUrls || {}; -const staticUrlsAPI = config.staticUrlsAPI || {}; - -const maxUploadNumFiles = 10; -const maxUploadFileSize = 52428800; // (bytes) - -const processOptions = (options) => { +const isStaticDeployment = rawOptions.type === 'static'; + +// const deployChangeId = (isStaticDeployment && 'deploy') || changeId; +const branch = (isStaticDeployment && rawOptions.branch) || null; +const tag = + (branch && `build-${pipelineConfigMap.version}-${changeId}-${branch}`) || + `build-${pipelineConfigMap.version}-${changeId}`; + +// const maxUploadNumFiles = 10; +// const maxUploadFileSize = 52428800; // (bytes) + +/** + * Parses the npm cli command options and the git action context. + * + * @param {*} options + * @return {{ + * git: { + * dir: '', + * branch: { + * name: '', + * remote: '', + * merge: '' + * }, + * url: 'https://github.com/bcgov/biohubbc.git', + * uri: 'https://github.com/bcgov/biohubbc', + * http_url: 'https://github.com/bcgov/biohubbc.git', + * owner: 'bcgov', + * repository: 'biohubbc', + * pull_request: '', + * ref: '', + * branch_ref: '' + * }, + * pr: '', + * config: {}, // JSON config map + * type?: 'static' + * }} + */ +function processOptions(options) { const result = { ...options }; // Check git @@ -46,99 +73,132 @@ const processOptions = (options) => { } return result; -}; +} -options = processOptions(options); +const options = processOptions(rawOptions); const phases = { build: { + ...pipelineConfigMap.app.build, namespace: 'af2668-tools', - name: `${name}`, + name: pipelineConfigMap.module.app, phase: 'build', changeId: changeId, suffix: `-build-${changeId}`, - instance: `${name}-build-${changeId}`, - version: `${version}-${changeId}`, + instance: `${pipelineConfigMap.module.app}-build-${changeId}`, + version: `${pipelineConfigMap.version}-${changeId}`, tag: tag, - branch: branch, - cpuRequest: '50m', - cpuLimit: '2000m', - memoryRequest: '100Mi', - memoryLimit: '6Gi' + branch: branch + // cpuRequest: '50m', + // cpuLimit: '1000m', + // memoryRequest: '100Mi', + // memoryLimit: '5Gi' + }, + pr: { + ...pipelineConfigMap.app.deploy.pr, + namespace: 'af2668-dev', + name: pipelineConfigMap.module.app, + phase: 'dev', + changeId: changeId, + suffix: `-dev-${changeId}`, + instance: `${pipelineConfigMap.module.app}-dev-${changeId}`, + version: `${changeId}-${changeId}`, + tag: `dev-${pipelineConfigMap.version}-${changeId}`, + host: `${pipelineConfigMap.module.app}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, + apiHost: `${pipelineConfigMap.module.api}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, + // siteminderLogoutURL: pipelineConfigMap.siteminderLogoutURL.dev, + // maxUploadNumFiles, + // maxUploadFileSize, + env: 'dev', + sso: pipelineConfigMap.sso.dev + // cpuRequest: '50m', + // cpuLimit: '200m', + // memoryRequest: '100Mi', + // memoryLimit: '333Mi', + // replicas: (isStaticDeployment && '1') || '1', + // replicasMax: (isStaticDeployment && '2') || '1' }, dev: { + ...pipelineConfigMap.app.deploy.dev, namespace: 'af2668-dev', - name: `${name}`, + name: pipelineConfigMap.module.app, phase: 'dev', - changeId: deployChangeId, - suffix: `-dev-${deployChangeId}`, - instance: `${name}-dev-${deployChangeId}`, - version: `${deployChangeId}-${changeId}`, - tag: `dev-${version}-${deployChangeId}`, - host: (isStaticDeployment && staticUrls.dev) || `${name}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, - apiHost: - (isStaticDeployment && staticUrlsAPI.dev) || `${apiName}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, - siteminderLogoutURL: config.siteminderLogoutURL.dev, - maxUploadNumFiles, - maxUploadFileSize, + changeId: 'deploy', + suffix: '-dev-deploy', + instance: `${pipelineConfigMap.module.app}-dev-deploy`, + version: `deploy-${changeId}`, + tag: `dev-${pipelineConfigMap.version}-deploy`, + host: pipelineConfigMap.app.deploy.dev.staticAppUrl, + apiHost: pipelineConfigMap.app.deploy.dev.staticApiUrl, + // siteminderLogoutURL: pipelineConfigMap.siteminderLogoutURL.dev, + // maxUploadNumFiles, + // maxUploadFileSize, nodeEnv: 'development', - sso: config.sso.dev, - cpuRequest: '50m', - cpuLimit: '300m', - memoryRequest: '100Mi', - memoryLimit: '500Mi', - replicas: (isStaticDeployment && '1') || '1', - replicasMax: (isStaticDeployment && '2') || '1', + sso: pipelineConfigMap.sso.dev + // cpuRequest: '50m', + // cpuLimit: '200m', + // memoryRequest: '100Mi', + // memoryLimit: '333Mi', + // replicas: (isStaticDeployment && '1') || '1', + // replicasMax: (isStaticDeployment && '2') || '1', biohubFeatureFlag: 'true' }, test: { + ...pipelineConfigMap.app.deploy.test, namespace: 'af2668-test', - name: `${name}`, + name: pipelineConfigMap.module.app, phase: 'test', - changeId: deployChangeId, + changeId: 'deploy', suffix: `-test`, - instance: `${name}-test`, - version: `${version}`, - tag: `test-${version}`, - host: staticUrls.test, - apiHost: staticUrlsAPI.test, - siteminderLogoutURL: config.siteminderLogoutURL.test, - maxUploadNumFiles, - maxUploadFileSize, + instance: `${pipelineConfigMap.module.app}-test`, + version: pipelineConfigMap.version, + tag: `test-${pipelineConfigMap.version}`, + host: pipelineConfigMap.app.deploy.test.staticAppUrl, + apiHost: pipelineConfigMap.app.deploy.test.staticApiUrl, + // siteminderLogoutURL: pipelineConfigMap.siteminderLogoutURL.test, + // maxUploadNumFiles, + // maxUploadFileSize, nodeEnv: 'production', - sso: config.sso.test, - cpuRequest: '50m', - cpuLimit: '500m', - memoryRequest: '100Mi', - memoryLimit: '500Mi', - replicas: '2', - replicasMax: '3', + sso: pipelineConfigMap.sso.test + // cpuRequest: '50m', + // cpuLimit: '500m', + // memoryRequest: '100Mi', + // memoryLimit: '500Mi', + // replicas: '2', + // replicasMax: '3', biohubFeatureFlag: 'false' }, prod: { + ...pipelineConfigMap.app.deploy.prod, namespace: 'af2668-prod', - name: `${name}`, + name: pipelineConfigMap.module.app, phase: 'prod', - changeId: deployChangeId, + changeId: 'deploy', suffix: `-prod`, - instance: `${name}-prod`, - version: `${version}`, - tag: `prod-${version}`, - host: staticUrls.prod, - apiHost: staticUrlsAPI.prod, - siteminderLogoutURL: config.siteminderLogoutURL.prod, - maxUploadNumFiles, - maxUploadFileSize, + instance: `${pipelineConfigMap.module.app}-prod`, + version: pipelineConfigMap.version, + tag: `prod-${pipelineConfigMap.version}`, + host: pipelineConfigMap.app.deploy.prod.staticAppUrl, + apiHost: pipelineConfigMap.app.deploy.prod.staticApiUrl, + // siteminderLogoutURL: pipelineConfigMap.siteminderLogoutURL.prod, + // maxUploadNumFiles, + // maxUploadFileSize, nodeEnv: 'production', - sso: config.sso.prod, - cpuRequest: '50m', - cpuLimit: '500m', - memoryRequest: '100Mi', - memoryLimit: '500Mi', - replicas: '2', - replicasMax: '3', + sso: pipelineConfigMap.sso.prod + // cpuRequest: '50m', + // cpuLimit: '500m', + // memoryRequest: '100Mi', + // memoryLimit: '500Mi', + // replicas: '2', + // replicasMax: '3', biohubFeatureFlag: 'false' } }; +console.log('1=============================================='); +console.log('api phases', phases); +console.log('2=============================================='); +console.log('api options', options); +console.log('3=============================================='); + module.exports = exports = { phases, options }; diff --git a/app/.pipeline/lib/app.build.js b/app/.pipeline/lib/app.build.js index 9f3aab0634..04d53983d1 100644 --- a/app/.pipeline/lib/app.build.js +++ b/app/.pipeline/lib/app.build.js @@ -6,18 +6,16 @@ const path = require('path'); /** * Build the app image. * - * @param {*} settings + * @param {*} { phases, options } */ -const appBuild = (settings) => { - const phases = settings.phases; - const options = settings.options; +const appBuild = ({ phases, options }) => { const phase = settings.phase; const oc = new OpenShiftClientX(Object.assign({ namespace: phases[phase].namespace }, options)); const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, '../templates')); - let objects = []; + const objects = []; objects.push( ...oc.processDeploymentTemplate(`${templatesLocalBaseUrl}/app.bc.yaml`, { @@ -26,7 +24,7 @@ const appBuild = (settings) => { SUFFIX: phases[phase].suffix, VERSION: phases[phase].tag, SOURCE_REPOSITORY_URL: oc.git.http_url, - SOURCE_REPOSITORY_REF: phases[phase].branch || oc.git.ref, + SOURCE_REPOSITORY_REF: phases[phase].branch, CPU_REQUEST: phases[phase].cpuRequest, CPU_LIMIT: phases[phase].cpuLimit, MEMORY_REQUEST: phases[phase].memoryRequest, diff --git a/app/.pipeline/package-lock.json b/app/.pipeline/package-lock.json index a469f9f2c8..8692f80f08 100644 --- a/app/.pipeline/package-lock.json +++ b/app/.pipeline/package-lock.json @@ -53,6 +53,11 @@ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz", "integrity": "sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==", "dev": true + }, + "zod": { + "version": "3.22.4", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.4.tgz", + "integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==" } } } diff --git a/app/.pipeline/package.json b/app/.pipeline/package.json index 2f173398ef..686f125738 100644 --- a/app/.pipeline/package.json +++ b/app/.pipeline/package.json @@ -26,7 +26,8 @@ "lodash.isfunction": "^3.0.9", "lodash.isplainobject": "^4.0.6", "lodash.isstring": "^4.0.1", - "pipeline-cli": "git+https://github.com/NickPhura/pipeline-cli.git" + "pipeline-cli": "git+https://github.com/NickPhura/pipeline-cli.git", + "zod": "^3.21.4" }, "devDependencies": { "prettier": "~2.3.2" diff --git a/app/.pipeline/scripts/app.build.js b/app/.pipeline/scripts/app.build.js index aeafd09c2a..341763e97d 100644 --- a/app/.pipeline/scripts/app.build.js +++ b/app/.pipeline/scripts/app.build.js @@ -1,8 +1,9 @@ 'use strict'; -const config = require('../config.js'); const { appBuild } = require('../lib/app.build.js'); +const config = require('../config.js'); const settings = { ...config, phase: 'build' }; +// Builds the app image appBuild(settings); diff --git a/app/.pipeline/utils/configMapSchema.js b/app/.pipeline/utils/configMapSchema.js new file mode 100644 index 0000000000..d0d62010c9 --- /dev/null +++ b/app/.pipeline/utils/configMapSchema.js @@ -0,0 +1,271 @@ +const z = require('zod'); + +const PipelineConfigMapSchema = z.object({ + name: z.string(), + namespaceSuffix: z.string(), + namespace: z.object({ + tools: z.string(), + dev: z.string(), + test: z.string(), + prod: z.string() + }), + version: z.string(), + module: z.object({ + db: z.string(), + api: z.string(), + app: z.string() + }), + api: z.object({ + build: z.object({ + tz: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() + }), + deploy: z.object({ + pr: z.object({ + tz: z.string(), + backboneApiHost: z.string(), + backboneIntakePath: z.string(), + backboneArtifactIntakePath: z.string(), + backboneIntakeEnabled: z.boolean(), + bctwApiHost: z.string(), + critterbaseApiHost: z.string(), + elasticsearchURL: z.string(), + elasticsearchTaxonomyIndex: z.string(), + s3KeyPrefix: z.string(), + logLevel: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + replicasMax: z.string() + }), + dev: z.object({ + staticApiUrl: z.string(), + staticAppUrl: z.string(), + tz: z.string(), + backboneApiHost: z.string(), + backboneIntakePath: z.string(), + backboneArtifactIntakePath: z.string(), + backboneIntakeEnabled: z.boolean(), + bctwApiHost: z.string(), + critterbaseApiHost: z.string(), + elasticsearchURL: z.string(), + elasticsearchTaxonomyIndex: z.string(), + s3KeyPrefix: z.string(), + logLevel: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + replicasMax: z.string() + }), + test: z.object({ + staticApiUrl: z.string(), + staticAppUrl: z.string(), + tz: z.string(), + backboneApiHost: z.string(), + backboneIntakePath: z.string(), + backboneArtifactIntakePath: z.string(), + backboneIntakeEnabled: z.boolean(), + bctwApiHost: z.string(), + critterbaseApiHost: z.string(), + elasticsearchURL: z.string(), + elasticsearchTaxonomyIndex: z.string(), + s3KeyPrefix: z.string(), + logLevel: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + replicasMax: z.string() + }), + prod: z.object({ + staticApiUrl: z.string(), + staticAppUrl: z.string(), + staticAppVanityUrl: z.string(), + tz: z.string(), + backboneApiHost: z.string(), + backboneIntakePath: z.string(), + backboneArtifactIntakePath: z.string(), + backboneIntakeEnabled: z.boolean(), + bctwApiHost: z.string(), + critterbaseApiHost: z.string(), + elasticsearchURL: z.string(), + elasticsearchTaxonomyIndex: z.string(), + s3KeyPrefix: z.string(), + logLevel: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + replicasMax: z.string() + }) + }) + }), + app: z.object({ + build: z.object({ + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() + }), + deploy: z.object({ + pr: z.object({ + siteminderLogoutURL: z.string(), + maxUploadNumFiles: z.number(), + maxUploadFileSize: z.number(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + replicasMax: z.string() + }), + dev: z.object({ + staticApiUrl: z.string(), + staticAppUrl: z.string(), + siteminderLogoutURL: z.string(), + maxUploadNumFiles: z.number(), + maxUploadFileSize: z.number(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + replicasMax: z.string() + }), + test: z.object({ + staticApiUrl: z.string(), + staticAppUrl: z.string(), + siteminderLogoutURL: z.string(), + maxUploadNumFiles: z.number(), + maxUploadFileSize: z.number(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + replicasMax: z.string() + }), + prod: z.object({ + staticApiUrl: z.string(), + staticAppUrl: z.string(), + staticAppVanityUrl: z.string(), + siteminderLogoutURL: z.string(), + maxUploadNumFiles: z.number(), + maxUploadFileSize: z.number(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + replicasMax: z.string() + }) + }) + }), + database: z.object({ + build: z.object({ + tz: z.string() + }), + deploy: z.object({ + pr: z.object({ + tz: z.string(), + volumeCapacity: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string() + }), + dev: z.object({ + tz: z.string(), + volumeCapacity: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string() + }), + test: z.object({ + tz: z.string(), + volumeCapacity: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string() + }), + prod: z.object({ + tz: z.string(), + volumeCapacity: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string() + }) + }) + }), + sso: z.object({ + dev: z.object({ + host: z.string(), + realm: z.string(), + clientId: z.string(), + keycloakSecret: z.string(), + serviceClient: z.object({ + serviceClientName: z.string(), + keycloakSecretServiceClientPasswordKey: z.string() + }), + cssApi: z.object({ + cssApiTokenUrl: z.string(), + cssApiClientId: z.string(), + cssApiHost: z.string(), + keycloakSecretCssApiSecretKey: z.string(), + cssApiEnvironment: z.string() + }) + }), + test: z.object({ + host: z.string(), + realm: z.string(), + clientId: z.string(), + keycloakSecret: z.string(), + serviceClient: z.object({ + serviceClientName: z.string(), + keycloakSecretServiceClientPasswordKey: z.string() + }), + cssApi: z.object({ + cssApiTokenUrl: z.string(), + cssApiClientId: z.string(), + cssApiHost: z.string(), + keycloakSecretCssApiSecretKey: z.string(), + cssApiEnvironment: z.string() + }) + }), + prod: z.object({ + host: z.string(), + realm: z.string(), + clientId: z.string(), + keycloakSecret: z.string(), + serviceClient: z.object({ + serviceClientName: z.string(), + keycloakSecretServiceClientPasswordKey: z.string() + }), + cssApi: z.object({ + cssApiTokenUrl: z.string(), + cssApiClientId: z.string(), + cssApiHost: z.string(), + keycloakSecretCssApiSecretKey: z.string(), + cssApiEnvironment: z.string() + }) + }) + }) +}); + +module.exports = exports = { PipelineConfigMapSchema }; diff --git a/app/.pipeline2/templates/app.bc.yaml b/app/.pipeline2/templates/app.bc.yaml new file mode 100644 index 0000000000..db2e0bcd3b --- /dev/null +++ b/app/.pipeline2/templates/app.bc.yaml @@ -0,0 +1,119 @@ +apiVersion: template.openshift.io/v1 +kind: Template +metadata: + name: sims-app-bc-2 + labels: + build: sims-app +parameters: + - name: NAME + required: true + value: 'sims-app-2' + - name: VERSION + required: true + value: '1.0' + - name: SOURCE_CONTEXT_DIR + required: true + value: app + - name: SOURCE_REPOSITORY_URL + required: true + value: https://github.com/bcgov/biohubbc + - name: SOURCE_REPOSITORY_REF + required: true + value: dev + - name: BASE_IMAGE_URL + required: true + value: image-registry.openshift-image-registry.svc:5000/openshift/nodejs:14-ubi8 + - name: SOURCE_IMAGE_NAME + required: true + value: nodejs + - name: SOURCE_IMAGE_TAG + required: true + value: 14-ubi8 + - name: CPU_REQUEST + required: true + value: '50m' + - name: CPU_LIMIT + required: true + value: '1000m' + - name: MEMORY_REQUEST + required: true + value: '100Mi' + - name: MEMORY_LIMIT + required: true + value: '5Gi' +objects: + - kind: ImageStream + apiVersion: image.openshift.io/v1 + metadata: + name: ${SOURCE_IMAGE_NAME} + annotations: + description: Nodejs Base Image + labels: + shared: 'true' + spec: + lookupPolicy: + local: false + tags: + - name: ${SOURCE_IMAGE_TAG} + annotations: null + from: + kind: DockerImage + name: ${BASE_IMAGE_URL} + importPolicy: {} + referencePolicy: + type: Local + + - kind: ImageStream + apiVersion: image.openshift.io/v1 + metadata: + name: '${NAME}' + annotations: + description: Nodejs Runtime Image + labels: + shared: 'true' + spec: + lookupPolicy: + local: false + + - kind: BuildConfig + apiVersion: build.openshift.io/v1 + metadata: + name: '${NAME}' + labels: {} + annotations: {} + spec: + failedBuildsHistoryLimit: 5 + nodeSelector: + output: + to: + kind: ImageStreamTag + name: '${NAME}:${VERSION}' + postCommit: {} + resources: + requests: + cpu: ${CPU_REQUEST} + memory: ${MEMORY_REQUEST} + limits: + cpu: ${CPU_LIMIT} + memory: ${MEMORY_LIMIT} + runPolicy: Serial + source: + contextDir: '${SOURCE_CONTEXT_DIR}' + git: + uri: '${SOURCE_REPOSITORY_URL}' + ref: '${SOURCE_REPOSITORY_REF}' + type: Git + strategy: + dockerStrategy: + from: + kind: ImageStreamTag + name: ${SOURCE_IMAGE_NAME}:${SOURCE_IMAGE_TAG} + type: Docker + successfulBuildsHistoryLimit: 5 + triggers: + - type: ConfigChange + - type: ImageChange + - type: GitHub + github: + secretReference: + name: sims-github-webhook-secret \ No newline at end of file diff --git a/app/.pipeline2/templates/app.dc.yaml b/app/.pipeline2/templates/app.dc.yaml new file mode 100644 index 0000000000..5593575582 --- /dev/null +++ b/app/.pipeline2/templates/app.dc.yaml @@ -0,0 +1,263 @@ +apiVersion: template.openshift.io/v1 +kind: Template +metadata: + name: sims-app-dc-2 + labels: + build: sims-app +parameters: + - name: NAME + required: true + value: 'sims-app-2' + - name: VERSION + required: true + value: 'latest' + - name: HOST + required: true + value: 'dev-sims.apps.silver.devops.gov.bc.ca' + - name: CHANGE_ID + - name: REACT_APP_API_HOST + required: true + description: API host for application backend + value: '' + - name: REACT_APP_SITEMINDER_LOGOUT_URL + required: true + description: Siteminder URL to log out and clear the session for the logged in user + value: '' + - name: REACT_APP_MAX_UPLOAD_NUM_FILES + required: true + description: Default maximum number of files that can be uploaded at a time vai the upload component UI. + value: '10' + - name: REACT_APP_MAX_UPLOAD_FILE_SIZE + required: true + description: Default maximum size of a single file that can be uploaded by the upload component UI. + value: '52428800' + - name: NODE_ENV + required: true + description: NODE_ENV specification variable + value: 'dev' + - name: REACT_APP_NODE_ENV + required: true + description: NODE_ENV specification variable for React app + value: 'dev' + - name: OBJECT_STORE_SECRETS + required: true + description: Secrets used to read and write to the S3 storage + value: 'sims-object-store' + - name: APP_PORT_DEFAULT + description: Application default port + required: true + value: '7100' + - name: APP_PORT_DEFAULT_NAME + description: Default port resource name + required: true + value: '7100-tcp' + - name: REACT_APP_KEYCLOAK_HOST + description: Key clock login url + required: true + - name: REACT_APP_KEYCLOAK_REALM + description: Realm identifier or name + required: true + - name: REACT_APP_KEYCLOAK_CLIENT_ID + description: Client Id for application + required: true + - name: CONFIG_MAP_NAME + required: true + value: 'sims-pipeline-config' + - name: CPU_REQUEST + required: true + value: '50m' + - name: CPU_LIMIT + required: true + value: '200m' + - name: MEMORY_REQUEST + required: true + value: '50Mi' + - name: MEMORY_LIMIT + required: true + value: '200Mi' + - name: REPLICAS + required: true + value: '1' + - name: REPLICAS_MAX + required: true + value: '1' +objects: + - kind: DeploymentConfig + apiVersion: apps.openshift.io/v1 + metadata: + annotations: + openshift.io/generated-by: OpenShiftWebConsole + generation: 0 + labels: + role: app + name: ${NAME} + spec: + replicas: ${{REPLICAS}} + revisionHistoryLimit: 10 + selector: + deploymentConfig: ${NAME} + strategy: + activeDeadlineSeconds: 21600 + recreateParams: + timeoutSeconds: 600 + resources: + requests: + cpu: ${CPU_REQUEST} + memory: ${MEMORY_REQUEST} + limits: + cpu: ${CPU_LIMIT} + memory: ${MEMORY_LIMIT} + type: Rolling + template: + metadata: + annotations: null + labels: + deploymentConfig: ${NAME} + role: app + spec: + containers: + - env: + - name: CHANGE_VERSION + value: ${CHANGE_ID} + - name: REACT_APP_API_HOST + value: ${REACT_APP_API_HOST} + - name: REACT_APP_SITEMINDER_LOGOUT_URL + value: ${REACT_APP_SITEMINDER_LOGOUT_URL} + - name: REACT_APP_MAX_UPLOAD_NUM_FILES + value: ${REACT_APP_MAX_UPLOAD_NUM_FILES} + - name: REACT_APP_MAX_UPLOAD_FILE_SIZE + value: ${REACT_APP_MAX_UPLOAD_FILE_SIZE} + - name: OBJECT_STORE_URL + valueFrom: + secretKeyRef: + key: object_store_url + name: ${OBJECT_STORE_SECRETS} + - name: OBJECT_STORE_BUCKET_NAME + valueFrom: + secretKeyRef: + key: object_store_bucket_name + name: ${OBJECT_STORE_SECRETS} + - name: NODE_ENV + value: ${NODE_ENV} + - name: REACT_APP_NODE_ENV + value: ${REACT_APP_NODE_ENV} + - name: VERSION + value: ${VERSION} + - name: REACT_APP_KEYCLOAK_HOST + value: ${REACT_APP_KEYCLOAK_HOST} + - name: REACT_APP_KEYCLOAK_REALM + value: ${REACT_APP_KEYCLOAK_REALM} + - name: REACT_APP_KEYCLOAK_CLIENT_ID + value: ${REACT_APP_KEYCLOAK_CLIENT_ID} + image: ' ' + imagePullPolicy: Always + name: app + ports: + - containerPort: ${{APP_PORT_DEFAULT}} + protocol: TCP + resources: + requests: + cpu: ${CPU_REQUEST} + memory: ${MEMORY_REQUEST} + limits: + cpu: ${CPU_LIMIT} + memory: ${MEMORY_LIMIT} + readinessProbe: + httpGet: + path: / + port: ${{APP_PORT_DEFAULT}} + scheme: HTTP + initialDelaySeconds: 60 + periodSeconds: 30 + timeoutSeconds: 15 + successThreshold: 1 + failureThreshold: 20 + livenessProbe: + httpGet: + path: / + port: ${{APP_PORT_DEFAULT}} + scheme: HTTP + initialDelaySeconds: 60 + periodSeconds: 30 + timeoutSeconds: 15 + successThreshold: 1 + failureThreshold: 20 + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 + volumes: + - name: config-volume + configMap: + name: ${CONFIG_MAP_NAME} + test: false + triggers: + - imageChangeParams: + automatic: true + containerNames: + - app + from: + kind: ImageStreamTag + name: ${NAME}:${VERSION} + type: ImageChange + - type: ConfigChange + + - kind: Service + apiVersion: v1 + metadata: + annotations: null + labels: {} + name: ${NAME} + spec: + ports: + - name: ${NAME}-${APP_PORT_DEFAULT_NAME} + port: ${{APP_PORT_DEFAULT}} + protocol: TCP + targetPort: ${{APP_PORT_DEFAULT}} + selector: + deploymentconfig: ${NAME} + sessionAffinity: None + type: ClusterIP + + - kind: Route + apiVersion: route.openshift.io/v1 + metadata: + annotations: {} + labels: {} + name: ${NAME} + spec: + host: ${HOST} + tls: + insecureEdgeTerminationPolicy: Redirect + termination: edge + port: + targetPort: ${NAME}-${APP_PORT_DEFAULT_NAME} + to: + kind: Service + name: ${NAME} + weight: 100 + wildcardPolicy: None + + - kind: HorizontalPodAutoscaler + apiVersion: autoscaling/v2 + metadata: + annotations: {} + labels: {} + name: ${NAME} + spec: + minReplicas: ${{REPLICAS}} + maxReplicas: ${{REPLICAS_MAX}} + scaleTargetRef: + apiVersion: apps.openshift.io/v1 + kind: DeploymentConfig + name: ${NAME} + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: 80 diff --git a/app/.pipeline2/templates/github-webhook.secret.yaml b/app/.pipeline2/templates/github-webhook.secret.yaml new file mode 100644 index 0000000000..94eb871bbe --- /dev/null +++ b/app/.pipeline2/templates/github-webhook.secret.yaml @@ -0,0 +1,8 @@ +kind: Secret +apiVersion: v1 +metadata: + name: sims-github-webhook-secret + namespace: af2668-tools +data: + WebHookSecretKey: +type: Opaque diff --git a/database/.pipeline/config.js b/database/.pipeline/config.js index dd19223dfc..99fe73a9f5 100644 --- a/database/.pipeline/config.js +++ b/database/.pipeline/config.js @@ -1,23 +1,28 @@ 'use strict'; -let options = require('pipeline-cli').Util.parseArguments(); +const { PipelineConfigMapSchema } = require('./utils/configMapSchema'); +const PipelineCli = require('pipeline-cli'); -// The root config for common values -const config = require('../../.config/config.json'); +// Options passed in from the git action +const rawOptions = PipelineCli.Util.parseArguments(); -const name = config.module.db; +// Pull-request number or branch name +const changeId = rawOptions.pr; -const version = config.version; - -const changeId = options.pr; // pull-request number or branch name +// Pipeline config map from openshift +const rawPipelineConfigMap = rawOptions.config; +// Validate the pipeline config map is not missing any fields +const pipelineConfigMap = PipelineConfigMapSchema.parse(JSON.parse(rawPipelineConfigMap)); // A static deployment is when the deployment is updating dev, test, or prod (rather than a temporary PR) // See `--type=static` in the `deployStatic.yml` git workflow -const isStaticDeployment = options.type === 'static'; +const isStaticDeployment = rawOptions.type === 'static'; const deployChangeId = (isStaticDeployment && 'deploy') || changeId; -const branch = (isStaticDeployment && options.branch) || null; -const tag = (branch && `build-${version}-${changeId}-${branch}`) || `build-${version}-${changeId}`; +const branch = (isStaticDeployment && rawOptions.branch) || null; +const tag = + (branch && `build-${pipelineConfigMap.version}-${changeId}-${branch}`) || + `build-${pipelineConfigMap.version}-${changeId}`; // Default: run both seeding and migrations let dbSetupDockerfilePath = './.docker/db/Dockerfile.setup'; @@ -26,7 +31,33 @@ if (isStaticDeployment && options.branch === 'prod') { dbSetupDockerfilePath = './.docker/db/Dockerfile.migrate'; } -const processOptions = (options) => { +/** + * Parses the npm cli command options and the git action context. + * + * @param {*} options + * @return {{ + * git: { + * dir: '', + * branch: { + * name: '', + * remote: '', + * merge: '' + * }, + * url: 'https://github.com/bcgov/biohubbc.git', + * uri: 'https://github.com/bcgov/biohubbc', + * http_url: 'https://github.com/bcgov/biohubbc.git', + * owner: 'bcgov', + * repository: 'biohubbc', + * pull_request: '', + * ref: '', + * branch_ref: '' + * }, + * pr: '', + * config: {}, // JSON config map + * type?: 'static' + * }} + */ +function processOptions(options) { const result = { ...options }; // Check git @@ -46,81 +77,111 @@ const processOptions = (options) => { } return result; -}; +} -options = processOptions(options); +const options = processOptions(rawOptions); const phases = { build: { + ...pipelineConfigMap.database.build, namespace: 'af2668-tools', - name: `${name}`, + name: pipelineConfigMap.module.db, phase: 'build', changeId: changeId, suffix: `-build-${changeId}`, - instance: `${name}-build-${changeId}`, - version: `${version}-${changeId}`, + instance: `${pipelineConfigMap.module.db}-build-${changeId}`, + version: `${pipelineConfigMap.version}-${changeId}`, tag: tag, - tz: config.timezone.db, + // tz: pipelineConfigMap.tz.db, branch: branch, dbSetupDockerfilePath: dbSetupDockerfilePath }, + pr: { + ...pipelineConfigMap.database.deploy.pr, + namespace: 'af2668-dev', + name: pipelineConfigMap.module.db, + phase: 'dev', + changeId: deployChangeId, + suffix: `-dev-${deployChangeId}`, + instance: `${pipelineConfigMap.module.db}-dev-${deployChangeId}`, + version: `${deployChangeId}-${changeId}`, + tag: `dev-${pipelineConfigMap.version}-${deployChangeId}`, + env: 'dev', + // tz: pipelineConfigMap.tz.db, + dbSetupDockerfilePath: dbSetupDockerfilePath + // volumeCapacity: (isStaticDeployment && '3Gi') || '500Mi', + // cpuRequest: '50m', + // cpuLimit: '400m', + // memoryRequest: '100Mi', + // memoryLimit: '2Gi', + // replicas: '1' + }, dev: { + ...pipelineConfigMap.database.deploy.dev, namespace: 'af2668-dev', - name: `${name}`, + name: pipelineConfigMap.module.db, phase: 'dev', changeId: deployChangeId, suffix: `-dev-${deployChangeId}`, - instance: `${name}-dev-${deployChangeId}`, + instance: `${pipelineConfigMap.module.db}-dev-${deployChangeId}`, version: `${deployChangeId}-${changeId}`, - tag: `dev-${version}-${deployChangeId}`, + tag: `dev-${pipelineConfigMap.version}-${deployChangeId}`, nodeEnv: 'development', - tz: config.timezone.db, - dbSetupDockerfilePath: dbSetupDockerfilePath, - volumeCapacity: (isStaticDeployment && '3Gi') || '500Mi', - cpuRequest: '50m', - cpuLimit: '600m', - memoryRequest: '100Mi', - memoryLimit: '3Gi', - replicas: '1' + // tz: pipelineConfigMap.tz.db, + dbSetupDockerfilePath: dbSetupDockerfilePath + // volumeCapacity: (isStaticDeployment && '3Gi') || '500Mi', + // cpuRequest: '50m', + // cpuLimit: '600m', + // memoryRequest: '100Mi', + // memoryLimit: '3Gi', + // replicas: '1' }, test: { + ...pipelineConfigMap.database.deploy.test, namespace: 'af2668-test', - name: `${name}`, + name: pipelineConfigMap.module.db, phase: 'test', changeId: deployChangeId, suffix: `-test`, - instance: `${name}-test`, - version: `${version}`, - tag: `test-${version}`, + instance: `${pipelineConfigMap.module.db}-test`, + version: pipelineConfigMap.version, + tag: `test-${pipelineConfigMap.version}`, nodeEnv: 'production', - tz: config.timezone.db, - dbSetupDockerfilePath: dbSetupDockerfilePath, - volumeCapacity: '3Gi', - cpuRequest: '50m', - cpuLimit: '1000m', - memoryRequest: '100Mi', - memoryLimit: '3Gi', - replicas: '1' + // tz: pipelineConfigMap.tz.db, + dbSetupDockerfilePath: dbSetupDockerfilePath + // volumeCapacity: '3Gi', + // cpuRequest: '50m', + // cpuLimit: '1000m', + // memoryRequest: '100Mi', + // memoryLimit: '3Gi', + // replicas: '1' }, prod: { + ...pipelineConfigMap.database.deploy.prod, namespace: 'af2668-prod', - name: `${name}`, + name: pipelineConfigMap.module.db, phase: 'prod', changeId: deployChangeId, suffix: `-prod`, - instance: `${name}-prod`, - version: `${version}`, - tag: `prod-${version}`, + instance: `${pipelineConfigMap.module.db}-prod`, + version: pipelineConfigMap.version, + tag: `prod-${pipelineConfigMap.version}`, nodeEnv: 'production', - tz: config.timezone.db, - dbSetupDockerfilePath: dbSetupDockerfilePath, - volumeCapacity: '5Gi', - cpuRequest: '50m', - cpuLimit: '1000m', - memoryRequest: '100Mi', - memoryLimit: '3Gi', - replicas: '1' + // tz: pipelineConfigMap.tz.db, + dbSetupDockerfilePath: dbSetupDockerfilePath + // volumeCapacity: '5Gi', + // cpuRequest: '50m', + // cpuLimit: '1000m', + // memoryRequest: '100Mi', + // memoryLimit: '3Gi', + // replicas: '1' } }; +console.log('1=============================================='); +console.log('api phases', phases); +console.log('2=============================================='); +console.log('api options', options); +console.log('3=============================================='); + module.exports = exports = { phases, options }; diff --git a/database/.pipeline/lib/db.build.js b/database/.pipeline/lib/db.build.js index 7fe7668f58..24158c451c 100644 --- a/database/.pipeline/lib/db.build.js +++ b/database/.pipeline/lib/db.build.js @@ -6,11 +6,9 @@ const path = require('path'); /** * Build the database image. * - * @param {*} settings + * @param {*} { phases, options } */ -const dbBuild = (settings) => { - const phases = settings.phases; - const options = settings.options; +const dbBuild = ({ phases, options }) => { const phase = settings.phase; const oc = new OpenShiftClientX(Object.assign({ namespace: phases[phase].namespace }, options)); @@ -23,8 +21,8 @@ const dbBuild = (settings) => { ...oc.processDeploymentTemplate(`${templatesLocalBaseUrl}/db.bc.yaml`, { param: { NAME: phases[phase].name, - SUFFIX: `${phases[phase].suffix}`, - TAG_NAME: `${phases[phase].tag}` + SUFFIX: phases[phase].suffix, + TAG_NAME: phases[phase].tag } }) ); diff --git a/database/.pipeline/lib/db.setup.build.js b/database/.pipeline/lib/db.setup.build.js index daf5d7b565..9f3b241672 100644 --- a/database/.pipeline/lib/db.setup.build.js +++ b/database/.pipeline/lib/db.setup.build.js @@ -6,11 +6,9 @@ const path = require('path'); /** * Build the database setup (migrations, seeding, etc) image. * - * @param {*} settings + * @param {*} { phases, options } */ -const dbSetupBuild = (settings) => { - const phases = settings.phases; - const options = settings.options; +const dbSetupBuild = ({ phases, options }) => { const phase = settings.phase; const oc = new OpenShiftClientX(Object.assign({ namespace: phases[phase].namespace }, options)); diff --git a/database/.pipeline/package-lock.json b/database/.pipeline/package-lock.json index a469f9f2c8..8692f80f08 100644 --- a/database/.pipeline/package-lock.json +++ b/database/.pipeline/package-lock.json @@ -53,6 +53,11 @@ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz", "integrity": "sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==", "dev": true + }, + "zod": { + "version": "3.22.4", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.4.tgz", + "integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==" } } } diff --git a/database/.pipeline/package.json b/database/.pipeline/package.json index da857b91e0..4de61f03a4 100644 --- a/database/.pipeline/package.json +++ b/database/.pipeline/package.json @@ -28,7 +28,8 @@ "lodash.isfunction": "^3.0.9", "lodash.isplainobject": "^4.0.6", "lodash.isstring": "^4.0.1", - "pipeline-cli": "git+https://github.com/NickPhura/pipeline-cli.git" + "pipeline-cli": "git+https://github.com/NickPhura/pipeline-cli.git", + "zod": "^3.21.4" }, "devDependencies": { "prettier": "~2.3.2" diff --git a/database/.pipeline/scripts/db.setup.build.js b/database/.pipeline/scripts/db.setup.build.js index c8470ce9d2..e2f08551c7 100644 --- a/database/.pipeline/scripts/db.setup.build.js +++ b/database/.pipeline/scripts/db.setup.build.js @@ -3,7 +3,7 @@ const { dbSetupBuild } = require('../lib/db.setup.build.js'); const config = require('../config.js'); -const settings = { ...config, phase: 'build' }; +const settings = { ...config, phase: config.options.phase }; // build database Setup (migrations, seeding, etc) image dbSetupBuild(settings); diff --git a/database/.pipeline/utils/configMapSchema.js b/database/.pipeline/utils/configMapSchema.js new file mode 100644 index 0000000000..d0d62010c9 --- /dev/null +++ b/database/.pipeline/utils/configMapSchema.js @@ -0,0 +1,271 @@ +const z = require('zod'); + +const PipelineConfigMapSchema = z.object({ + name: z.string(), + namespaceSuffix: z.string(), + namespace: z.object({ + tools: z.string(), + dev: z.string(), + test: z.string(), + prod: z.string() + }), + version: z.string(), + module: z.object({ + db: z.string(), + api: z.string(), + app: z.string() + }), + api: z.object({ + build: z.object({ + tz: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() + }), + deploy: z.object({ + pr: z.object({ + tz: z.string(), + backboneApiHost: z.string(), + backboneIntakePath: z.string(), + backboneArtifactIntakePath: z.string(), + backboneIntakeEnabled: z.boolean(), + bctwApiHost: z.string(), + critterbaseApiHost: z.string(), + elasticsearchURL: z.string(), + elasticsearchTaxonomyIndex: z.string(), + s3KeyPrefix: z.string(), + logLevel: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + replicasMax: z.string() + }), + dev: z.object({ + staticApiUrl: z.string(), + staticAppUrl: z.string(), + tz: z.string(), + backboneApiHost: z.string(), + backboneIntakePath: z.string(), + backboneArtifactIntakePath: z.string(), + backboneIntakeEnabled: z.boolean(), + bctwApiHost: z.string(), + critterbaseApiHost: z.string(), + elasticsearchURL: z.string(), + elasticsearchTaxonomyIndex: z.string(), + s3KeyPrefix: z.string(), + logLevel: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + replicasMax: z.string() + }), + test: z.object({ + staticApiUrl: z.string(), + staticAppUrl: z.string(), + tz: z.string(), + backboneApiHost: z.string(), + backboneIntakePath: z.string(), + backboneArtifactIntakePath: z.string(), + backboneIntakeEnabled: z.boolean(), + bctwApiHost: z.string(), + critterbaseApiHost: z.string(), + elasticsearchURL: z.string(), + elasticsearchTaxonomyIndex: z.string(), + s3KeyPrefix: z.string(), + logLevel: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + replicasMax: z.string() + }), + prod: z.object({ + staticApiUrl: z.string(), + staticAppUrl: z.string(), + staticAppVanityUrl: z.string(), + tz: z.string(), + backboneApiHost: z.string(), + backboneIntakePath: z.string(), + backboneArtifactIntakePath: z.string(), + backboneIntakeEnabled: z.boolean(), + bctwApiHost: z.string(), + critterbaseApiHost: z.string(), + elasticsearchURL: z.string(), + elasticsearchTaxonomyIndex: z.string(), + s3KeyPrefix: z.string(), + logLevel: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + replicasMax: z.string() + }) + }) + }), + app: z.object({ + build: z.object({ + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() + }), + deploy: z.object({ + pr: z.object({ + siteminderLogoutURL: z.string(), + maxUploadNumFiles: z.number(), + maxUploadFileSize: z.number(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + replicasMax: z.string() + }), + dev: z.object({ + staticApiUrl: z.string(), + staticAppUrl: z.string(), + siteminderLogoutURL: z.string(), + maxUploadNumFiles: z.number(), + maxUploadFileSize: z.number(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + replicasMax: z.string() + }), + test: z.object({ + staticApiUrl: z.string(), + staticAppUrl: z.string(), + siteminderLogoutURL: z.string(), + maxUploadNumFiles: z.number(), + maxUploadFileSize: z.number(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + replicasMax: z.string() + }), + prod: z.object({ + staticApiUrl: z.string(), + staticAppUrl: z.string(), + staticAppVanityUrl: z.string(), + siteminderLogoutURL: z.string(), + maxUploadNumFiles: z.number(), + maxUploadFileSize: z.number(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + replicasMax: z.string() + }) + }) + }), + database: z.object({ + build: z.object({ + tz: z.string() + }), + deploy: z.object({ + pr: z.object({ + tz: z.string(), + volumeCapacity: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string() + }), + dev: z.object({ + tz: z.string(), + volumeCapacity: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string() + }), + test: z.object({ + tz: z.string(), + volumeCapacity: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string() + }), + prod: z.object({ + tz: z.string(), + volumeCapacity: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string() + }) + }) + }), + sso: z.object({ + dev: z.object({ + host: z.string(), + realm: z.string(), + clientId: z.string(), + keycloakSecret: z.string(), + serviceClient: z.object({ + serviceClientName: z.string(), + keycloakSecretServiceClientPasswordKey: z.string() + }), + cssApi: z.object({ + cssApiTokenUrl: z.string(), + cssApiClientId: z.string(), + cssApiHost: z.string(), + keycloakSecretCssApiSecretKey: z.string(), + cssApiEnvironment: z.string() + }) + }), + test: z.object({ + host: z.string(), + realm: z.string(), + clientId: z.string(), + keycloakSecret: z.string(), + serviceClient: z.object({ + serviceClientName: z.string(), + keycloakSecretServiceClientPasswordKey: z.string() + }), + cssApi: z.object({ + cssApiTokenUrl: z.string(), + cssApiClientId: z.string(), + cssApiHost: z.string(), + keycloakSecretCssApiSecretKey: z.string(), + cssApiEnvironment: z.string() + }) + }), + prod: z.object({ + host: z.string(), + realm: z.string(), + clientId: z.string(), + keycloakSecret: z.string(), + serviceClient: z.object({ + serviceClientName: z.string(), + keycloakSecretServiceClientPasswordKey: z.string() + }), + cssApi: z.object({ + cssApiTokenUrl: z.string(), + cssApiClientId: z.string(), + cssApiHost: z.string(), + keycloakSecretCssApiSecretKey: z.string(), + cssApiEnvironment: z.string() + }) + }) + }) +}); + +module.exports = exports = { PipelineConfigMapSchema }; diff --git a/database/.pipeline/utils/utils.js b/database/.pipeline/utils/utils.js index d354977eda..c365828b3d 100644 --- a/database/.pipeline/utils/utils.js +++ b/database/.pipeline/utils/utils.js @@ -30,6 +30,7 @@ const getResourceByName = (resourceName, oc) => { */ const getResourceByRaw = (selector, type, settings, oc) => { const phases = settings.phases; + const options = settings.options; const phase = settings.options.env; const result = oc.raw('get', [type], { diff --git a/database/.pipeline2/templates/db.bc.yaml b/database/.pipeline2/templates/db.bc.yaml new file mode 100644 index 0000000000..15bf4cbf7d --- /dev/null +++ b/database/.pipeline2/templates/db.bc.yaml @@ -0,0 +1,37 @@ +kind: Template +apiVersion: template.openshift.io/v1 +metadata: + name: postgresql null +parameters: + - name: NAME + displayName: Name + description: A name used for all objects + required: true + - name: SUFFIX + displayName: Name Suffix + description: A suffix appended to all objects + required: true + - name: TAG_NAME + required: true +objects: + - kind: ImageStream + apiVersion: image.openshift.io/v1 + metadata: + name: '${NAME}' + labels: + shared: 'true' + annotations: {} + spec: + lookupPolicy: + local: false + tags: + - name: '${TAG_NAME}' + annotations: + from: + kind: ImageStreamTag + name: postgis-postgres:12-31 + namespace: af2668-tools + generation: 1 + importPolicy: {} + referencePolicy: + type: Source diff --git a/database/.pipeline2/templates/db.dc.yaml b/database/.pipeline2/templates/db.dc.yaml new file mode 100644 index 0000000000..9ce00a054e --- /dev/null +++ b/database/.pipeline2/templates/db.dc.yaml @@ -0,0 +1,251 @@ +kind: Template +apiVersion: template.openshift.io/v1 +labels: + template: postgresql-persistent-template +metadata: + name: sims-db-dc + labels: + build: sims-db +parameters: + - description: The name of the OpenShift Service exposed for the database. + displayName: Database Service Name + name: NAME + required: true + value: 'postgresql' + - description: The OpenShift ImageStream name. + displayName: IMAGE_STREAM_NAME + name: IMAGE_STREAM_NAME + value: 'postgis-postgres' + - description: The OpenShift Namespace where the ImageStream resides. + displayName: Namespace + name: IMAGE_STREAM_NAMESPACE + value: 'af2668-tools' + - description: The name of the OpenShift Service exposed for the database. + displayName: Database Service Name + name: DATABASE_SERVICE_NAME + required: true + value: 'postgresql' + - description: Username for PostgreSQL user that will be used for accessing the database. + displayName: PostgreSQL Connection Username + name: POSTGRESQL_USER + required: true + value: 'postgres' + - description: Admin Username for PostgreSQL user that will be used for accessing the database. + displayName: PostgreSQL Admin Connection Username + name: POSTGRESQL_ADMIN_USER + required: true + value: 'postgres' + - description: Password for the PostgreSQL connection user. + displayName: PostgreSQL Connection Password + from: '[a-zA-Z0-9]{16}' + generate: expression + name: POSTGRESQL_PASSWORD + required: true + - description: Password for the PostgreSQL admin user. + displayName: PostgreSQL Admin Connection Password + from: '[a-zA-Z0-9]{16}' + generate: expression + name: POSTGRESQL_ADMIN_PASSWORD + required: true + - description: Name of the PostgreSQL database accessed. + displayName: PostgreSQL Database Name + name: POSTGRESQL_DATABASE + required: true + value: 'biohubbc' + - name: TZ + description: Database timezone + required: false + value: 'America/Vancouver' + - description: Volume space available for data, e.g. 512Mi, 2Gi. + displayName: Volume Capacity + name: VOLUME_CAPACITY + required: true + value: '500Mi' + - description: Version of PostgreSQL image to be used (9.2, 9.4, 9.5 or latest). + displayName: Version of PostgreSQL Image + name: IMAGE_STREAM_VERSION + required: true + value: '12-31' + - description: Indicator to enable pgcrypto extension (provided out-of-the-box with PostgreSQL). + displayName: Flag to enable pgcrypto PostgreSQL extension. + name: PGCRYPTO_EXTENSION + value: 'Y' + - description: Indicator to enable postgis extension (from official PostgeSQL YUM repo). + displayName: Flag to enable postgis PostgreSQL extension. + name: POSTGIS_EXTENSION + value: 'Y' + - name: CPU_REQUEST + value: '50m' + - name: CPU_LIMIT + value: '200m' + - name: MEMORY_REQUEST + value: '100Mi' + - name: MEMORY_LIMIT + value: '2Gi' + - name: REPLICAS + value: '1' +objects: + - kind: Secret + apiVersion: v1 + metadata: + annotations: + template.openshift.io/expose-database_name: "{.data['database-name']}" + template.openshift.io/expose-password: "{.data['database-user-password']}" + template.openshift.io/expose-admin-password: "{.data['database-admin-password']}" + template.openshift.io/expose-admin-username: "{.data['database-user']}" + as-copy-of: sims-database + name: '${DATABASE_SERVICE_NAME}' + stringData: + database-name: '${POSTGRESQL_DATABASE}' + database-user-password: '${POSTGRESQL_PASSWORD}' + database-admin-password: '${POSTGRESQL_ADMIN_PASSWORD}' + database-user: '${POSTGRESQL_USER}' + + - kind: Service + apiVersion: v1 + metadata: + annotations: + template.openshift.io/expose-uri: postgres://{.spec.clusterIP}:{.spec.ports[?(.name=="postgresql")].port} + name: '${DATABASE_SERVICE_NAME}' + spec: + ports: + - name: postgresql + nodePort: 0 + port: 5432 + protocol: TCP + targetPort: 5432 + selector: + name: '${DATABASE_SERVICE_NAME}' + sessionAffinity: None + type: ClusterIP + status: + loadBalancer: {} + + - kind: PersistentVolumeClaim + apiVersion: v1 + metadata: + name: '${DATABASE_SERVICE_NAME}' + spec: + accessModes: + - ReadWriteMany + resources: + requests: + storage: '${VOLUME_CAPACITY}' + - kind: ImageStream + apiVersion: image.openshift.io/v1 + metadata: + name: '${IMAGE_STREAM_NAME}' + labels: + shared: 'true' + annotations: {} + spec: + lookupPolicy: + local: false + + - kind: DeploymentConfig + apiVersion: apps.openshift.io/v1 + metadata: + annotations: + template.alpha.openshift.io/wait-for-ready: 'true' + name: '${DATABASE_SERVICE_NAME}' + spec: + replicas: ${{REPLICAS}} + selector: + name: '${DATABASE_SERVICE_NAME}' + strategy: + type: Recreate + maxSurge: 50% + maxUnavailable: 0 + template: + metadata: + labels: + name: '${DATABASE_SERVICE_NAME}' + role: db + spec: + containers: + - capabilities: {} + env: + - name: POSTGRESQL_USER + valueFrom: + secretKeyRef: + key: database-user + name: '${DATABASE_SERVICE_NAME}' + - name: POSTGRESQL_PASSWORD + valueFrom: + secretKeyRef: + key: database-user-password + name: '${DATABASE_SERVICE_NAME}' + - name: POSTGRESQL_ADMIN_PASSWORD + valueFrom: + secretKeyRef: + key: database-admin-password + name: '${DATABASE_SERVICE_NAME}' + - name: POSTGRESQL_DATABASE + valueFrom: + secretKeyRef: + key: database-name + name: '${DATABASE_SERVICE_NAME}' + - name: PGCRYPTO_EXTENSION + value: 'N' + - name: POSTGIS_EXTENSION + value: 'N' + - name: PGOPTIONS + value: '-c maintenance_work_mem=128MB' + - name: PGTZ + value: '${TZ}' + image: ' ' + imagePullPolicy: IfNotPresent + livenessProbe: + initialDelaySeconds: 30 + tcpSocket: + port: 5432 + timeoutSeconds: 1 + name: postgresql + ports: + - containerPort: 5432 + protocol: TCP + readinessProbe: + exec: + command: + - '/bin/sh' + - '-i' + - '-c' + - psql -h 127.0.0.1 -U $POSTGRESQL_USER -q -d $POSTGRESQL_DATABASE -c 'SELECT 1' + initialDelaySeconds: 5 + timeoutSeconds: 1 + resources: + requests: + cpu: ${CPU_REQUEST} + memory: ${MEMORY_REQUEST} + limits: + cpu: ${CPU_LIMIT} + memory: ${MEMORY_LIMIT} + securityContext: + capabilities: {} + privileged: false + terminationMessagePath: '/dev/termination-log' + volumeMounts: + - mountPath: '/var/lib/pgsql/data' + name: '${DATABASE_SERVICE_NAME}-data' + - mountPath: '/var/run/postgresql' + name: '${DATABASE_SERVICE_NAME}-run' + dnsPolicy: ClusterFirst + restartPolicy: Always + volumes: + - name: '${DATABASE_SERVICE_NAME}-data' + persistentVolumeClaim: + claimName: '${DATABASE_SERVICE_NAME}' + - name: '${DATABASE_SERVICE_NAME}-run' + emptyDir: {} + triggers: + - imageChangeParams: + automatic: true + containerNames: + - postgresql + from: + kind: ImageStreamTag + name: '${IMAGE_STREAM_NAME}:${IMAGE_STREAM_VERSION}' + namespace: '${IMAGE_STREAM_NAMESPACE}' + lastTriggeredImage: '' + type: ImageChange + - type: ConfigChange diff --git a/database/.pipeline2/templates/db.setup.bc.yaml b/database/.pipeline2/templates/db.setup.bc.yaml new file mode 100644 index 0000000000..73cabb44ea --- /dev/null +++ b/database/.pipeline2/templates/db.setup.bc.yaml @@ -0,0 +1,120 @@ +apiVersion: template.openshift.io/v1 +kind: Template +metadata: + name: sims-db-setup-bc + labels: + build: sims-db-setup +parameters: + - name: NAME + displayName: Name + description: Image name + required: true + value: sims-db-setup + - name: SUFFIX + displayName: Name Suffix + description: A suffix appended to all objects + required: true + value: '-dev' + - name: VERSION + required: true + value: '1.0' + - name: SOURCE_CONTEXT_DIR + required: true + value: database + - name: DB_SETUP_DOCKERFILE_PATH + required: true + value: './.docker/db/Dockerfile.migrate' + - name: SOURCE_REPOSITORY_URL + required: true + value: https://github.com/bcgov/biohubbc + - name: SOURCE_REPOSITORY_REF + required: false + value: dev + - name: BASE_IMAGE_URL + required: true + value: image-registry.openshift-image-registry.svc:5000/openshift/nodejs:14-ubi8 + - name: SOURCE_IMAGE_NAME + required: true + value: nodejs + - name: SOURCE_IMAGE_TAG + required: true + value: 14-ubi8 + - name: CPU_REQUEST + value: '50m' + - name: CPU_LIMIT + value: '1000m' + - name: MEMORY_REQUEST + value: '100Mi' + - name: MEMORY_LIMIT + value: '1.5Gi' +objects: + - kind: ImageStream + apiVersion: image.openshift.io/v1 + metadata: + name: ${SOURCE_IMAGE_NAME} + annotations: + description: Nodejs Base Image + labels: + shared: 'true' + spec: + lookupPolicy: + local: false + tags: + - name: ${SOURCE_IMAGE_TAG} + annotations: null + from: + kind: DockerImage + name: ${BASE_IMAGE_URL} + importPolicy: {} + referencePolicy: + type: Local + - kind: ImageStream + apiVersion: image.openshift.io/v1 + metadata: + name: '${NAME}' + annotations: + description: Nodejs Runtime Image + labels: + shared: 'true' + spec: + lookupPolicy: + local: false + - apiVersion: build.openshift.io/v1 + kind: BuildConfig + metadata: + name: '${NAME}${SUFFIX}' + labels: {} + annotations: {} + spec: + failedBuildsHistoryLimit: 5 + nodeSelector: + output: + to: + kind: ImageStreamTag + name: '${NAME}:${VERSION}' + postCommit: {} + resources: + requests: + cpu: ${CPU_REQUEST} + memory: ${MEMORY_REQUEST} + limits: + cpu: ${CPU_LIMIT} + memory: ${MEMORY_LIMIT} + runPolicy: SerialLatestOnly + source: + contextDir: '${SOURCE_CONTEXT_DIR}' + git: + uri: '${SOURCE_REPOSITORY_URL}' + ref: '${SOURCE_REPOSITORY_REF}' + type: Git + strategy: + dockerStrategy: + dockerfilePath: '${DB_SETUP_DOCKERFILE_PATH}' + from: + kind: ImageStreamTag + name: ${SOURCE_IMAGE_NAME}:${SOURCE_IMAGE_TAG} + type: Docker + successfulBuildsHistoryLimit: 5 + triggers: + - type: ConfigChange + - type: ImageChange diff --git a/database/.pipeline2/templates/db.setup.dc.yaml b/database/.pipeline2/templates/db.setup.dc.yaml new file mode 100644 index 0000000000..2e46bda6a0 --- /dev/null +++ b/database/.pipeline2/templates/db.setup.dc.yaml @@ -0,0 +1,104 @@ +kind: Template +apiVersion: template.openshift.io/v1 +metadata: + name: sims-db-setup-dc + labels: + build: sims-db-setup +parameters: + - name: IMAGE + description: 'Image for pod' + required: true + - name: NAME + value: sims-db-setup + - name: SUFFIX + value: '-dev' + - name: VERSION + description: Version of the application + value: '1.0.0' + - name: CHANGE_ID + description: Change id of the project. This will help to pull image stream + required: true + value: '0' + - name: DB_SERVICE_NAME + description: 'Database service name associated with deployment' + required: true + - name: DB_SCHEMA + description: 'Database schema' + required: true + - name: DB_SCHEMA_DAPI_V1 + description: 'Database api v1 schema' + required: true + - name: NODE_ENV + description: Application Environment type variable + required: true + value: 'dev' + - name: CPU_REQUEST + value: '50m' + - name: CPU_LIMIT + value: '1000m' + - name: MEMORY_REQUEST + value: '100Mi' + - name: MEMORY_LIMIT + value: '1.5Gi' +objects: + - kind: Pod + apiVersion: v1 + metadata: + name: '${NAME}' + labels: + role: setup + spec: + containers: + - name: test + image: '${IMAGE}' + resources: + requests: + cpu: ${CPU_REQUEST} + memory: ${MEMORY_REQUEST} + limits: + cpu: ${CPU_LIMIT} + memory: ${MEMORY_LIMIT} + env: + - name: DB_HOST + value: ${DB_SERVICE_NAME} + - name: DB_ADMIN + valueFrom: + secretKeyRef: + key: database-admin + name: ${DB_SERVICE_NAME} + - name: DB_ADMIN_PASS + valueFrom: + secretKeyRef: + key: database-admin-password + name: ${DB_SERVICE_NAME} + - name: DB_USER_API + valueFrom: + secretKeyRef: + key: database-user-api + name: ${DB_SERVICE_NAME} + - name: DB_USER_API_PASS + valueFrom: + secretKeyRef: + key: database-user-api-password + name: ${DB_SERVICE_NAME} + - name: DB_DATABASE + valueFrom: + secretKeyRef: + key: database-name + name: ${DB_SERVICE_NAME} + - name: DB_PORT + value: '5432' + - name: CHANGE_VERSION + value: ${CHANGE_ID} + - name: NODE_ENV + value: ${NODE_ENV} + - name: VERSION + value: ${VERSION} + - name: DB_SCHEMA + value: ${DB_SCHEMA} + - name: DB_SCHEMA_DAPI_V1 + value: ${DB_SCHEMA_DAPI_V1} + imagePullPolicy: Always + restartPolicy: Never + activeDeadlineSeconds: 900 + dnsPolicy: ClusterFirst diff --git a/database/.pipeline2/templates/db.setup.is.yaml b/database/.pipeline2/templates/db.setup.is.yaml new file mode 100644 index 0000000000..2482ba52dd --- /dev/null +++ b/database/.pipeline2/templates/db.setup.is.yaml @@ -0,0 +1,18 @@ +apiVersion: template.openshift.io/v1 +kind: Template +parameters: + - name: NAME + value: sims-db-setup +objects: + - apiVersion: image.openshift.io/v1 + kind: ImageStream + metadata: + annotations: + description: Database setup image stream + labels: + shared: 'true' + generation: 0 + name: ${NAME} + spec: + lookupPolicy: + local: false From bb21ad636cdcce8f92751ba9e5f10295c156ff91 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Wed, 24 Jan 2024 22:21:00 -0800 Subject: [PATCH 02/62] Fix merge issues --- api/.pipeline/lib/api.build.js | 8 +++++--- app/.pipeline/lib/app.build.js | 8 +++++--- database/.pipeline/lib/db.build.js | 8 +++++--- database/.pipeline/lib/db.setup.build.js | 8 +++++--- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/api/.pipeline/lib/api.build.js b/api/.pipeline/lib/api.build.js index d2c94eb48e..3206abe38a 100644 --- a/api/.pipeline/lib/api.build.js +++ b/api/.pipeline/lib/api.build.js @@ -6,10 +6,12 @@ const path = require('path'); /** * Build the api image. * - * @param {*} { phases, options } + * @param {*} settings */ -const apiBuild = ({ phases, options }) => { - const phase = settings.phase; +const apiBuild = (settings) => { + const phases = settings.phases; + const options = settings.options; + const phase = settings.options.env; const oc = new OpenShiftClientX(Object.assign({ namespace: phases[phase].namespace }, options)); diff --git a/app/.pipeline/lib/app.build.js b/app/.pipeline/lib/app.build.js index 04d53983d1..e1dd62115a 100644 --- a/app/.pipeline/lib/app.build.js +++ b/app/.pipeline/lib/app.build.js @@ -6,10 +6,12 @@ const path = require('path'); /** * Build the app image. * - * @param {*} { phases, options } + * @param {*} settings */ -const appBuild = ({ phases, options }) => { - const phase = settings.phase; +const appBuild = (settings) => { + const phases = settings.phases; + const options = settings.options; + const phase = settings.options.env; const oc = new OpenShiftClientX(Object.assign({ namespace: phases[phase].namespace }, options)); diff --git a/database/.pipeline/lib/db.build.js b/database/.pipeline/lib/db.build.js index 24158c451c..c3ccb8f405 100644 --- a/database/.pipeline/lib/db.build.js +++ b/database/.pipeline/lib/db.build.js @@ -6,10 +6,12 @@ const path = require('path'); /** * Build the database image. * - * @param {*} { phases, options } + * @param {*} settings */ -const dbBuild = ({ phases, options }) => { - const phase = settings.phase; +const dbBuild = (settings) => { + const phases = settings.phases; + const options = settings.options; + const phase = settings.options.env; const oc = new OpenShiftClientX(Object.assign({ namespace: phases[phase].namespace }, options)); diff --git a/database/.pipeline/lib/db.setup.build.js b/database/.pipeline/lib/db.setup.build.js index 9f3b241672..ee90b27e00 100644 --- a/database/.pipeline/lib/db.setup.build.js +++ b/database/.pipeline/lib/db.setup.build.js @@ -6,10 +6,12 @@ const path = require('path'); /** * Build the database setup (migrations, seeding, etc) image. * - * @param {*} { phases, options } + * @param {*} settings */ -const dbSetupBuild = ({ phases, options }) => { - const phase = settings.phase; +const dbSetupBuild = (settings) => { + const phases = settings.phases; + const options = settings.options; + const phase = settings.options.env; const oc = new OpenShiftClientX(Object.assign({ namespace: phases[phase].namespace }, options)); From 2f2e852798de3d79545bfa30ac1fd6794b7052b8 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Wed, 24 Jan 2024 22:42:05 -0800 Subject: [PATCH 03/62] Fix --env deploy.yaml setting --- .github/workflows/deploy.yml | 16 ++++++++-------- api/.pipeline/config.js | 2 +- api/.pipeline/lib/api.build.js | 4 ++++ app/.pipeline/config.js | 11 ++++++----- database/.pipeline/config.js | 2 +- 5 files changed, 20 insertions(+), 15 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 675304e2c7..7232e4f321 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -216,7 +216,7 @@ jobs: - name: Build APP Image working-directory: app/.pipeline/ run: | - DEBUG=* npm run build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG + DEBUG=* npm run build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=build # Build the Database image buildDatabase: @@ -280,7 +280,7 @@ jobs: - name: Build Database Image working-directory: database/.pipeline/ run: | - DEBUG=* npm run db:build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG + DEBUG=* npm run db:build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=build # Build the Database Setup image buildDatabaseSetup: @@ -337,7 +337,7 @@ jobs: - name: Build Database Setup Image working-directory: database/.pipeline/ run: | - DEBUG=* npm run db-setup:build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG + DEBUG=* npm run db-setup:build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=build # Build the API image buildAPI: @@ -401,7 +401,7 @@ jobs: - name: Build API Image working-directory: api/.pipeline/ run: | - DEBUG=* npm run build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG + DEBUG=* npm run build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=build # Deploy APP image deployAPP: @@ -458,7 +458,7 @@ jobs: - name: Deploy APP Image working-directory: app/.pipeline run: | - DEBUG=* npm run deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --phase=pr + DEBUG=* npm run deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=pr # Deploy Database image deployDatabase: @@ -515,7 +515,7 @@ jobs: - name: Deploy Database Image working-directory: database/.pipeline/ run: | - DEBUG=* npm run db:deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --phase=pr + DEBUG=* npm run db:deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=pr # Deploy Database image deployDatabaseSetup: @@ -573,7 +573,7 @@ jobs: - name: Deploy Database Setup Image working-directory: database/.pipeline/ run: | - DEBUG=* npm run db-setup:deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --phase=pr + DEBUG=* npm run db-setup:deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=pr # Deploy API image deployAPI: @@ -633,7 +633,7 @@ jobs: - name: Deploy API Image working-directory: api/.pipeline/ run: | - DEBUG=* npm run deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --phase=pr + DEBUG=* npm run deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=pr # 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 diff --git a/api/.pipeline/config.js b/api/.pipeline/config.js index 21c1af5446..3715d7a0cd 100644 --- a/api/.pipeline/config.js +++ b/api/.pipeline/config.js @@ -111,7 +111,7 @@ const phases = { // backboneIntakeEnabled: false, // bctwApiHost: 'https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca', // critterbaseApiHost: 'https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api', - env: 'dev', + // env: 'dev', // elasticsearchURL: 'http://es01.a0ec71-dev:9200', // elasticsearchTaxonomyIndex: 'taxonomy_3.0.0', s3KeyPrefix: `local/${changeId}/sims`, diff --git a/api/.pipeline/lib/api.build.js b/api/.pipeline/lib/api.build.js index 3206abe38a..fd12ddf214 100644 --- a/api/.pipeline/lib/api.build.js +++ b/api/.pipeline/lib/api.build.js @@ -13,6 +13,10 @@ const apiBuild = (settings) => { const options = settings.options; const phase = settings.options.env; + console.log('4=============================================='); + console.log('api phases', phases); + console.log('5=============================================='); + const oc = new OpenShiftClientX(Object.assign({ namespace: phases[phase].namespace }, options)); const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, '../templates')); diff --git a/app/.pipeline/config.js b/app/.pipeline/config.js index dad1daf5ca..3fb5213a6f 100644 --- a/app/.pipeline/config.js +++ b/app/.pipeline/config.js @@ -109,14 +109,15 @@ const phases = { // siteminderLogoutURL: pipelineConfigMap.siteminderLogoutURL.dev, // maxUploadNumFiles, // maxUploadFileSize, - env: 'dev', - sso: pipelineConfigMap.sso.dev + // env: 'dev', + sso: pipelineConfigMap.sso.dev, // cpuRequest: '50m', // cpuLimit: '200m', // memoryRequest: '100Mi', // memoryLimit: '333Mi', // replicas: (isStaticDeployment && '1') || '1', // replicasMax: (isStaticDeployment && '2') || '1' + biohubFeatureFlag: 'true' }, dev: { ...pipelineConfigMap.app.deploy.dev, @@ -134,7 +135,7 @@ const phases = { // maxUploadNumFiles, // maxUploadFileSize, nodeEnv: 'development', - sso: pipelineConfigMap.sso.dev + sso: pipelineConfigMap.sso.dev, // cpuRequest: '50m', // cpuLimit: '200m', // memoryRequest: '100Mi', @@ -159,7 +160,7 @@ const phases = { // maxUploadNumFiles, // maxUploadFileSize, nodeEnv: 'production', - sso: pipelineConfigMap.sso.test + sso: pipelineConfigMap.sso.test, // cpuRequest: '50m', // cpuLimit: '500m', // memoryRequest: '100Mi', @@ -184,7 +185,7 @@ const phases = { // maxUploadNumFiles, // maxUploadFileSize, nodeEnv: 'production', - sso: pipelineConfigMap.sso.prod + sso: pipelineConfigMap.sso.prod, // cpuRequest: '50m', // cpuLimit: '500m', // memoryRequest: '100Mi', diff --git a/database/.pipeline/config.js b/database/.pipeline/config.js index 99fe73a9f5..ee834c0ca4 100644 --- a/database/.pipeline/config.js +++ b/database/.pipeline/config.js @@ -106,7 +106,7 @@ const phases = { instance: `${pipelineConfigMap.module.db}-dev-${deployChangeId}`, version: `${deployChangeId}-${changeId}`, tag: `dev-${pipelineConfigMap.version}-${deployChangeId}`, - env: 'dev', + // env: 'dev', // tz: pipelineConfigMap.tz.db, dbSetupDockerfilePath: dbSetupDockerfilePath // volumeCapacity: (isStaticDeployment && '3Gi') || '500Mi', From 7afb9b0b7d50caecf492faab52c4ab8eb5af69c8 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Wed, 24 Jan 2024 22:55:44 -0800 Subject: [PATCH 04/62] Debugging --- api/.pipeline/lib/api.build.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/api/.pipeline/lib/api.build.js b/api/.pipeline/lib/api.build.js index fd12ddf214..7c9df6e019 100644 --- a/api/.pipeline/lib/api.build.js +++ b/api/.pipeline/lib/api.build.js @@ -14,9 +14,25 @@ const apiBuild = (settings) => { const phase = settings.options.env; console.log('4=============================================='); - console.log('api phases', phases); + console.log('api options', options); + console.log('api phase', phase); + console.log('api phases', phases[phase]); console.log('5=============================================='); + console.log('6=============================================='); + console.log({ + NAME: phases[phase].name, + SUFFIX: phases[phase].suffix, + VERSION: phases[phase].tag, + SOURCE_REPOSITORY_URL: oc.git.http_url, + SOURCE_REPOSITORY_REF: phases[phase].branch || oc.git.ref, + CPU_REQUEST: phases[phase].cpuRequest, + CPU_LIMIT: phases[phase].cpuLimit, + MEMORY_REQUEST: phases[phase].memoryRequest, + MEMORY_LIMIT: phases[phase].memoryLimit + }); + console.log('7=============================================='); + const oc = new OpenShiftClientX(Object.assign({ namespace: phases[phase].namespace }, options)); const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, '../templates')); @@ -30,7 +46,7 @@ const apiBuild = (settings) => { SUFFIX: phases[phase].suffix, VERSION: phases[phase].tag, SOURCE_REPOSITORY_URL: oc.git.http_url, - SOURCE_REPOSITORY_REF: phases[phase].branch, + SOURCE_REPOSITORY_REF: phases[phase].branch || oc.git.ref, CPU_REQUEST: phases[phase].cpuRequest, CPU_LIMIT: phases[phase].cpuLimit, MEMORY_REQUEST: phases[phase].memoryRequest, From f6be3c092451b0fcc3b5923be2aaed6a49fb67cb Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Wed, 24 Jan 2024 23:08:46 -0800 Subject: [PATCH 05/62] Fixes --- api/.pipeline/lib/api.build.js | 4 ++-- app/.pipeline/lib/app.build.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/.pipeline/lib/api.build.js b/api/.pipeline/lib/api.build.js index 7c9df6e019..a0b2adab74 100644 --- a/api/.pipeline/lib/api.build.js +++ b/api/.pipeline/lib/api.build.js @@ -19,6 +19,8 @@ const apiBuild = (settings) => { console.log('api phases', phases[phase]); console.log('5=============================================='); + const oc = new OpenShiftClientX(Object.assign({ namespace: phases[phase].namespace }, options)); + console.log('6=============================================='); console.log({ NAME: phases[phase].name, @@ -33,8 +35,6 @@ const apiBuild = (settings) => { }); console.log('7=============================================='); - const oc = new OpenShiftClientX(Object.assign({ namespace: phases[phase].namespace }, options)); - const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, '../templates')); const objects = []; diff --git a/app/.pipeline/lib/app.build.js b/app/.pipeline/lib/app.build.js index e1dd62115a..13e4913042 100644 --- a/app/.pipeline/lib/app.build.js +++ b/app/.pipeline/lib/app.build.js @@ -26,7 +26,7 @@ const appBuild = (settings) => { SUFFIX: phases[phase].suffix, VERSION: phases[phase].tag, SOURCE_REPOSITORY_URL: oc.git.http_url, - SOURCE_REPOSITORY_REF: phases[phase].branch, + SOURCE_REPOSITORY_REF: phases[phase].branch || oc.git.ref, CPU_REQUEST: phases[phase].cpuRequest, CPU_LIMIT: phases[phase].cpuLimit, MEMORY_REQUEST: phases[phase].memoryRequest, From c740af8c2952103781f6ac81f020a1356f994b26 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Wed, 24 Jan 2024 23:21:27 -0800 Subject: [PATCH 06/62] Fix api build config --- api/.pipeline/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/.pipeline/config.js b/api/.pipeline/config.js index 3715d7a0cd..18e07ca396 100644 --- a/api/.pipeline/config.js +++ b/api/.pipeline/config.js @@ -75,7 +75,7 @@ const options = processOptions(rawOptions); const phases = { build: { - ...pipelineConfigMap.api.build.pr, + ...pipelineConfigMap.api.build, namespace: 'af2668-tools', name: pipelineConfigMap.module.api, dbName: pipelineConfigMap.module.db, From f94446d7997f1f675aadc19260a8c97ac20c7d49 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Wed, 24 Jan 2024 23:41:23 -0800 Subject: [PATCH 07/62] Add missing nodeEnv --- api/.pipeline/config.js | 2 +- app/.pipeline/config.js | 2 +- database/.pipeline/config.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/.pipeline/config.js b/api/.pipeline/config.js index 18e07ca396..351e622c0c 100644 --- a/api/.pipeline/config.js +++ b/api/.pipeline/config.js @@ -111,7 +111,7 @@ const phases = { // backboneIntakeEnabled: false, // bctwApiHost: 'https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca', // critterbaseApiHost: 'https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api', - // env: 'dev', + nodeEnv: 'development', // elasticsearchURL: 'http://es01.a0ec71-dev:9200', // elasticsearchTaxonomyIndex: 'taxonomy_3.0.0', s3KeyPrefix: `local/${changeId}/sims`, diff --git a/app/.pipeline/config.js b/app/.pipeline/config.js index 3fb5213a6f..9d8a432f45 100644 --- a/app/.pipeline/config.js +++ b/app/.pipeline/config.js @@ -109,7 +109,7 @@ const phases = { // siteminderLogoutURL: pipelineConfigMap.siteminderLogoutURL.dev, // maxUploadNumFiles, // maxUploadFileSize, - // env: 'dev', + nodeEnv: 'development', sso: pipelineConfigMap.sso.dev, // cpuRequest: '50m', // cpuLimit: '200m', diff --git a/database/.pipeline/config.js b/database/.pipeline/config.js index ee834c0ca4..b0c7889582 100644 --- a/database/.pipeline/config.js +++ b/database/.pipeline/config.js @@ -106,7 +106,7 @@ const phases = { instance: `${pipelineConfigMap.module.db}-dev-${deployChangeId}`, version: `${deployChangeId}-${changeId}`, tag: `dev-${pipelineConfigMap.version}-${deployChangeId}`, - // env: 'dev', + nodeEnv: 'development', // tz: pipelineConfigMap.tz.db, dbSetupDockerfilePath: dbSetupDockerfilePath // volumeCapacity: (isStaticDeployment && '3Gi') || '500Mi', From 8bffc86cb093130b0279c3ae313264e85ea7ef18 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Fri, 26 Jan 2024 16:50:59 -0800 Subject: [PATCH 08/62] Updates --- .github/workflows/deploy.yml | 16 ++-- .github/workflows/deployStatic.yml | 55 ++++++++++-- .pipeline/templates/sims-configmap.json | 41 +++++++++ .pipeline/templates/sims.configmap.yaml | 78 ++++++++++++++++ api/.pipeline/config.js | 89 ++----------------- api/.pipeline/lib/api.build.js | 2 +- api/.pipeline/lib/api.deploy.js | 2 +- api/.pipeline/lib/clean.js | 2 +- api/.pipeline/scripts/api.deploy.js | 4 +- api/.pipeline/scripts/clean.js | 4 +- api/.pipeline/utils/configMapSchema.js | 20 +++++ app/.pipeline/config.js | 60 ++----------- app/.pipeline/lib/app.build.js | 2 +- app/.pipeline/lib/app.deploy.js | 2 +- app/.pipeline/lib/clean.js | 2 +- app/.pipeline/scripts/app.deploy.js | 4 +- app/.pipeline/scripts/clean.js | 4 +- app/.pipeline/utils/configMapSchema.js | 20 +++++ database/.pipeline/config.js | 71 ++++----------- database/.pipeline/lib/clean.js | 2 +- database/.pipeline/lib/db.build.js | 2 +- database/.pipeline/lib/db.deploy.js | 2 +- database/.pipeline/lib/db.setup.build.js | 2 +- database/.pipeline/lib/db.setup.deploy.js | 2 +- database/.pipeline/scripts/clean.js | 4 +- database/.pipeline/scripts/db.deploy.js | 4 +- database/.pipeline/scripts/db.setup.build.js | 4 +- database/.pipeline/scripts/db.setup.deploy.js | 4 +- database/.pipeline/utils/configMapSchema.js | 20 +++++ database/.pipeline/utils/utils.js | 2 +- 30 files changed, 281 insertions(+), 245 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7232e4f321..48d4f73a81 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -216,7 +216,7 @@ jobs: - name: Build APP Image working-directory: app/.pipeline/ run: | - DEBUG=* npm run build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=build + DEBUG=* npm run build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --phase=build # Build the Database image buildDatabase: @@ -280,7 +280,7 @@ jobs: - name: Build Database Image working-directory: database/.pipeline/ run: | - DEBUG=* npm run db:build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=build + DEBUG=* npm run db:build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --phase=build # Build the Database Setup image buildDatabaseSetup: @@ -337,7 +337,7 @@ jobs: - name: Build Database Setup Image working-directory: database/.pipeline/ run: | - DEBUG=* npm run db-setup:build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=build + DEBUG=* npm run db-setup:build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --phase=build # Build the API image buildAPI: @@ -401,7 +401,7 @@ jobs: - name: Build API Image working-directory: api/.pipeline/ run: | - DEBUG=* npm run build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=build + DEBUG=* npm run build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --phase=build # Deploy APP image deployAPP: @@ -458,7 +458,7 @@ jobs: - name: Deploy APP Image working-directory: app/.pipeline run: | - DEBUG=* npm run deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=pr + DEBUG=* npm run deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --phase=pr # Deploy Database image deployDatabase: @@ -515,7 +515,7 @@ jobs: - name: Deploy Database Image working-directory: database/.pipeline/ run: | - DEBUG=* npm run db:deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=pr + DEBUG=* npm run db:deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --phase=pr # Deploy Database image deployDatabaseSetup: @@ -573,7 +573,7 @@ jobs: - name: Deploy Database Setup Image working-directory: database/.pipeline/ run: | - DEBUG=* npm run db-setup:deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=pr + DEBUG=* npm run db-setup:deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --phase=pr # Deploy API image deployAPI: @@ -633,7 +633,7 @@ jobs: - name: Deploy API Image working-directory: api/.pipeline/ run: | - DEBUG=* npm run deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=pr + DEBUG=* npm run deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --phase=pr # 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 diff --git a/.github/workflows/deployStatic.yml b/.github/workflows/deployStatic.yml index fec94b4f60..98097a9ef1 100644 --- a/.github/workflows/deployStatic.yml +++ b/.github/workflows/deployStatic.yml @@ -85,6 +85,29 @@ jobs: path: ${{ github.workspace }}/* key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }} + # 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 and store in pipeline_config for use by subsequent jobs + - name: Fetch pipeline config map + id: "get_config" + run: | + echo "pipeline_config=$( oc get configmap sims-pipeline-config -o jsonpath={.data.config} | jq -c )" >> "$GITHUB_OUTPUT" + # Build the web frontend app image buildAPP: name: Build APP Image @@ -94,8 +117,10 @@ jobs: env: PR_NUMBER: ${{ github.event.number }} BRANCH: ${{ github.base_ref }} + PIPELINE_CONFIG: ${{ needs.getPipelineConfigMap.outputs.pipeline_config }} needs: - checkoutRepo + - getPipelineConfigMap steps: # Install Node - for `node` and `npm` commands - name: Setup Node.js @@ -133,7 +158,7 @@ jobs: - name: Build APP Image working-directory: "app/.pipeline/" run: | - DEBUG=* npm run build -- --pr=$PR_NUMBER --branch=$BRANCH --type=static + DEBUG=* npm run build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --branch=$BRANCH --type=static # Build the Database image buildDatabase: @@ -144,8 +169,10 @@ jobs: env: PR_NUMBER: ${{ github.event.number }} BRANCH: ${{ github.base_ref }} + PIPELINE_CONFIG: ${{ needs.getPipelineConfigMap.outputs.pipeline_config }} needs: - checkoutRepo + - getPipelineConfigMap steps: # Install Node - for `node` and `npm` commands - name: Setup Node.js @@ -183,7 +210,7 @@ jobs: - name: Build Database Image working-directory: "database/.pipeline/" run: | - DEBUG=* npm run db:build -- --pr=$PR_NUMBER --branch=$BRANCH --type=static + DEBUG=* npm run db:build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --branch=$BRANCH --type=static # Build the Database Setup image buildDatabaseSetup: @@ -194,8 +221,10 @@ jobs: env: PR_NUMBER: ${{ github.event.number }} BRANCH: ${{ github.base_ref }} + PIPELINE_CONFIG: ${{ needs.getPipelineConfigMap.outputs.pipeline_config }} needs: - checkoutRepo + - getPipelineConfigMap steps: # Install Node - for `node` and `npm` commands - name: Setup Node.js @@ -233,7 +262,7 @@ jobs: - name: Build Database Setup Image working-directory: "database/.pipeline/" run: | - DEBUG=* npm run db-setup:build -- --pr=$PR_NUMBER --branch=$BRANCH --type=static + DEBUG=* npm run db-setup:build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --branch=$BRANCH --type=static # Build the API image buildAPI: @@ -244,8 +273,10 @@ jobs: env: PR_NUMBER: ${{ github.event.number }} BRANCH: ${{ github.base_ref }} + PIPELINE_CONFIG: ${{ needs.getPipelineConfigMap.outputs.pipeline_config }} needs: - checkoutRepo + - getPipelineConfigMap steps: # Install Node - for `node` and `npm` commands - name: Setup Node.js @@ -283,7 +314,7 @@ jobs: - name: Build API Image working-directory: "api/.pipeline/" run: | - DEBUG=* npm run build -- --pr=$PR_NUMBER --branch=$BRANCH --type=static + DEBUG=* npm run build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --branch=$BRANCH --type=static # Deploy APP image deployAPP: @@ -294,9 +325,11 @@ jobs: env: PR_NUMBER: ${{ github.event.number }} BRANCH: ${{ github.base_ref }} + PIPELINE_CONFIG: ${{ needs.getPipelineConfigMap.outputs.pipeline_config }} needs: - scaleDownPods - buildAPP + - getPipelineConfigMap steps: # Install Node - for `node` and `npm` commands - name: Setup Node.js @@ -334,7 +367,7 @@ jobs: - name: Deploy APP Image working-directory: "app/.pipeline" run: | - DEBUG=* npm run deploy -- --pr=$PR_NUMBER --phase=$BRANCH --branch=$BRANCH --type=static + DEBUG=* npm run deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --phase=$BRANCH --branch=$BRANCH --type=static # Deploy Database image deployDatabase: @@ -345,9 +378,11 @@ jobs: env: PR_NUMBER: ${{ github.event.number }} BRANCH: ${{ github.base_ref }} + PIPELINE_CONFIG: ${{ needs.getPipelineConfigMap.outputs.pipeline_config }} needs: - scaleDownPods - buildDatabase + - getPipelineConfigMap steps: # Install Node - for `node` and `npm` commands - name: Setup Node.js @@ -385,7 +420,7 @@ jobs: - name: Deploy Database Image working-directory: "database/.pipeline/" run: | - DEBUG=* npm run db:deploy -- --pr=$PR_NUMBER --phase=$BRANCH --branch=$BRANCH --type=static + DEBUG=* npm run db:deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --phase=$BRANCH --branch=$BRANCH --type=static # Deploy Database setup image deployDatabaseSetup: @@ -396,10 +431,12 @@ jobs: env: PR_NUMBER: ${{ github.event.number }} BRANCH: ${{ github.base_ref }} + PIPELINE_CONFIG: ${{ needs.getPipelineConfigMap.outputs.pipeline_config }} needs: - scaleDownPods - buildDatabaseSetup - deployDatabase + - getPipelineConfigMap steps: # Install Node - for `node` and `npm` commands - name: Setup Node.js @@ -437,7 +474,7 @@ jobs: - name: Deploy Database Setup Image working-directory: "database/.pipeline/" run: | - DEBUG=* npm run db-setup:deploy -- --pr=$PR_NUMBER --phase=$BRANCH --branch=$BRANCH --type=static + DEBUG=* npm run db-setup:deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --phase=$BRANCH --branch=$BRANCH --type=static # Deploy API image deployAPI: @@ -448,10 +485,12 @@ jobs: env: PR_NUMBER: ${{ github.event.number }} BRANCH: ${{ github.base_ref }} + PIPELINE_CONFIG: ${{ needs.getPipelineConfigMap.outputs.pipeline_config }} needs: - scaleDownPods - buildAPI - deployDatabase + - getPipelineConfigMap steps: # Install Node - for `node` and `npm` commands - name: Setup Node.js @@ -489,7 +528,7 @@ jobs: - name: Deploy API Image working-directory: "api/.pipeline/" run: | - DEBUG=* npm run deploy -- --pr=$PR_NUMBER --phase=$BRANCH --branch=$BRANCH --type=static + DEBUG=* npm run deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --phase=$BRANCH --branch=$BRANCH --type=static # Clean build/deployment artifacts clean: diff --git a/.pipeline/templates/sims-configmap.json b/.pipeline/templates/sims-configmap.json index 4d92ae2fcf..87ec012c1a 100644 --- a/.pipeline/templates/sims-configmap.json +++ b/.pipeline/templates/sims-configmap.json @@ -22,7 +22,30 @@ "memoryLimit": "3Gi" }, "deploy": { + "pr": { + "nodeEnv": "development", + "staticApiUrl": "api-dev-sims.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "dev-sims.apps.silver.devops.gov.bc.ca", + "tz": "America/Vancouver", + "backboneApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", + "backboneIntakePath": "/api/dwc/submission/queue", + "backboneArtifactIntakePath": "/api/artifact/intake", + "backboneIntakeEnabled": false, + "bctwApiHost": "https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca", + "critterbaseApiHost": "https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api", + "elasticsearchURL": "http://es01.a0ec71-dev:9200", + "elasticsearchTaxonomyIndex": "taxonomy_3.0.0", + "s3KeyPrefix": "sims", + "logLevel": "debug", + "cpuRequest": "50m", + "cpuLimit": "400m", + "memoryRequest": "100Mi", + "memoryLimit": "2Gi", + "replicas": "1", + "replicasMax": "2" + }, "dev": { + "nodeEnv": "development", "staticApiUrl": "api-dev-sims.apps.silver.devops.gov.bc.ca", "staticAppUrl": "dev-sims.apps.silver.devops.gov.bc.ca", "tz": "America/Vancouver", @@ -44,6 +67,7 @@ "replicasMax": "2" }, "test": { + "nodeEnv": "production", "staticApiUrl": "api-test-sims.apps.silver.devops.gov.bc.ca", "staticAppUrl": "test-sims.apps.silver.devops.gov.bc.ca", "tz": "America/Vancouver", @@ -65,6 +89,7 @@ "replicasMax": "4" }, "prod": { + "nodeEnv": "production", "staticApiUrl": "api-sims.apps.silver.devops.gov.bc.ca", "staticAppUrl": "sims.apps.silver.devops.gov.bc.ca", "staticAppVanityUrl": "sims.nrs.gov.bc.ca", @@ -97,9 +122,11 @@ }, "deploy": { "pr": { + "nodeEnv": "development", "siteminderLogoutURL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", "maxUploadNumFiles": 10, "maxUploadFileSize": 52428800, + "biohubFeatureFlag": "true", "cpuRequest": "50m", "cpuLimit": "200m", "memoryRequest": "100Mi", @@ -108,11 +135,13 @@ "replicasMax": "1" }, "dev": { + "nodeEnv": "development", "staticApiUrl": "api-dev-sims.apps.silver.devops.gov.bc.ca", "staticAppUrl": "dev-sims.apps.silver.devops.gov.bc.ca", "siteminderLogoutURL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", "maxUploadNumFiles": 10, "maxUploadFileSize": 52428800, + "biohubFeatureFlag": "true", "cpuRequest": "50m", "cpuLimit": "200m", "memoryRequest": "100Mi", @@ -121,11 +150,13 @@ "replicasMax": "1" }, "test": { + "nodeEnv": "production", "staticApiUrl": "api-test-sims.apps.silver.devops.gov.bc.ca", "staticAppUrl": "test-sims.apps.silver.devops.gov.bc.ca", "siteminderLogoutURL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", "maxUploadNumFiles": 10, "maxUploadFileSize": 52428800, + "biohubFeatureFlag": "false", "cpuRequest": "50m", "cpuLimit": "500m", "memoryRequest": "100Mi", @@ -134,12 +165,14 @@ "replicasMax": "3" }, "prod": { + "nodeEnv": "production", "staticApiUrl": "api-sims.apps.silver.devops.gov.bc.ca", "staticAppUrl": "sims.apps.silver.devops.gov.bc.ca", "staticAppVanityUrl": "sims.nrs.gov.bc.ca", "siteminderLogoutURL": "https://logon7.gov.bc.ca/clp-cgi/logoff.cgi", "maxUploadNumFiles": 10, "maxUploadFileSize": 52428800, + "biohubFeatureFlag": "false", "cpuRequest": "50m", "cpuLimit": "500m", "memoryRequest": "100Mi", @@ -155,7 +188,9 @@ }, "deploy": { "pr": { + "nodeEnv": "development", "tz": "America/Vancouver", + "dbSetupDockerfilePath": "./.docker/db/Dockerfile.setup", "volumeCapacity": "500Mi", "cpuRequest": "50m", "cpuLimit": "400m", @@ -164,7 +199,9 @@ "replicas": "1" }, "dev": { + "nodeEnv": "development", "tz": "America/Vancouver", + "dbSetupDockerfilePath": "./.docker/db/Dockerfile.setup", "volumeCapacity": "3Gi", "cpuRequest": "50m", "cpuLimit": "400m", @@ -173,7 +210,9 @@ "replicas": "1" }, "test": { + "nodeEnv": "production", "tz": "America/Vancouver", + "dbSetupDockerfilePath": "./.docker/db/Dockerfile.migrate", "volumeCapacity": "3Gi", "cpuRequest": "50m", "cpuLimit": "1000m", @@ -182,7 +221,9 @@ "replicas": "1" }, "prod": { + "nodeEnv": "production", "tz": "America/Vancouver", + "dbSetupDockerfilePath": "./.docker/db/Dockerfile.migrate", "volumeCapacity": "5Gi", "cpuRequest": "50m", "cpuLimit": "1000m", diff --git a/.pipeline/templates/sims.configmap.yaml b/.pipeline/templates/sims.configmap.yaml index 24feef08d7..41c35980f2 100644 --- a/.pipeline/templates/sims.configmap.yaml +++ b/.pipeline/templates/sims.configmap.yaml @@ -30,7 +30,30 @@ data: "memoryLimit": "3Gi" }, "deploy": { + "pr": { + "nodeEnv": "development", + "staticApiUrl": "api-dev-sims.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "dev-sims.apps.silver.devops.gov.bc.ca", + "tz": "America/Vancouver", + "backboneApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", + "backboneIntakePath": "/api/dwc/submission/queue", + "backboneArtifactIntakePath": "/api/artifact/intake", + "backboneIntakeEnabled": false, + "bctwApiHost": "https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca", + "critterbaseApiHost": "https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api", + "elasticsearchURL": "http://es01.a0ec71-dev:9200", + "elasticsearchTaxonomyIndex": "taxonomy_3.0.0", + "s3KeyPrefix": "sims", + "logLevel": "debug", + "cpuRequest": "50m", + "cpuLimit": "400m", + "memoryRequest": "100Mi", + "memoryLimit": "2Gi", + "replicas": "1", + "replicasMax": "2" + }, "dev": { + "nodeEnv": "development", "staticApiUrl": "api-dev-sims.apps.silver.devops.gov.bc.ca", "staticAppUrl": "dev-sims.apps.silver.devops.gov.bc.ca", "tz": "America/Vancouver", @@ -52,6 +75,7 @@ data: "replicasMax": "2" }, "test": { + "nodeEnv": "production", "staticApiUrl": "api-test-sims.apps.silver.devops.gov.bc.ca", "staticAppUrl": "test-sims.apps.silver.devops.gov.bc.ca", "tz": "America/Vancouver", @@ -73,6 +97,7 @@ data: "replicasMax": "4" }, "prod": { + "nodeEnv": "production", "staticApiUrl": "api-sims.apps.silver.devops.gov.bc.ca", "staticAppUrl": "sims.apps.silver.devops.gov.bc.ca", "staticAppVanityUrl": "sims.nrs.gov.bc.ca", @@ -104,12 +129,27 @@ data: "memoryLimit": "5Gi" }, "deploy": { + "pr": { + "nodeEnv": "development", + "siteminderLogoutURL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", + "maxUploadNumFiles": 10, + "maxUploadFileSize": 52428800, + "biohubFeatureFlag": "true", + "cpuRequest": "50m", + "cpuLimit": "200m", + "memoryRequest": "100Mi", + "memoryLimit": "333Mi", + "replicas": "1", + "replicasMax": "1" + }, "dev": { + "nodeEnv": "development", "staticApiUrl": "api-dev-sims.apps.silver.devops.gov.bc.ca", "staticAppUrl": "dev-sims.apps.silver.devops.gov.bc.ca", "siteminderLogoutURL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", "maxUploadNumFiles": 10, "maxUploadFileSize": 52428800, + "biohubFeatureFlag": "true", "cpuRequest": "50m", "cpuLimit": "200m", "memoryRequest": "100Mi", @@ -118,11 +158,13 @@ data: "replicasMax": "1" }, "test": { + "nodeEnv": "production", "staticApiUrl": "api-test-sims.apps.silver.devops.gov.bc.ca", "staticAppUrl": "test-sims.apps.silver.devops.gov.bc.ca", "siteminderLogoutURL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", "maxUploadNumFiles": 10, "maxUploadFileSize": 52428800, + "biohubFeatureFlag": "false", "cpuRequest": "50m", "cpuLimit": "500m", "memoryRequest": "100Mi", @@ -131,12 +173,14 @@ data: "replicasMax": "3" }, "prod": { + "nodeEnv": "production", "staticApiUrl": "api-sims.apps.silver.devops.gov.bc.ca", "staticAppUrl": "sims.apps.silver.devops.gov.bc.ca", "staticAppVanityUrl": "sims.nrs.gov.bc.ca", "siteminderLogoutURL": "https://logon7.gov.bc.ca/clp-cgi/logoff.cgi", "maxUploadNumFiles": 10, "maxUploadFileSize": 52428800, + "biohubFeatureFlag": "false", "cpuRequest": "50m", "cpuLimit": "500m", "memoryRequest": "100Mi", @@ -151,8 +195,21 @@ data: "tz": "America/Vancouver" }, "deploy": { + "pr": { + "nodeEnv": "development", + "tz": "America/Vancouver", + "dbSetupDockerfilePath": "./.docker/db/Dockerfile.setup", + "volumeCapacity": "500Mi", + "cpuRequest": "50m", + "cpuLimit": "400m", + "memoryRequest": "100Mi", + "memoryLimit": "2Gi", + "replicas": "1" + }, "dev": { + "nodeEnv": "development", "tz": "America/Vancouver", + "dbSetupDockerfilePath": "./.docker/db/Dockerfile.setup", "volumeCapacity": "3Gi", "cpuRequest": "50m", "cpuLimit": "400m", @@ -161,7 +218,9 @@ data: "replicas": "1" }, "test": { + "nodeEnv": "production", "tz": "America/Vancouver", + "dbSetupDockerfilePath": "./.docker/db/Dockerfile.migrate", "volumeCapacity": "3Gi", "cpuRequest": "50m", "cpuLimit": "1000m", @@ -170,7 +229,9 @@ data: "replicas": "1" }, "prod": { + "nodeEnv": "production", "tz": "America/Vancouver", + "dbSetupDockerfilePath": "./.docker/db/Dockerfile.migrate", "volumeCapacity": "5Gi", "cpuRequest": "50m", "cpuLimit": "1000m", @@ -181,6 +242,23 @@ data: } }, "sso": { + "pr": { + "host": "https://dev.loginproxy.gov.bc.ca/auth", + "realm": "standard", + "clientId": "sims-4461", + "keycloakSecret": "keycloak", + "serviceClient": { + "serviceClientName": "sims-svc-4464", + "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" + }, + "cssApi": { + "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", + "cssApiClientId": "service-account-team-1190-4229", + "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", + "keycloakSecretCssApiSecretKey": "css_api_client_secret", + "cssApiEnvironment": "dev" + } + }, "dev": { "host": "https://dev.loginproxy.gov.bc.ca/auth", "realm": "standard", diff --git a/api/.pipeline/config.js b/api/.pipeline/config.js index 351e622c0c..770c27af89 100644 --- a/api/.pipeline/config.js +++ b/api/.pipeline/config.js @@ -19,6 +19,7 @@ const pipelineConfigMap = PipelineConfigMapSchema.parse(JSON.parse(rawPipelineCo const isStaticDeployment = rawOptions.type === 'static'; const branch = (isStaticDeployment && rawOptions.branch) || null; + const tag = (branch && `build-${pipelineConfigMap.version}-${changeId}-${branch}`) || `build-${pipelineConfigMap.version}-${changeId}`; @@ -85,19 +86,14 @@ const phases = { instance: `${pipelineConfigMap.module.api}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, tag: tag, - // tz: pipelineConfigMap.tz.api, branch: branch - // cpuRequest: '50m', - // cpuLimit: '1000m', - // memoryRequest: '100Mi', - // memoryLimit: '3Gi' }, pr: { ...pipelineConfigMap.api.deploy.pr, + phase: 'pr', namespace: 'af2668-dev', name: pipelineConfigMap.module.api, dbName: pipelineConfigMap.module.db, - phase: 'pr', changeId: changeId, suffix: `-dev-${changeId}`, instance: `${pipelineConfigMap.module.api}-dev-${changeId}`, @@ -105,32 +101,15 @@ const phases = { tag: `dev-${pipelineConfigMap.version}-${changeId}`, host: `${pipelineConfigMap.module.api}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, appHost: `${pipelineConfigMap.module.app}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, - // backboneApiHost: 'https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca', - // backboneIntakePath: '/api/dwc/submission/queue', - // backboneArtifactIntakePath: '/api/artifact/intake', - // backboneIntakeEnabled: false, - // bctwApiHost: 'https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca', - // critterbaseApiHost: 'https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api', - nodeEnv: 'development', - // elasticsearchURL: 'http://es01.a0ec71-dev:9200', - // elasticsearchTaxonomyIndex: 'taxonomy_3.0.0', - s3KeyPrefix: `local/${changeId}/sims`, - // tz: pipelineConfigMap.tz.api, - sso: pipelineConfigMap.sso.dev - // logLevel: 'debug', - // cpuRequest: '50m', - // cpuLimit: '400m', - // memoryRequest: '100Mi', - // memoryLimit: '2Gi', - // replicas: '1', - // replicasMax: '1', + sso: pipelineConfigMap.sso.dev, + s3KeyPrefix: `local/${changeId}/sims` }, dev: { ...pipelineConfigMap.api.deploy.dev, + phase: 'dev', namespace: 'af2668-dev', name: pipelineConfigMap.module.api, dbName: pipelineConfigMap.module.db, - phase: 'dev', changeId: 'deploy', suffix: '-dev-deploy', instance: `${pipelineConfigMap.module.api}-dev-deploy`, @@ -138,32 +117,14 @@ const phases = { tag: `dev-${pipelineConfigMap.version}-deploy`, host: pipelineConfigMap.api.deploy.dev.staticApiUrl, appHost: pipelineConfigMap.api.deploy.dev.staticAppUrl, - // backboneApiHost: 'https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca', - // backboneIntakePath: '/api/dwc/submission/queue', - // backboneArtifactIntakePath: '/api/artifact/intake', - // backboneIntakeEnabled: false, - // bctwApiHost: 'https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca', - // critterbaseApiHost: 'https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api', - nodeEnv: 'development', - // elasticsearchURL: 'http://es01.a0ec71-dev:9200', - // elasticsearchTaxonomyIndex: 'taxonomy_3.0.0', - // s3KeyPrefix: 'sims', - // tz: pipelineConfigMap.tz.api, sso: pipelineConfigMap.sso.dev - // logLevel: 'info', - // cpuRequest: '50m', - // cpuLimit: '600m', - // memoryRequest: '100Mi', - // memoryLimit: '3Gi', - // replicas: '1', - // replicasMax: '2', }, test: { ...pipelineConfigMap.api.deploy.test, + phase: 'test', namespace: 'af2668-test', name: pipelineConfigMap.module.api, dbName: pipelineConfigMap.module.db, - phase: 'test', changeId: 'deploy', suffix: `-test`, instance: `${pipelineConfigMap.module.api}-test`, @@ -171,32 +132,14 @@ const phases = { tag: `test-${pipelineConfigMap.version}`, host: pipelineConfigMap.api.deploy.test.staticApiUrl, appHost: pipelineConfigMap.api.deploy.test.staticAppUrl, - // backboneApiHost: 'https://api-test-biohub-platform.apps.silver.devops.gov.bc.ca', - // backboneIntakePath: '/api/dwc/submission/queue', - // backboneArtifactIntakePath: '/api/artifact/intake', - // backboneIntakeEnabled: false, - // bctwApiHost: 'https://moe-bctw-api-test.apps.silver.devops.gov.bc.ca', - // critterbaseApiHost: 'https://moe-critterbase-api-test.apps.silver.devops.gov.bc.ca/api', - nodeEnv: 'production', - // elasticsearchURL: 'http://es01.a0ec71-dev:9200', - // elasticsearchTaxonomyIndex: 'taxonomy_3.0.0', - // s3KeyPrefix: 'sims', - // tz: pipelineConfigMap.tz.api, sso: pipelineConfigMap.sso.test - // logLevel: 'info', - // cpuRequest: '50m', - // cpuLimit: '1000m', - // memoryRequest: '100Mi', - // memoryLimit: '3Gi', - // replicas: '2', - // replicasMax: '4' }, prod: { ...pipelineConfigMap.api.deploy.prod, + phase: 'prod', namespace: 'af2668-prod', name: pipelineConfigMap.module.api, dbName: pipelineConfigMap.module.db, - phase: 'prod', changeId: 'deploy', suffix: `-prod`, instance: `${pipelineConfigMap.module.api}-prod`, @@ -204,25 +147,7 @@ const phases = { tag: `prod-${pipelineConfigMap.version}`, host: pipelineConfigMap.api.deploy.prod.staticApiUrl, appHost: pipelineConfigMap.api.deploy.prod.staticAppVanityUrl, - // backboneApiHost: 'https://api-biohub-platform.apps.silver.devops.gov.bc.ca', - // backboneIntakePath: '/api/dwc/submission/queue', - // backboneArtifactIntakePath: '/api/artifact/intake', - // backboneIntakeEnabled: false, - // bctwApiHost: 'https://moe-bctw-api-prod.apps.silver.devops.gov.bc.ca', - // critterbaseApiHost: 'https://moe-critterbase-api-prod.apps.silver.devops.gov.bc.ca/api', - nodeEnv: 'production', - // elasticsearchURL: 'http://es01.a0ec71-prod:9200', - // elasticsearchTaxonomyIndex: 'taxonomy_3.0.0', - // s3KeyPrefix: 'sims', - // tz: pipelineConfigMap.tz.api, sso: pipelineConfigMap.sso.prod - // logLevel: 'info', - // cpuRequest: '50m', - // cpuLimit: '1000m', - // memoryRequest: '100Mi', - // memoryLimit: '3Gi', - // replicas: '2', - // replicasMax: '4' } }; diff --git a/api/.pipeline/lib/api.build.js b/api/.pipeline/lib/api.build.js index a0b2adab74..c6a8e83a88 100644 --- a/api/.pipeline/lib/api.build.js +++ b/api/.pipeline/lib/api.build.js @@ -11,7 +11,7 @@ const path = require('path'); const apiBuild = (settings) => { const phases = settings.phases; const options = settings.options; - const phase = settings.options.env; + const phase = settings.options.phase; console.log('4=============================================='); console.log('api options', options); diff --git a/api/.pipeline/lib/api.deploy.js b/api/.pipeline/lib/api.deploy.js index 93905c30c7..a40edd736f 100644 --- a/api/.pipeline/lib/api.deploy.js +++ b/api/.pipeline/lib/api.deploy.js @@ -12,7 +12,7 @@ const path = require('path'); const apiDeploy = async (settings) => { const phases = settings.phases; const options = settings.options; - const phase = settings.options.env; + const phase = settings.options.phase; const oc = new OpenShiftClientX(Object.assign({ namespace: phases[phase].namespace }, options)); diff --git a/api/.pipeline/lib/clean.js b/api/.pipeline/lib/clean.js index f76bfe8129..5269acf030 100644 --- a/api/.pipeline/lib/clean.js +++ b/api/.pipeline/lib/clean.js @@ -10,7 +10,7 @@ const { OpenShiftClientX } = require('pipeline-cli'); const clean = (settings) => { const phases = settings.phases; const options = settings.options; - const target_phase = options.phase; + const target_phase = settings.options.phase; const oc = new OpenShiftClientX(Object.assign({ namespace: phases.build.namespace }, options)); diff --git a/api/.pipeline/scripts/api.deploy.js b/api/.pipeline/scripts/api.deploy.js index 47add18a0b..820f1443f6 100644 --- a/api/.pipeline/scripts/api.deploy.js +++ b/api/.pipeline/scripts/api.deploy.js @@ -4,8 +4,6 @@ const process = require('process'); const { apiDeploy } = require('../lib/api.deploy.js'); const config = require('../config.js'); -const settings = { ...config, phase: config.options.phase }; - process.on('unhandledRejection', (reason, promise) => { console.log('api deploy - unhandled rejection:', promise, 'reason:', reason); process.exit(1); @@ -16,7 +14,7 @@ process.on('exit', (code) => { }); // Deploys the api image -apiDeploy(settings).catch((error) => { +apiDeploy(config).catch((error) => { console.log('api deploy - catch - error: ', error); throw error; }); diff --git a/api/.pipeline/scripts/clean.js b/api/.pipeline/scripts/clean.js index 5e7fae7b4f..598bb50187 100644 --- a/api/.pipeline/scripts/clean.js +++ b/api/.pipeline/scripts/clean.js @@ -3,7 +3,5 @@ const { clean } = require('../lib/clean.js'); const config = require('../config.js'); -const settings = { ...config, phase: config.options.phase }; - // Cleans all build and deployment artifacts (pods, etc) -clean(settings); +clean(config); diff --git a/api/.pipeline/utils/configMapSchema.js b/api/.pipeline/utils/configMapSchema.js index d0d62010c9..998d8bb38d 100644 --- a/api/.pipeline/utils/configMapSchema.js +++ b/api/.pipeline/utils/configMapSchema.js @@ -25,6 +25,7 @@ const PipelineConfigMapSchema = z.object({ }), deploy: z.object({ pr: z.object({ + nodeEnv: z.string(), tz: z.string(), backboneApiHost: z.string(), backboneIntakePath: z.string(), @@ -44,6 +45,7 @@ const PipelineConfigMapSchema = z.object({ replicasMax: z.string() }), dev: z.object({ + nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), tz: z.string(), @@ -65,6 +67,7 @@ const PipelineConfigMapSchema = z.object({ replicasMax: z.string() }), test: z.object({ + nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), tz: z.string(), @@ -86,6 +89,7 @@ const PipelineConfigMapSchema = z.object({ replicasMax: z.string() }), prod: z.object({ + nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), staticAppVanityUrl: z.string(), @@ -117,10 +121,12 @@ const PipelineConfigMapSchema = z.object({ memoryLimit: z.string() }), deploy: z.object({ + nodeEnv: z.string(), pr: z.object({ siteminderLogoutURL: z.string(), maxUploadNumFiles: z.number(), maxUploadFileSize: z.number(), + biohubFeatureFlag: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), memoryRequest: z.string(), @@ -129,11 +135,13 @@ const PipelineConfigMapSchema = z.object({ replicasMax: z.string() }), dev: z.object({ + nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), siteminderLogoutURL: z.string(), maxUploadNumFiles: z.number(), maxUploadFileSize: z.number(), + biohubFeatureFlag: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), memoryRequest: z.string(), @@ -142,11 +150,13 @@ const PipelineConfigMapSchema = z.object({ replicasMax: z.string() }), test: z.object({ + nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), siteminderLogoutURL: z.string(), maxUploadNumFiles: z.number(), maxUploadFileSize: z.number(), + biohubFeatureFlag: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), memoryRequest: z.string(), @@ -155,12 +165,14 @@ const PipelineConfigMapSchema = z.object({ replicasMax: z.string() }), prod: z.object({ + nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), staticAppVanityUrl: z.string(), siteminderLogoutURL: z.string(), maxUploadNumFiles: z.number(), maxUploadFileSize: z.number(), + biohubFeatureFlag: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), memoryRequest: z.string(), @@ -176,7 +188,9 @@ const PipelineConfigMapSchema = z.object({ }), deploy: z.object({ pr: z.object({ + nodeEnv: z.string(), tz: z.string(), + dbSetupDockerfilePath: z.string(), volumeCapacity: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), @@ -185,7 +199,9 @@ const PipelineConfigMapSchema = z.object({ replicas: z.string() }), dev: z.object({ + nodeEnv: z.string(), tz: z.string(), + dbSetupDockerfilePath: z.string(), volumeCapacity: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), @@ -194,7 +210,9 @@ const PipelineConfigMapSchema = z.object({ replicas: z.string() }), test: z.object({ + nodeEnv: z.string(), tz: z.string(), + dbSetupDockerfilePath: z.string(), volumeCapacity: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), @@ -203,7 +221,9 @@ const PipelineConfigMapSchema = z.object({ replicas: z.string() }), prod: z.object({ + nodeEnv: z.string(), tz: z.string(), + dbSetupDockerfilePath: z.string(), volumeCapacity: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), diff --git a/app/.pipeline/config.js b/app/.pipeline/config.js index 9d8a432f45..f3f786451b 100644 --- a/app/.pipeline/config.js +++ b/app/.pipeline/config.js @@ -20,13 +20,11 @@ const isStaticDeployment = rawOptions.type === 'static'; // const deployChangeId = (isStaticDeployment && 'deploy') || changeId; const branch = (isStaticDeployment && rawOptions.branch) || null; + const tag = (branch && `build-${pipelineConfigMap.version}-${changeId}-${branch}`) || `build-${pipelineConfigMap.version}-${changeId}`; -// const maxUploadNumFiles = 10; -// const maxUploadFileSize = 52428800; // (bytes) - /** * Parses the npm cli command options and the git action context. * @@ -89,10 +87,6 @@ const phases = { version: `${pipelineConfigMap.version}-${changeId}`, tag: tag, branch: branch - // cpuRequest: '50m', - // cpuLimit: '1000m', - // memoryRequest: '100Mi', - // memoryLimit: '5Gi' }, pr: { ...pipelineConfigMap.app.deploy.pr, @@ -106,18 +100,7 @@ const phases = { tag: `dev-${pipelineConfigMap.version}-${changeId}`, host: `${pipelineConfigMap.module.app}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, apiHost: `${pipelineConfigMap.module.api}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, - // siteminderLogoutURL: pipelineConfigMap.siteminderLogoutURL.dev, - // maxUploadNumFiles, - // maxUploadFileSize, - nodeEnv: 'development', - sso: pipelineConfigMap.sso.dev, - // cpuRequest: '50m', - // cpuLimit: '200m', - // memoryRequest: '100Mi', - // memoryLimit: '333Mi', - // replicas: (isStaticDeployment && '1') || '1', - // replicasMax: (isStaticDeployment && '2') || '1' - biohubFeatureFlag: 'true' + sso: pipelineConfigMap.sso.dev }, dev: { ...pipelineConfigMap.app.deploy.dev, @@ -131,18 +114,7 @@ const phases = { tag: `dev-${pipelineConfigMap.version}-deploy`, host: pipelineConfigMap.app.deploy.dev.staticAppUrl, apiHost: pipelineConfigMap.app.deploy.dev.staticApiUrl, - // siteminderLogoutURL: pipelineConfigMap.siteminderLogoutURL.dev, - // maxUploadNumFiles, - // maxUploadFileSize, - nodeEnv: 'development', - sso: pipelineConfigMap.sso.dev, - // cpuRequest: '50m', - // cpuLimit: '200m', - // memoryRequest: '100Mi', - // memoryLimit: '333Mi', - // replicas: (isStaticDeployment && '1') || '1', - // replicasMax: (isStaticDeployment && '2') || '1', - biohubFeatureFlag: 'true' + sso: pipelineConfigMap.sso.dev }, test: { ...pipelineConfigMap.app.deploy.test, @@ -156,18 +128,7 @@ const phases = { tag: `test-${pipelineConfigMap.version}`, host: pipelineConfigMap.app.deploy.test.staticAppUrl, apiHost: pipelineConfigMap.app.deploy.test.staticApiUrl, - // siteminderLogoutURL: pipelineConfigMap.siteminderLogoutURL.test, - // maxUploadNumFiles, - // maxUploadFileSize, - nodeEnv: 'production', - sso: pipelineConfigMap.sso.test, - // cpuRequest: '50m', - // cpuLimit: '500m', - // memoryRequest: '100Mi', - // memoryLimit: '500Mi', - // replicas: '2', - // replicasMax: '3', - biohubFeatureFlag: 'false' + sso: pipelineConfigMap.sso.test }, prod: { ...pipelineConfigMap.app.deploy.prod, @@ -181,18 +142,7 @@ const phases = { tag: `prod-${pipelineConfigMap.version}`, host: pipelineConfigMap.app.deploy.prod.staticAppUrl, apiHost: pipelineConfigMap.app.deploy.prod.staticApiUrl, - // siteminderLogoutURL: pipelineConfigMap.siteminderLogoutURL.prod, - // maxUploadNumFiles, - // maxUploadFileSize, - nodeEnv: 'production', - sso: pipelineConfigMap.sso.prod, - // cpuRequest: '50m', - // cpuLimit: '500m', - // memoryRequest: '100Mi', - // memoryLimit: '500Mi', - // replicas: '2', - // replicasMax: '3', - biohubFeatureFlag: 'false' + sso: pipelineConfigMap.sso.prod } }; diff --git a/app/.pipeline/lib/app.build.js b/app/.pipeline/lib/app.build.js index 13e4913042..1b5485dcc8 100644 --- a/app/.pipeline/lib/app.build.js +++ b/app/.pipeline/lib/app.build.js @@ -11,7 +11,7 @@ const path = require('path'); const appBuild = (settings) => { const phases = settings.phases; const options = settings.options; - const phase = settings.options.env; + const phase = settings.options.phase; const oc = new OpenShiftClientX(Object.assign({ namespace: phases[phase].namespace }, options)); diff --git a/app/.pipeline/lib/app.deploy.js b/app/.pipeline/lib/app.deploy.js index d3dc07a425..ddbb2e6665 100644 --- a/app/.pipeline/lib/app.deploy.js +++ b/app/.pipeline/lib/app.deploy.js @@ -6,7 +6,7 @@ const path = require('path'); const appDeploy = async (settings) => { const phases = settings.phases; const options = settings.options; - const phase = settings.options.env; + const phase = settings.options.phase; const oc = new OpenShiftClientX(Object.assign({ namespace: phases[phase].namespace }, options)); diff --git a/app/.pipeline/lib/clean.js b/app/.pipeline/lib/clean.js index 9cd225d191..1ebf3629a6 100644 --- a/app/.pipeline/lib/clean.js +++ b/app/.pipeline/lib/clean.js @@ -10,7 +10,7 @@ const { OpenShiftClientX } = require('pipeline-cli'); const clean = (settings) => { const phases = settings.phases; const options = settings.options; - const target_phase = options.phase; + const target_phase = settings.options.phase; const oc = new OpenShiftClientX(Object.assign({ namespace: phases.build.namespace }, options)); diff --git a/app/.pipeline/scripts/app.deploy.js b/app/.pipeline/scripts/app.deploy.js index 128a729257..6e9ef3d5da 100644 --- a/app/.pipeline/scripts/app.deploy.js +++ b/app/.pipeline/scripts/app.deploy.js @@ -4,8 +4,6 @@ const process = require('process'); const { appDeploy } = require('../lib/app.deploy.js'); const config = require('../config.js'); -const settings = { ...config, phase: config.options.phase }; - process.on('unhandledRejection', (reason, promise) => { console.log('app deploy - unhandled rejection:', promise, 'reason:', reason); process.exit(1); @@ -16,7 +14,7 @@ process.on('exit', (code) => { }); // Deploys the app image -appDeploy(settings).catch((error) => { +appDeploy(config).catch((error) => { console.log('app deploy - catch - error: ', error); throw error; }); diff --git a/app/.pipeline/scripts/clean.js b/app/.pipeline/scripts/clean.js index 5e7fae7b4f..598bb50187 100644 --- a/app/.pipeline/scripts/clean.js +++ b/app/.pipeline/scripts/clean.js @@ -3,7 +3,5 @@ const { clean } = require('../lib/clean.js'); const config = require('../config.js'); -const settings = { ...config, phase: config.options.phase }; - // Cleans all build and deployment artifacts (pods, etc) -clean(settings); +clean(config); diff --git a/app/.pipeline/utils/configMapSchema.js b/app/.pipeline/utils/configMapSchema.js index d0d62010c9..998d8bb38d 100644 --- a/app/.pipeline/utils/configMapSchema.js +++ b/app/.pipeline/utils/configMapSchema.js @@ -25,6 +25,7 @@ const PipelineConfigMapSchema = z.object({ }), deploy: z.object({ pr: z.object({ + nodeEnv: z.string(), tz: z.string(), backboneApiHost: z.string(), backboneIntakePath: z.string(), @@ -44,6 +45,7 @@ const PipelineConfigMapSchema = z.object({ replicasMax: z.string() }), dev: z.object({ + nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), tz: z.string(), @@ -65,6 +67,7 @@ const PipelineConfigMapSchema = z.object({ replicasMax: z.string() }), test: z.object({ + nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), tz: z.string(), @@ -86,6 +89,7 @@ const PipelineConfigMapSchema = z.object({ replicasMax: z.string() }), prod: z.object({ + nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), staticAppVanityUrl: z.string(), @@ -117,10 +121,12 @@ const PipelineConfigMapSchema = z.object({ memoryLimit: z.string() }), deploy: z.object({ + nodeEnv: z.string(), pr: z.object({ siteminderLogoutURL: z.string(), maxUploadNumFiles: z.number(), maxUploadFileSize: z.number(), + biohubFeatureFlag: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), memoryRequest: z.string(), @@ -129,11 +135,13 @@ const PipelineConfigMapSchema = z.object({ replicasMax: z.string() }), dev: z.object({ + nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), siteminderLogoutURL: z.string(), maxUploadNumFiles: z.number(), maxUploadFileSize: z.number(), + biohubFeatureFlag: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), memoryRequest: z.string(), @@ -142,11 +150,13 @@ const PipelineConfigMapSchema = z.object({ replicasMax: z.string() }), test: z.object({ + nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), siteminderLogoutURL: z.string(), maxUploadNumFiles: z.number(), maxUploadFileSize: z.number(), + biohubFeatureFlag: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), memoryRequest: z.string(), @@ -155,12 +165,14 @@ const PipelineConfigMapSchema = z.object({ replicasMax: z.string() }), prod: z.object({ + nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), staticAppVanityUrl: z.string(), siteminderLogoutURL: z.string(), maxUploadNumFiles: z.number(), maxUploadFileSize: z.number(), + biohubFeatureFlag: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), memoryRequest: z.string(), @@ -176,7 +188,9 @@ const PipelineConfigMapSchema = z.object({ }), deploy: z.object({ pr: z.object({ + nodeEnv: z.string(), tz: z.string(), + dbSetupDockerfilePath: z.string(), volumeCapacity: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), @@ -185,7 +199,9 @@ const PipelineConfigMapSchema = z.object({ replicas: z.string() }), dev: z.object({ + nodeEnv: z.string(), tz: z.string(), + dbSetupDockerfilePath: z.string(), volumeCapacity: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), @@ -194,7 +210,9 @@ const PipelineConfigMapSchema = z.object({ replicas: z.string() }), test: z.object({ + nodeEnv: z.string(), tz: z.string(), + dbSetupDockerfilePath: z.string(), volumeCapacity: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), @@ -203,7 +221,9 @@ const PipelineConfigMapSchema = z.object({ replicas: z.string() }), prod: z.object({ + nodeEnv: z.string(), tz: z.string(), + dbSetupDockerfilePath: z.string(), volumeCapacity: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), diff --git a/database/.pipeline/config.js b/database/.pipeline/config.js index b0c7889582..21f3e1f9b1 100644 --- a/database/.pipeline/config.js +++ b/database/.pipeline/config.js @@ -19,18 +19,13 @@ const pipelineConfigMap = PipelineConfigMapSchema.parse(JSON.parse(rawPipelineCo const isStaticDeployment = rawOptions.type === 'static'; const deployChangeId = (isStaticDeployment && 'deploy') || changeId; + const branch = (isStaticDeployment && rawOptions.branch) || null; + const tag = (branch && `build-${pipelineConfigMap.version}-${changeId}-${branch}`) || `build-${pipelineConfigMap.version}-${changeId}`; -// Default: run both seeding and migrations -let dbSetupDockerfilePath = './.docker/db/Dockerfile.setup'; -if (isStaticDeployment && options.branch === 'prod') { - // If this is static build to prod, then only run the migrations - dbSetupDockerfilePath = './.docker/db/Dockerfile.migrate'; -} - /** * Parses the npm cli command options and the git action context. * @@ -52,7 +47,9 @@ if (isStaticDeployment && options.branch === 'prod') { * ref: '', * branch_ref: '' * }, - * pr: '', + * pr?: '', + * branch?: '', + * static?: '', * config: {}, // JSON config map * type?: 'static' * }} @@ -84,97 +81,59 @@ const options = processOptions(rawOptions); const phases = { build: { ...pipelineConfigMap.database.build, + phase: 'build', namespace: 'af2668-tools', name: pipelineConfigMap.module.db, - phase: 'build', changeId: changeId, suffix: `-build-${changeId}`, instance: `${pipelineConfigMap.module.db}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, tag: tag, - // tz: pipelineConfigMap.tz.db, - branch: branch, - dbSetupDockerfilePath: dbSetupDockerfilePath + branch: branch }, pr: { ...pipelineConfigMap.database.deploy.pr, + phase: 'dev', namespace: 'af2668-dev', name: pipelineConfigMap.module.db, - phase: 'dev', changeId: deployChangeId, suffix: `-dev-${deployChangeId}`, instance: `${pipelineConfigMap.module.db}-dev-${deployChangeId}`, version: `${deployChangeId}-${changeId}`, - tag: `dev-${pipelineConfigMap.version}-${deployChangeId}`, - nodeEnv: 'development', - // tz: pipelineConfigMap.tz.db, - dbSetupDockerfilePath: dbSetupDockerfilePath - // volumeCapacity: (isStaticDeployment && '3Gi') || '500Mi', - // cpuRequest: '50m', - // cpuLimit: '400m', - // memoryRequest: '100Mi', - // memoryLimit: '2Gi', - // replicas: '1' + tag: `dev-${pipelineConfigMap.version}-${deployChangeId}` }, dev: { ...pipelineConfigMap.database.deploy.dev, + phase: 'dev', namespace: 'af2668-dev', name: pipelineConfigMap.module.db, - phase: 'dev', changeId: deployChangeId, suffix: `-dev-${deployChangeId}`, instance: `${pipelineConfigMap.module.db}-dev-${deployChangeId}`, version: `${deployChangeId}-${changeId}`, - tag: `dev-${pipelineConfigMap.version}-${deployChangeId}`, - nodeEnv: 'development', - // tz: pipelineConfigMap.tz.db, - dbSetupDockerfilePath: dbSetupDockerfilePath - // volumeCapacity: (isStaticDeployment && '3Gi') || '500Mi', - // cpuRequest: '50m', - // cpuLimit: '600m', - // memoryRequest: '100Mi', - // memoryLimit: '3Gi', - // replicas: '1' + tag: `dev-${pipelineConfigMap.version}-${deployChangeId}` }, test: { ...pipelineConfigMap.database.deploy.test, + phase: 'test', namespace: 'af2668-test', name: pipelineConfigMap.module.db, - phase: 'test', changeId: deployChangeId, suffix: `-test`, instance: `${pipelineConfigMap.module.db}-test`, version: pipelineConfigMap.version, - tag: `test-${pipelineConfigMap.version}`, - nodeEnv: 'production', - // tz: pipelineConfigMap.tz.db, - dbSetupDockerfilePath: dbSetupDockerfilePath - // volumeCapacity: '3Gi', - // cpuRequest: '50m', - // cpuLimit: '1000m', - // memoryRequest: '100Mi', - // memoryLimit: '3Gi', - // replicas: '1' + tag: `test-${pipelineConfigMap.version}` }, prod: { ...pipelineConfigMap.database.deploy.prod, + phase: 'prod', namespace: 'af2668-prod', name: pipelineConfigMap.module.db, - phase: 'prod', changeId: deployChangeId, suffix: `-prod`, instance: `${pipelineConfigMap.module.db}-prod`, version: pipelineConfigMap.version, - tag: `prod-${pipelineConfigMap.version}`, - nodeEnv: 'production', - // tz: pipelineConfigMap.tz.db, - dbSetupDockerfilePath: dbSetupDockerfilePath - // volumeCapacity: '5Gi', - // cpuRequest: '50m', - // cpuLimit: '1000m', - // memoryRequest: '100Mi', - // memoryLimit: '3Gi', - // replicas: '1' + tag: `prod-${pipelineConfigMap.version}` } }; diff --git a/database/.pipeline/lib/clean.js b/database/.pipeline/lib/clean.js index 64e6d9b0de..2998bad9da 100644 --- a/database/.pipeline/lib/clean.js +++ b/database/.pipeline/lib/clean.js @@ -6,7 +6,7 @@ const { checkAndClean } = require('../utils/utils'); const clean = async (settings) => { const phases = settings.phases; const options = settings.options; - const target_phase = options.phase; + const target_phase = settings.options.phase; const oc = new OpenShiftClientX(Object.assign({ namespace: phases.build.namespace }, options)); diff --git a/database/.pipeline/lib/db.build.js b/database/.pipeline/lib/db.build.js index c3ccb8f405..5056adb999 100644 --- a/database/.pipeline/lib/db.build.js +++ b/database/.pipeline/lib/db.build.js @@ -11,7 +11,7 @@ const path = require('path'); const dbBuild = (settings) => { const phases = settings.phases; const options = settings.options; - const phase = settings.options.env; + const phase = settings.options.phase; const oc = new OpenShiftClientX(Object.assign({ namespace: phases[phase].namespace }, options)); diff --git a/database/.pipeline/lib/db.deploy.js b/database/.pipeline/lib/db.deploy.js index cbc1485827..3d8f5a57ce 100644 --- a/database/.pipeline/lib/db.deploy.js +++ b/database/.pipeline/lib/db.deploy.js @@ -12,7 +12,7 @@ const path = require('path'); const dbDeploy = async (settings) => { const phases = settings.phases; const options = settings.options; - const phase = settings.options.env; + const phase = settings.options.phase; const oc = new OpenShiftClientX(Object.assign({ namespace: phases[phase].namespace }, options)); diff --git a/database/.pipeline/lib/db.setup.build.js b/database/.pipeline/lib/db.setup.build.js index ee90b27e00..24f778c898 100644 --- a/database/.pipeline/lib/db.setup.build.js +++ b/database/.pipeline/lib/db.setup.build.js @@ -11,7 +11,7 @@ const path = require('path'); const dbSetupBuild = (settings) => { const phases = settings.phases; const options = settings.options; - const phase = settings.options.env; + const phase = settings.options.phase; const oc = new OpenShiftClientX(Object.assign({ namespace: phases[phase].namespace }, options)); diff --git a/database/.pipeline/lib/db.setup.deploy.js b/database/.pipeline/lib/db.setup.deploy.js index 08c9aeb14f..7a1f5775f1 100644 --- a/database/.pipeline/lib/db.setup.deploy.js +++ b/database/.pipeline/lib/db.setup.deploy.js @@ -14,7 +14,7 @@ const { const dbSetupDeploy = async (settings) => { const phases = settings.phases; const options = settings.options; - const phase = settings.options.env; + const phase = settings.options.phase; const oc = new OpenShiftClientX(Object.assign({ namespace: phases[phase].namespace }, options)); diff --git a/database/.pipeline/scripts/clean.js b/database/.pipeline/scripts/clean.js index 5e7fae7b4f..598bb50187 100644 --- a/database/.pipeline/scripts/clean.js +++ b/database/.pipeline/scripts/clean.js @@ -3,7 +3,5 @@ const { clean } = require('../lib/clean.js'); const config = require('../config.js'); -const settings = { ...config, phase: config.options.phase }; - // Cleans all build and deployment artifacts (pods, etc) -clean(settings); +clean(config); diff --git a/database/.pipeline/scripts/db.deploy.js b/database/.pipeline/scripts/db.deploy.js index 5589a45346..45107090cb 100644 --- a/database/.pipeline/scripts/db.deploy.js +++ b/database/.pipeline/scripts/db.deploy.js @@ -4,8 +4,6 @@ const process = require('process'); const { dbDeploy } = require('../lib/db.deploy.js'); const config = require('../config.js'); -const settings = { ...config, phase: config.options.phase }; - process.on('unhandledRejection', (reason, promise) => { console.log('database deploy - unhandled rejection:', promise, 'reason:', reason); process.exit(1); @@ -16,7 +14,7 @@ process.on('exit', (code) => { }); // Deploys the database image -dbDeploy(settings).catch((error) => { +dbDeploy(config).catch((error) => { console.log('database deploy - catch - error: ', error); throw error; }); diff --git a/database/.pipeline/scripts/db.setup.build.js b/database/.pipeline/scripts/db.setup.build.js index e2f08551c7..23b7273536 100644 --- a/database/.pipeline/scripts/db.setup.build.js +++ b/database/.pipeline/scripts/db.setup.build.js @@ -3,7 +3,5 @@ const { dbSetupBuild } = require('../lib/db.setup.build.js'); const config = require('../config.js'); -const settings = { ...config, phase: config.options.phase }; - // build database Setup (migrations, seeding, etc) image -dbSetupBuild(settings); +dbSetupBuild(config); diff --git a/database/.pipeline/scripts/db.setup.deploy.js b/database/.pipeline/scripts/db.setup.deploy.js index ce708f5351..97d53d4857 100644 --- a/database/.pipeline/scripts/db.setup.deploy.js +++ b/database/.pipeline/scripts/db.setup.deploy.js @@ -4,8 +4,6 @@ const process = require('process'); const { dbSetupDeploy } = require('../lib/db.setup.deploy.js'); const config = require('../config.js'); -const settings = { ...config, phase: config.options.phase }; - process.on('unhandledRejection', (reason, promise) => { console.log('database setup deploy - unhandled rejection:', promise, 'reason:', reason); process.exit(1); @@ -16,7 +14,7 @@ process.on('exit', (code) => { }); // deploy database setup (migrations, seeding, etc) -dbSetupDeploy(settings).catch((error) => { +dbSetupDeploy(config).catch((error) => { console.log('database setup deploy - catch - error: ', error); throw error; }); diff --git a/database/.pipeline/utils/configMapSchema.js b/database/.pipeline/utils/configMapSchema.js index d0d62010c9..998d8bb38d 100644 --- a/database/.pipeline/utils/configMapSchema.js +++ b/database/.pipeline/utils/configMapSchema.js @@ -25,6 +25,7 @@ const PipelineConfigMapSchema = z.object({ }), deploy: z.object({ pr: z.object({ + nodeEnv: z.string(), tz: z.string(), backboneApiHost: z.string(), backboneIntakePath: z.string(), @@ -44,6 +45,7 @@ const PipelineConfigMapSchema = z.object({ replicasMax: z.string() }), dev: z.object({ + nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), tz: z.string(), @@ -65,6 +67,7 @@ const PipelineConfigMapSchema = z.object({ replicasMax: z.string() }), test: z.object({ + nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), tz: z.string(), @@ -86,6 +89,7 @@ const PipelineConfigMapSchema = z.object({ replicasMax: z.string() }), prod: z.object({ + nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), staticAppVanityUrl: z.string(), @@ -117,10 +121,12 @@ const PipelineConfigMapSchema = z.object({ memoryLimit: z.string() }), deploy: z.object({ + nodeEnv: z.string(), pr: z.object({ siteminderLogoutURL: z.string(), maxUploadNumFiles: z.number(), maxUploadFileSize: z.number(), + biohubFeatureFlag: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), memoryRequest: z.string(), @@ -129,11 +135,13 @@ const PipelineConfigMapSchema = z.object({ replicasMax: z.string() }), dev: z.object({ + nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), siteminderLogoutURL: z.string(), maxUploadNumFiles: z.number(), maxUploadFileSize: z.number(), + biohubFeatureFlag: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), memoryRequest: z.string(), @@ -142,11 +150,13 @@ const PipelineConfigMapSchema = z.object({ replicasMax: z.string() }), test: z.object({ + nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), siteminderLogoutURL: z.string(), maxUploadNumFiles: z.number(), maxUploadFileSize: z.number(), + biohubFeatureFlag: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), memoryRequest: z.string(), @@ -155,12 +165,14 @@ const PipelineConfigMapSchema = z.object({ replicasMax: z.string() }), prod: z.object({ + nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), staticAppVanityUrl: z.string(), siteminderLogoutURL: z.string(), maxUploadNumFiles: z.number(), maxUploadFileSize: z.number(), + biohubFeatureFlag: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), memoryRequest: z.string(), @@ -176,7 +188,9 @@ const PipelineConfigMapSchema = z.object({ }), deploy: z.object({ pr: z.object({ + nodeEnv: z.string(), tz: z.string(), + dbSetupDockerfilePath: z.string(), volumeCapacity: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), @@ -185,7 +199,9 @@ const PipelineConfigMapSchema = z.object({ replicas: z.string() }), dev: z.object({ + nodeEnv: z.string(), tz: z.string(), + dbSetupDockerfilePath: z.string(), volumeCapacity: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), @@ -194,7 +210,9 @@ const PipelineConfigMapSchema = z.object({ replicas: z.string() }), test: z.object({ + nodeEnv: z.string(), tz: z.string(), + dbSetupDockerfilePath: z.string(), volumeCapacity: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), @@ -203,7 +221,9 @@ const PipelineConfigMapSchema = z.object({ replicas: z.string() }), prod: z.object({ + nodeEnv: z.string(), tz: z.string(), + dbSetupDockerfilePath: z.string(), volumeCapacity: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), diff --git a/database/.pipeline/utils/utils.js b/database/.pipeline/utils/utils.js index c365828b3d..216090830b 100644 --- a/database/.pipeline/utils/utils.js +++ b/database/.pipeline/utils/utils.js @@ -31,7 +31,7 @@ const getResourceByName = (resourceName, oc) => { const getResourceByRaw = (selector, type, settings, oc) => { const phases = settings.phases; const options = settings.options; - const phase = settings.options.env; + const phase = settings.options.phase; const result = oc.raw('get', [type], { selector: selector, From b72f7f8e74cb352b81e446f9401898780b99afad Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Fri, 26 Jan 2024 16:58:23 -0800 Subject: [PATCH 09/62] Fix configmap zod schema --- api/.pipeline/utils/configMapSchema.js | 2 +- app/.pipeline/utils/configMapSchema.js | 2 +- database/.pipeline/utils/configMapSchema.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/.pipeline/utils/configMapSchema.js b/api/.pipeline/utils/configMapSchema.js index 998d8bb38d..bc2af68393 100644 --- a/api/.pipeline/utils/configMapSchema.js +++ b/api/.pipeline/utils/configMapSchema.js @@ -121,8 +121,8 @@ const PipelineConfigMapSchema = z.object({ memoryLimit: z.string() }), deploy: z.object({ - nodeEnv: z.string(), pr: z.object({ + nodeEnv: z.string(), siteminderLogoutURL: z.string(), maxUploadNumFiles: z.number(), maxUploadFileSize: z.number(), diff --git a/app/.pipeline/utils/configMapSchema.js b/app/.pipeline/utils/configMapSchema.js index 998d8bb38d..bc2af68393 100644 --- a/app/.pipeline/utils/configMapSchema.js +++ b/app/.pipeline/utils/configMapSchema.js @@ -121,8 +121,8 @@ const PipelineConfigMapSchema = z.object({ memoryLimit: z.string() }), deploy: z.object({ - nodeEnv: z.string(), pr: z.object({ + nodeEnv: z.string(), siteminderLogoutURL: z.string(), maxUploadNumFiles: z.number(), maxUploadFileSize: z.number(), diff --git a/database/.pipeline/utils/configMapSchema.js b/database/.pipeline/utils/configMapSchema.js index 998d8bb38d..bc2af68393 100644 --- a/database/.pipeline/utils/configMapSchema.js +++ b/database/.pipeline/utils/configMapSchema.js @@ -121,8 +121,8 @@ const PipelineConfigMapSchema = z.object({ memoryLimit: z.string() }), deploy: z.object({ - nodeEnv: z.string(), pr: z.object({ + nodeEnv: z.string(), siteminderLogoutURL: z.string(), maxUploadNumFiles: z.number(), maxUploadFileSize: z.number(), From 62b5f0f1fd1c365a8bdf77d42bf45ae79e0e6237 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Fri, 26 Jan 2024 17:22:10 -0800 Subject: [PATCH 10/62] ignore-skip From df40f96c4bed87b4ee36fedb60ad75d639341952 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Fri, 26 Jan 2024 17:34:24 -0800 Subject: [PATCH 11/62] Change biohubbc to sims --- api/.pipeline/templates/api.bc.yaml | 6 +++--- api/.pipeline/templates/api.dc.yaml | 6 +++--- app/.pipeline/templates/app.bc.yaml | 6 +++--- app/.pipeline/templates/app.dc.yaml | 6 +++--- database/.pipeline/templates/db.dc.yaml | 4 ++-- database/.pipeline/templates/db.setup.bc.yaml | 6 +++--- database/.pipeline/templates/db.setup.dc.yaml | 6 +++--- database/.pipeline/templates/db.setup.is.yaml | 2 +- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/api/.pipeline/templates/api.bc.yaml b/api/.pipeline/templates/api.bc.yaml index 6b3bf00d04..9de416aa2f 100644 --- a/api/.pipeline/templates/api.bc.yaml +++ b/api/.pipeline/templates/api.bc.yaml @@ -1,15 +1,15 @@ apiVersion: template.openshift.io/v1 kind: Template metadata: - name: biohubbc-api-bc + name: sims-api-bc labels: - build: biohubbc-api + build: sims-api parameters: - name: NAME displayName: Name description: Image name required: true - value: biohubbc-api + value: sims-api - name: SUFFIX displayName: Name Suffix description: A suffix appended to all objects diff --git a/api/.pipeline/templates/api.dc.yaml b/api/.pipeline/templates/api.dc.yaml index 683a8b632a..74bbb609a1 100644 --- a/api/.pipeline/templates/api.dc.yaml +++ b/api/.pipeline/templates/api.dc.yaml @@ -1,12 +1,12 @@ apiVersion: template.openshift.io/v1 kind: Template metadata: - name: biohubbc-api-dc + name: sims-api-dc labels: - build: biohubbc-api + build: sims-api parameters: - name: NAME - value: biohubbc-api + value: sims-api - name: SUFFIX value: '-dev' - name: VERSION diff --git a/app/.pipeline/templates/app.bc.yaml b/app/.pipeline/templates/app.bc.yaml index 346a021e03..ccab4daca0 100644 --- a/app/.pipeline/templates/app.bc.yaml +++ b/app/.pipeline/templates/app.bc.yaml @@ -1,15 +1,15 @@ apiVersion: template.openshift.io/v1 kind: Template metadata: - name: biohubbc-app-bc + name: sims-app-bc labels: - build: biohubbc-app + build: sims-app parameters: - name: NAME displayName: Name description: Image name required: true - value: biohubbc-app + value: sims-app - name: SUFFIX displayName: Name Suffix description: A suffix appended to all objects diff --git a/app/.pipeline/templates/app.dc.yaml b/app/.pipeline/templates/app.dc.yaml index dc5b3a1823..64c7850e02 100644 --- a/app/.pipeline/templates/app.dc.yaml +++ b/app/.pipeline/templates/app.dc.yaml @@ -1,12 +1,12 @@ apiVersion: template.openshift.io/v1 kind: Template metadata: - name: biohubbc-app-dc + name: sims-app-dc labels: - build: biohubbc-app + build: sims-app parameters: - name: NAME - value: biohubbc-app + value: sims-app - name: SUFFIX value: 'dev' - name: VERSION diff --git a/database/.pipeline/templates/db.dc.yaml b/database/.pipeline/templates/db.dc.yaml index e4b567fed5..162dc86e38 100644 --- a/database/.pipeline/templates/db.dc.yaml +++ b/database/.pipeline/templates/db.dc.yaml @@ -3,9 +3,9 @@ apiVersion: template.openshift.io/v1 labels: template: postgresql-persistent-template metadata: - name: biohubbc-db-dc + name: sims-db-dc labels: - build: biohubbc-db + build: sims-db parameters: - description: The name of the OpenShift Service exposed for the database. displayName: Database Service Name diff --git a/database/.pipeline/templates/db.setup.bc.yaml b/database/.pipeline/templates/db.setup.bc.yaml index d2e18d14e4..73cabb44ea 100644 --- a/database/.pipeline/templates/db.setup.bc.yaml +++ b/database/.pipeline/templates/db.setup.bc.yaml @@ -1,15 +1,15 @@ apiVersion: template.openshift.io/v1 kind: Template metadata: - name: biohubbc-db-setup-bc + name: sims-db-setup-bc labels: - build: biohubbc-db-setup + build: sims-db-setup parameters: - name: NAME displayName: Name description: Image name required: true - value: biohubbc-db-setup + value: sims-db-setup - name: SUFFIX displayName: Name Suffix description: A suffix appended to all objects diff --git a/database/.pipeline/templates/db.setup.dc.yaml b/database/.pipeline/templates/db.setup.dc.yaml index a384ae55a5..99343f744d 100644 --- a/database/.pipeline/templates/db.setup.dc.yaml +++ b/database/.pipeline/templates/db.setup.dc.yaml @@ -1,15 +1,15 @@ kind: Template apiVersion: template.openshift.io/v1 metadata: - name: biohubbc-db-setup-dc + name: sims-db-setup-dc labels: - build: biohubbc-db-setup + build: sims-db-setup parameters: - name: IMAGE description: 'Image for pod' required: true - name: NAME - value: biohubbc-db-setup + value: sims-db-setup - name: SUFFIX value: '-dev' - name: VERSION diff --git a/database/.pipeline/templates/db.setup.is.yaml b/database/.pipeline/templates/db.setup.is.yaml index 6434f042aa..2482ba52dd 100644 --- a/database/.pipeline/templates/db.setup.is.yaml +++ b/database/.pipeline/templates/db.setup.is.yaml @@ -2,7 +2,7 @@ apiVersion: template.openshift.io/v1 kind: Template parameters: - name: NAME - value: biohubbc-db-setup + value: sims-db-setup objects: - apiVersion: image.openshift.io/v1 kind: ImageStream From 6d1672094fde69ac3b7f2305f232185878e2e871 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Fri, 26 Jan 2024 18:32:45 -0800 Subject: [PATCH 12/62] Updates --- .github/workflows/cleanClosedPR.yml | 12 +- .github/workflows/cleanMergedPR.yml | 12 +- .github/workflows/deploy.yml | 16 +- .github/workflows/deployStatic.yml | 20 +- .pipeline/templates/sims-configmap.json | 306 ------------------- .pipeline/templates/sims.configmap.yaml | 314 -------------------- api/.pipeline/config.js | 176 +++++++---- api/.pipeline/lib/api.build.js | 46 +-- api/.pipeline/lib/api.deploy.js | 83 +++--- api/.pipeline/lib/clean.js | 1 + api/.pipeline/scripts/api.build.js | 4 +- api/.pipeline/utils/configMapSchema.js | 148 +++++++-- app/.pipeline/config.js | 160 ++++++---- app/.pipeline/lib/app.build.js | 21 +- app/.pipeline/lib/app.deploy.js | 51 ++-- app/.pipeline/lib/clean.js | 1 + app/.pipeline/scripts/app.build.js | 4 +- app/.pipeline/utils/configMapSchema.js | 148 +++++++-- database/.pipeline/config.js | 136 ++++++--- database/.pipeline/lib/clean.js | 111 +++---- database/.pipeline/lib/db.build.js | 11 +- database/.pipeline/lib/db.deploy.js | 29 +- database/.pipeline/lib/db.setup.build.js | 25 +- database/.pipeline/lib/db.setup.deploy.js | 25 +- database/.pipeline/scripts/db.build.js | 4 +- database/.pipeline/utils/configMapSchema.js | 148 +++++++-- database/.pipeline/utils/utils.js | 4 +- 27 files changed, 895 insertions(+), 1121 deletions(-) delete mode 100644 .pipeline/templates/sims-configmap.json delete mode 100644 .pipeline/templates/sims.configmap.yaml diff --git a/.github/workflows/cleanClosedPR.yml b/.github/workflows/cleanClosedPR.yml index f716dc3a8d..6213ef2ecb 100644 --- a/.github/workflows/cleanClosedPR.yml +++ b/.github/workflows/cleanClosedPR.yml @@ -51,24 +51,24 @@ jobs: working-directory: "app/.pipeline/" run: | npm ci - DEBUG=* npm run clean -- --pr=$PR_NUMBER --phase=build - DEBUG=* npm run clean -- --pr=$PR_NUMBER --phase=dev + DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=pr --phase=build + DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=pr --phase=build # Clean the database build/deployment artifacts - name: Clean Database Artifacts working-directory: "database/.pipeline/" run: | npm ci - DEBUG=* npm run clean -- --pr=$PR_NUMBER --phase=build - DEBUG=* npm run clean -- --pr=$PR_NUMBER --phase=dev + DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=pr --phase=build + DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=pr --phase=build # Clean the api deployment artifacts - name: Clean API Deployment working-directory: "api/.pipeline/" run: | npm ci - DEBUG=* npm run clean -- --pr=$PR_NUMBER --phase=build - DEBUG=* npm run clean -- --pr=$PR_NUMBER --phase=dev + DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=pr --phase=build + DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=pr --phase=build # Clean the reamaining build/deployment artifacts - name: Clean remaining Artifacts diff --git a/.github/workflows/cleanMergedPR.yml b/.github/workflows/cleanMergedPR.yml index 19a8a85462..680c34c0b3 100644 --- a/.github/workflows/cleanMergedPR.yml +++ b/.github/workflows/cleanMergedPR.yml @@ -55,24 +55,24 @@ jobs: working-directory: "app/.pipeline/" run: | npm ci - DEBUG=* npm run clean -- --pr=$PR_NUMBER --phase=build - DEBUG=* npm run clean -- --pr=$PR_NUMBER --phase=dev + DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=build + DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=dev # Clean the database build/deployment artifacts - name: Clean Database Artifacts working-directory: "database/.pipeline/" run: | npm ci - DEBUG=* npm run clean -- --pr=$PR_NUMBER --phase=build - DEBUG=* npm run clean -- --pr=$PR_NUMBER --phase=dev + 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=$PR_NUMBER --phase=build - DEBUG=* npm run clean -- --pr=$PR_NUMBER --phase=dev + 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 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 48d4f73a81..d8007a3efd 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -216,7 +216,7 @@ jobs: - name: Build APP Image working-directory: app/.pipeline/ run: | - DEBUG=* npm run build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --phase=build + DEBUG=* npm run build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=pr --phase=build # Build the Database image buildDatabase: @@ -280,7 +280,7 @@ jobs: - name: Build Database Image working-directory: database/.pipeline/ run: | - DEBUG=* npm run db:build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --phase=build + DEBUG=* npm run db:build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=pr --phase=build # Build the Database Setup image buildDatabaseSetup: @@ -337,7 +337,7 @@ jobs: - name: Build Database Setup Image working-directory: database/.pipeline/ run: | - DEBUG=* npm run db-setup:build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --phase=build + DEBUG=* npm run db-setup:build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=pr --phase=build # Build the API image buildAPI: @@ -401,7 +401,7 @@ jobs: - name: Build API Image working-directory: api/.pipeline/ run: | - DEBUG=* npm run build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --phase=build + DEBUG=* npm run build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=pr --phase=build # Deploy APP image deployAPP: @@ -458,7 +458,7 @@ jobs: - name: Deploy APP Image working-directory: app/.pipeline run: | - DEBUG=* npm run deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --phase=pr + DEBUG=* npm run deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=pr --phase=deploy # Deploy Database image deployDatabase: @@ -515,7 +515,7 @@ jobs: - name: Deploy Database Image working-directory: database/.pipeline/ run: | - DEBUG=* npm run db:deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --phase=pr + DEBUG=* npm run db:deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=pr --phase=deploy # Deploy Database image deployDatabaseSetup: @@ -573,7 +573,7 @@ jobs: - name: Deploy Database Setup Image working-directory: database/.pipeline/ run: | - DEBUG=* npm run db-setup:deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --phase=pr + DEBUG=* npm run db-setup:deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=pr --phase=deploy # Deploy API image deployAPI: @@ -633,7 +633,7 @@ jobs: - name: Deploy API Image working-directory: api/.pipeline/ run: | - DEBUG=* npm run deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --phase=pr + 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 diff --git a/.github/workflows/deployStatic.yml b/.github/workflows/deployStatic.yml index 98097a9ef1..5f617cabda 100644 --- a/.github/workflows/deployStatic.yml +++ b/.github/workflows/deployStatic.yml @@ -367,7 +367,7 @@ jobs: - name: Deploy APP Image working-directory: "app/.pipeline" run: | - DEBUG=* npm run deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --phase=$BRANCH --branch=$BRANCH --type=static + DEBUG=* npm run deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=$BRANCH --phase=deploy --branch=$BRANCH --type=static # Deploy Database image deployDatabase: @@ -420,7 +420,7 @@ jobs: - name: Deploy Database Image working-directory: "database/.pipeline/" run: | - DEBUG=* npm run db:deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --phase=$BRANCH --branch=$BRANCH --type=static + DEBUG=* npm run db:deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=$BRANCH --phase=deploy --branch=$BRANCH --type=static # Deploy Database setup image deployDatabaseSetup: @@ -474,7 +474,7 @@ jobs: - name: Deploy Database Setup Image working-directory: "database/.pipeline/" run: | - DEBUG=* npm run db-setup:deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --phase=$BRANCH --branch=$BRANCH --type=static + DEBUG=* npm run db-setup:deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=$BRANCH --phase=deploy --branch=$BRANCH --type=static # Deploy API image deployAPI: @@ -528,7 +528,7 @@ jobs: - name: Deploy API Image working-directory: "api/.pipeline/" run: | - DEBUG=* npm run deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --phase=$BRANCH --branch=$BRANCH --type=static + DEBUG=* npm run deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=$BRANCH --phase=deploy --branch=$BRANCH --type=static # Clean build/deployment artifacts clean: @@ -577,24 +577,24 @@ jobs: working-directory: "app/.pipeline/" run: | npm ci - DEBUG=* npm run clean -- --pr=$PR_NUMBER --phase=build - DEBUG=* npm run clean -- --pr=$PR_NUMBER --phase=dev + DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=pr --phase=build + DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=pr --phase=deploy # Clean the database build/deployment artifacts - name: Clean Database Artifacts working-directory: "database/.pipeline/" run: | npm ci - DEBUG=* npm run clean -- --pr=$PR_NUMBER --phase=build - DEBUG=* npm run clean -- --pr=$PR_NUMBER --phase=dev + DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=pr --phase=build + DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=pr --phase=deploy # Clean the api deployment artifacts - name: Clean API Deployment working-directory: "api/.pipeline/" run: | npm ci - DEBUG=* npm run clean -- --pr=$PR_NUMBER --phase=build - DEBUG=* npm run clean -- --pr=$PR_NUMBER --phase=dev + DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=pr --phase=build + DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=pr --phase=deploy # Clean the reamaining build/deployment artifacts - name: Clean remaining Artifacts diff --git a/.pipeline/templates/sims-configmap.json b/.pipeline/templates/sims-configmap.json deleted file mode 100644 index 87ec012c1a..0000000000 --- a/.pipeline/templates/sims-configmap.json +++ /dev/null @@ -1,306 +0,0 @@ -{ - "name": "sims", - "namespaceSuffix": "af2668", - "namespace": { - "tools": "tools", - "dev": "dev", - "test": "test", - "prod": "prod" - }, - "version": "1.0.0", - "module": { - "db": "sims-db", - "api": "sims-api", - "app": "sims-app" - }, - "api": { - "build": { - "tz": "America/Vancouver", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "3Gi" - }, - "deploy": { - "pr": { - "nodeEnv": "development", - "staticApiUrl": "api-dev-sims.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "dev-sims.apps.silver.devops.gov.bc.ca", - "tz": "America/Vancouver", - "backboneApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", - "backboneIntakePath": "/api/dwc/submission/queue", - "backboneArtifactIntakePath": "/api/artifact/intake", - "backboneIntakeEnabled": false, - "bctwApiHost": "https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca", - "critterbaseApiHost": "https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api", - "elasticsearchURL": "http://es01.a0ec71-dev:9200", - "elasticsearchTaxonomyIndex": "taxonomy_3.0.0", - "s3KeyPrefix": "sims", - "logLevel": "debug", - "cpuRequest": "50m", - "cpuLimit": "400m", - "memoryRequest": "100Mi", - "memoryLimit": "2Gi", - "replicas": "1", - "replicasMax": "2" - }, - "dev": { - "nodeEnv": "development", - "staticApiUrl": "api-dev-sims.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "dev-sims.apps.silver.devops.gov.bc.ca", - "tz": "America/Vancouver", - "backboneApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", - "backboneIntakePath": "/api/dwc/submission/queue", - "backboneArtifactIntakePath": "/api/artifact/intake", - "backboneIntakeEnabled": false, - "bctwApiHost": "https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca", - "critterbaseApiHost": "https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api", - "elasticsearchURL": "http://es01.a0ec71-dev:9200", - "elasticsearchTaxonomyIndex": "taxonomy_3.0.0", - "s3KeyPrefix": "sims", - "logLevel": "debug", - "cpuRequest": "50m", - "cpuLimit": "400m", - "memoryRequest": "100Mi", - "memoryLimit": "2Gi", - "replicas": "1", - "replicasMax": "2" - }, - "test": { - "nodeEnv": "production", - "staticApiUrl": "api-test-sims.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "test-sims.apps.silver.devops.gov.bc.ca", - "tz": "America/Vancouver", - "backboneApiHost": "https://api-test-biohub-platform.apps.silver.devops.gov.bc.ca", - "backboneIntakePath": "/api/dwc/submission/queue", - "backboneArtifactIntakePath": "/api/artifact/intake", - "backboneIntakeEnabled": false, - "bctwApiHost": "https://moe-bctw-api-test.apps.silver.devops.gov.bc.ca", - "critterbaseApiHost": "https://moe-critterbase-api-test.apps.silver.devops.gov.bc.ca/api", - "elasticsearchURL": "http://es01.a0ec71-dev:9200", - "elasticsearchTaxonomyIndex": "taxonomy_3.0.0", - "s3KeyPrefix": "sims", - "logLevel": "info", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "3Gi", - "replicas": "2", - "replicasMax": "4" - }, - "prod": { - "nodeEnv": "production", - "staticApiUrl": "api-sims.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "sims.apps.silver.devops.gov.bc.ca", - "staticAppVanityUrl": "sims.nrs.gov.bc.ca", - "tz": "America/Vancouver", - "backboneApiHost": "https://api-biohub-platform.apps.silver.devops.gov.bc.ca", - "backboneIntakePath": "/api/dwc/submission/queue", - "backboneArtifactIntakePath": "/api/artifact/intake", - "backboneIntakeEnabled": false, - "bctwApiHost": "https://moe-bctw-api-prod.apps.silver.devops.gov.bc.ca", - "critterbaseApiHost": "https://moe-critterbase-api-prod.apps.silver.devops.gov.bc.ca/api", - "elasticsearchURL": "http://es01.a0ec71-prod:9200", - "elasticsearchTaxonomyIndex": "taxonomy_3.0.0", - "s3KeyPrefix": "sims", - "logLevel": "warn", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "3Gi", - "replicas": "2", - "replicasMax": "4" - } - } - }, - "app": { - "build": { - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "5Gi" - }, - "deploy": { - "pr": { - "nodeEnv": "development", - "siteminderLogoutURL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", - "maxUploadNumFiles": 10, - "maxUploadFileSize": 52428800, - "biohubFeatureFlag": "true", - "cpuRequest": "50m", - "cpuLimit": "200m", - "memoryRequest": "100Mi", - "memoryLimit": "333Mi", - "replicas": "1", - "replicasMax": "1" - }, - "dev": { - "nodeEnv": "development", - "staticApiUrl": "api-dev-sims.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "dev-sims.apps.silver.devops.gov.bc.ca", - "siteminderLogoutURL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", - "maxUploadNumFiles": 10, - "maxUploadFileSize": 52428800, - "biohubFeatureFlag": "true", - "cpuRequest": "50m", - "cpuLimit": "200m", - "memoryRequest": "100Mi", - "memoryLimit": "333Mi", - "replicas": "1", - "replicasMax": "1" - }, - "test": { - "nodeEnv": "production", - "staticApiUrl": "api-test-sims.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "test-sims.apps.silver.devops.gov.bc.ca", - "siteminderLogoutURL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", - "maxUploadNumFiles": 10, - "maxUploadFileSize": 52428800, - "biohubFeatureFlag": "false", - "cpuRequest": "50m", - "cpuLimit": "500m", - "memoryRequest": "100Mi", - "memoryLimit": "500Mi", - "replicas": "2", - "replicasMax": "3" - }, - "prod": { - "nodeEnv": "production", - "staticApiUrl": "api-sims.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "sims.apps.silver.devops.gov.bc.ca", - "staticAppVanityUrl": "sims.nrs.gov.bc.ca", - "siteminderLogoutURL": "https://logon7.gov.bc.ca/clp-cgi/logoff.cgi", - "maxUploadNumFiles": 10, - "maxUploadFileSize": 52428800, - "biohubFeatureFlag": "false", - "cpuRequest": "50m", - "cpuLimit": "500m", - "memoryRequest": "100Mi", - "memoryLimit": "500Mi", - "replicas": "2", - "replicasMax": "3" - } - } - }, - "database": { - "build": { - "tz": "America/Vancouver" - }, - "deploy": { - "pr": { - "nodeEnv": "development", - "tz": "America/Vancouver", - "dbSetupDockerfilePath": "./.docker/db/Dockerfile.setup", - "volumeCapacity": "500Mi", - "cpuRequest": "50m", - "cpuLimit": "400m", - "memoryRequest": "100Mi", - "memoryLimit": "2Gi", - "replicas": "1" - }, - "dev": { - "nodeEnv": "development", - "tz": "America/Vancouver", - "dbSetupDockerfilePath": "./.docker/db/Dockerfile.setup", - "volumeCapacity": "3Gi", - "cpuRequest": "50m", - "cpuLimit": "400m", - "memoryRequest": "100Mi", - "memoryLimit": "2Gi", - "replicas": "1" - }, - "test": { - "nodeEnv": "production", - "tz": "America/Vancouver", - "dbSetupDockerfilePath": "./.docker/db/Dockerfile.migrate", - "volumeCapacity": "3Gi", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "3Gi", - "replicas": "1" - }, - "prod": { - "nodeEnv": "production", - "tz": "America/Vancouver", - "dbSetupDockerfilePath": "./.docker/db/Dockerfile.migrate", - "volumeCapacity": "5Gi", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "3Gi", - "replicas": "1" - } - } - }, - "sso": { - "pr": { - "host": "https://dev.loginproxy.gov.bc.ca/auth", - "realm": "standard", - "clientId": "sims-4461", - "keycloakSecret": "keycloak", - "serviceClient": { - "serviceClientName": "sims-svc-4464", - "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" - }, - "cssApi": { - "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", - "cssApiClientId": "service-account-team-1190-4229", - "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", - "keycloakSecretCssApiSecretKey": "css_api_client_secret", - "cssApiEnvironment": "dev" - } - }, - "dev": { - "host": "https://dev.loginproxy.gov.bc.ca/auth", - "realm": "standard", - "clientId": "sims-4461", - "keycloakSecret": "keycloak", - "serviceClient": { - "serviceClientName": "sims-svc-4464", - "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" - }, - "cssApi": { - "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", - "cssApiClientId": "service-account-team-1190-4229", - "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", - "keycloakSecretCssApiSecretKey": "css_api_client_secret", - "cssApiEnvironment": "dev" - } - }, - "test": { - "host": "https://test.loginproxy.gov.bc.ca/auth", - "realm": "standard", - "clientId": "sims-4461", - "keycloakSecret": "keycloak", - "serviceClient": { - "serviceClientName": "sims-svc-4464", - "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" - }, - "cssApi": { - "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", - "cssApiClientId": "service-account-team-1190-4229", - "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", - "keycloakSecretCssApiSecretKey": "css_api_client_secret", - "cssApiEnvironment": "test" - } - }, - "prod": { - "host": "https://loginproxy.gov.bc.ca/auth", - "realm": "standard", - "clientId": "sims-4461", - "keycloakSecret": "keycloak", - "serviceClient": { - "serviceClientName": "sims-svc-4464", - "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" - }, - "cssApi": { - "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", - "cssApiClientId": "service-account-team-1190-4229", - "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", - "keycloakSecretCssApiSecretKey": "css_api_client_secret", - "cssApiEnvironment": "prod" - } - } - } -} diff --git a/.pipeline/templates/sims.configmap.yaml b/.pipeline/templates/sims.configmap.yaml deleted file mode 100644 index 41c35980f2..0000000000 --- a/.pipeline/templates/sims.configmap.yaml +++ /dev/null @@ -1,314 +0,0 @@ -kind: ConfigMap -apiVersion: v1 -metadata: - name: sims-pipeline-config - namespace: af2668-dev -immutable: false -data: - config: | - { - "name": "sims", - "namespaceSuffix": "af2668", - "namespace": { - "tools": "tools", - "dev": "dev", - "test": "test", - "prod": "prod" - }, - "version": "1.0.0", - "module": { - "db": "sims-db", - "api": "sims-api", - "app": "sims-app" - }, - "api": { - "build": { - "tz": "America/Vancouver", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "3Gi" - }, - "deploy": { - "pr": { - "nodeEnv": "development", - "staticApiUrl": "api-dev-sims.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "dev-sims.apps.silver.devops.gov.bc.ca", - "tz": "America/Vancouver", - "backboneApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", - "backboneIntakePath": "/api/dwc/submission/queue", - "backboneArtifactIntakePath": "/api/artifact/intake", - "backboneIntakeEnabled": false, - "bctwApiHost": "https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca", - "critterbaseApiHost": "https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api", - "elasticsearchURL": "http://es01.a0ec71-dev:9200", - "elasticsearchTaxonomyIndex": "taxonomy_3.0.0", - "s3KeyPrefix": "sims", - "logLevel": "debug", - "cpuRequest": "50m", - "cpuLimit": "400m", - "memoryRequest": "100Mi", - "memoryLimit": "2Gi", - "replicas": "1", - "replicasMax": "2" - }, - "dev": { - "nodeEnv": "development", - "staticApiUrl": "api-dev-sims.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "dev-sims.apps.silver.devops.gov.bc.ca", - "tz": "America/Vancouver", - "backboneApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", - "backboneIntakePath": "/api/dwc/submission/queue", - "backboneArtifactIntakePath": "/api/artifact/intake", - "backboneIntakeEnabled": false, - "bctwApiHost": "https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca", - "critterbaseApiHost": "https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api", - "elasticsearchURL": "http://es01.a0ec71-dev:9200", - "elasticsearchTaxonomyIndex": "taxonomy_3.0.0", - "s3KeyPrefix": "sims", - "logLevel": "debug", - "cpuRequest": "50m", - "cpuLimit": "400m", - "memoryRequest": "100Mi", - "memoryLimit": "2Gi", - "replicas": "1", - "replicasMax": "2" - }, - "test": { - "nodeEnv": "production", - "staticApiUrl": "api-test-sims.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "test-sims.apps.silver.devops.gov.bc.ca", - "tz": "America/Vancouver", - "backboneApiHost": "https://api-test-biohub-platform.apps.silver.devops.gov.bc.ca", - "backboneIntakePath": "/api/dwc/submission/queue", - "backboneArtifactIntakePath": "/api/artifact/intake", - "backboneIntakeEnabled": false, - "bctwApiHost": "https://moe-bctw-api-test.apps.silver.devops.gov.bc.ca", - "critterbaseApiHost": "https://moe-critterbase-api-test.apps.silver.devops.gov.bc.ca/api", - "elasticsearchURL": "http://es01.a0ec71-dev:9200", - "elasticsearchTaxonomyIndex": "taxonomy_3.0.0", - "s3KeyPrefix": "sims", - "logLevel": "info", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "3Gi", - "replicas": "2", - "replicasMax": "4" - }, - "prod": { - "nodeEnv": "production", - "staticApiUrl": "api-sims.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "sims.apps.silver.devops.gov.bc.ca", - "staticAppVanityUrl": "sims.nrs.gov.bc.ca", - "tz": "America/Vancouver", - "backboneApiHost": "https://api-biohub-platform.apps.silver.devops.gov.bc.ca", - "backboneIntakePath": "/api/dwc/submission/queue", - "backboneArtifactIntakePath": "/api/artifact/intake", - "backboneIntakeEnabled": false, - "bctwApiHost": "https://moe-bctw-api-prod.apps.silver.devops.gov.bc.ca", - "critterbaseApiHost": "https://moe-critterbase-api-prod.apps.silver.devops.gov.bc.ca/api", - "elasticsearchURL": "http://es01.a0ec71-prod:9200", - "elasticsearchTaxonomyIndex": "taxonomy_3.0.0", - "s3KeyPrefix": "sims", - "logLevel": "warn", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "3Gi", - "replicas": "2", - "replicasMax": "4" - } - } - }, - "app": { - "build": { - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "5Gi" - }, - "deploy": { - "pr": { - "nodeEnv": "development", - "siteminderLogoutURL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", - "maxUploadNumFiles": 10, - "maxUploadFileSize": 52428800, - "biohubFeatureFlag": "true", - "cpuRequest": "50m", - "cpuLimit": "200m", - "memoryRequest": "100Mi", - "memoryLimit": "333Mi", - "replicas": "1", - "replicasMax": "1" - }, - "dev": { - "nodeEnv": "development", - "staticApiUrl": "api-dev-sims.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "dev-sims.apps.silver.devops.gov.bc.ca", - "siteminderLogoutURL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", - "maxUploadNumFiles": 10, - "maxUploadFileSize": 52428800, - "biohubFeatureFlag": "true", - "cpuRequest": "50m", - "cpuLimit": "200m", - "memoryRequest": "100Mi", - "memoryLimit": "333Mi", - "replicas": "1", - "replicasMax": "1" - }, - "test": { - "nodeEnv": "production", - "staticApiUrl": "api-test-sims.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "test-sims.apps.silver.devops.gov.bc.ca", - "siteminderLogoutURL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", - "maxUploadNumFiles": 10, - "maxUploadFileSize": 52428800, - "biohubFeatureFlag": "false", - "cpuRequest": "50m", - "cpuLimit": "500m", - "memoryRequest": "100Mi", - "memoryLimit": "500Mi", - "replicas": "2", - "replicasMax": "3" - }, - "prod": { - "nodeEnv": "production", - "staticApiUrl": "api-sims.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "sims.apps.silver.devops.gov.bc.ca", - "staticAppVanityUrl": "sims.nrs.gov.bc.ca", - "siteminderLogoutURL": "https://logon7.gov.bc.ca/clp-cgi/logoff.cgi", - "maxUploadNumFiles": 10, - "maxUploadFileSize": 52428800, - "biohubFeatureFlag": "false", - "cpuRequest": "50m", - "cpuLimit": "500m", - "memoryRequest": "100Mi", - "memoryLimit": "500Mi", - "replicas": "2", - "replicasMax": "3" - } - } - }, - "database": { - "build": { - "tz": "America/Vancouver" - }, - "deploy": { - "pr": { - "nodeEnv": "development", - "tz": "America/Vancouver", - "dbSetupDockerfilePath": "./.docker/db/Dockerfile.setup", - "volumeCapacity": "500Mi", - "cpuRequest": "50m", - "cpuLimit": "400m", - "memoryRequest": "100Mi", - "memoryLimit": "2Gi", - "replicas": "1" - }, - "dev": { - "nodeEnv": "development", - "tz": "America/Vancouver", - "dbSetupDockerfilePath": "./.docker/db/Dockerfile.setup", - "volumeCapacity": "3Gi", - "cpuRequest": "50m", - "cpuLimit": "400m", - "memoryRequest": "100Mi", - "memoryLimit": "2Gi", - "replicas": "1" - }, - "test": { - "nodeEnv": "production", - "tz": "America/Vancouver", - "dbSetupDockerfilePath": "./.docker/db/Dockerfile.migrate", - "volumeCapacity": "3Gi", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "3Gi", - "replicas": "1" - }, - "prod": { - "nodeEnv": "production", - "tz": "America/Vancouver", - "dbSetupDockerfilePath": "./.docker/db/Dockerfile.migrate", - "volumeCapacity": "5Gi", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "3Gi", - "replicas": "1" - } - } - }, - "sso": { - "pr": { - "host": "https://dev.loginproxy.gov.bc.ca/auth", - "realm": "standard", - "clientId": "sims-4461", - "keycloakSecret": "keycloak", - "serviceClient": { - "serviceClientName": "sims-svc-4464", - "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" - }, - "cssApi": { - "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", - "cssApiClientId": "service-account-team-1190-4229", - "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", - "keycloakSecretCssApiSecretKey": "css_api_client_secret", - "cssApiEnvironment": "dev" - } - }, - "dev": { - "host": "https://dev.loginproxy.gov.bc.ca/auth", - "realm": "standard", - "clientId": "sims-4461", - "keycloakSecret": "keycloak", - "serviceClient": { - "serviceClientName": "sims-svc-4464", - "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" - }, - "cssApi": { - "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", - "cssApiClientId": "service-account-team-1190-4229", - "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", - "keycloakSecretCssApiSecretKey": "css_api_client_secret", - "cssApiEnvironment": "dev" - } - }, - "test": { - "host": "https://test.loginproxy.gov.bc.ca/auth", - "realm": "standard", - "clientId": "sims-4461", - "keycloakSecret": "keycloak", - "serviceClient": { - "serviceClientName": "sims-svc-4464", - "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" - }, - "cssApi": { - "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", - "cssApiClientId": "service-account-team-1190-4229", - "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", - "keycloakSecretCssApiSecretKey": "css_api_client_secret", - "cssApiEnvironment": "test" - } - }, - "prod": { - "host": "https://loginproxy.gov.bc.ca/auth", - "realm": "standard", - "clientId": "sims-4461", - "keycloakSecret": "keycloak", - "serviceClient": { - "serviceClientName": "sims-svc-4464", - "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" - }, - "cssApi": { - "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", - "cssApiClientId": "service-account-team-1190-4229", - "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", - "keycloakSecretCssApiSecretKey": "css_api_client_secret", - "cssApiEnvironment": "prod" - } - } - } - } diff --git a/api/.pipeline/config.js b/api/.pipeline/config.js index 770c27af89..d28be74e9a 100644 --- a/api/.pipeline/config.js +++ b/api/.pipeline/config.js @@ -75,79 +75,123 @@ function processOptions(options) { const options = processOptions(rawOptions); const phases = { - build: { - ...pipelineConfigMap.api.build, - namespace: 'af2668-tools', - name: pipelineConfigMap.module.api, - dbName: pipelineConfigMap.module.db, - phase: 'build', - changeId: changeId, - suffix: `-build-${changeId}`, - instance: `${pipelineConfigMap.module.api}-build-${changeId}`, - version: `${pipelineConfigMap.version}-${changeId}`, - tag: tag, - branch: branch - }, pr: { - ...pipelineConfigMap.api.deploy.pr, - phase: 'pr', - namespace: 'af2668-dev', - name: pipelineConfigMap.module.api, - dbName: pipelineConfigMap.module.db, - changeId: changeId, - suffix: `-dev-${changeId}`, - instance: `${pipelineConfigMap.module.api}-dev-${changeId}`, - version: `${changeId}-${changeId}`, - tag: `dev-${pipelineConfigMap.version}-${changeId}`, - host: `${pipelineConfigMap.module.api}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, - appHost: `${pipelineConfigMap.module.app}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, - sso: pipelineConfigMap.sso.dev, - s3KeyPrefix: `local/${changeId}/sims` + build: { + ...pipelineConfigMap.api.pr.build, + namespace: 'af2668-tools', + name: pipelineConfigMap.module.api, + dbName: pipelineConfigMap.module.db, + changeId: changeId, + suffix: `-build-${changeId}`, + instance: `${pipelineConfigMap.module.api}-build-${changeId}`, + version: `${pipelineConfigMap.version}-${changeId}`, + tag: tag, + branch: branch + }, + deploy: { + ...pipelineConfigMap.api.pr.deploy, + phase: 'pr', + namespace: 'af2668-dev', + name: pipelineConfigMap.module.api, + dbName: pipelineConfigMap.module.db, + changeId: changeId, + suffix: `-dev-${changeId}`, + instance: `${pipelineConfigMap.module.api}-dev-${changeId}`, + version: `${changeId}-${changeId}`, + tag: `dev-${pipelineConfigMap.version}-${changeId}`, + host: `${pipelineConfigMap.module.api}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, + appHost: `${pipelineConfigMap.module.app}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, + sso: pipelineConfigMap.sso.dev, + s3KeyPrefix: `local/${changeId}/sims` + } }, dev: { - ...pipelineConfigMap.api.deploy.dev, - phase: 'dev', - namespace: 'af2668-dev', - name: pipelineConfigMap.module.api, - dbName: pipelineConfigMap.module.db, - changeId: 'deploy', - suffix: '-dev-deploy', - instance: `${pipelineConfigMap.module.api}-dev-deploy`, - version: `deploy-${changeId}`, - tag: `dev-${pipelineConfigMap.version}-deploy`, - host: pipelineConfigMap.api.deploy.dev.staticApiUrl, - appHost: pipelineConfigMap.api.deploy.dev.staticAppUrl, - sso: pipelineConfigMap.sso.dev + build: { + ...pipelineConfigMap.api.dev.build, + namespace: 'af2668-tools', + name: pipelineConfigMap.module.api, + dbName: pipelineConfigMap.module.db, + changeId: changeId, + suffix: `-build-${changeId}`, + instance: `${pipelineConfigMap.module.api}-build-${changeId}`, + version: `${pipelineConfigMap.version}-${changeId}`, + tag: tag, + branch: branch + }, + deploy: { + ...pipelineConfigMap.api.dev.deploy, + phase: 'dev', + namespace: 'af2668-dev', + name: pipelineConfigMap.module.api, + dbName: pipelineConfigMap.module.db, + changeId: 'deploy', + suffix: '-dev-deploy', + instance: `${pipelineConfigMap.module.api}-dev-deploy`, + version: `deploy-${changeId}`, + tag: `dev-${pipelineConfigMap.version}-deploy`, + host: pipelineConfigMap.api.dev.deploy.staticApiUrl, + appHost: pipelineConfigMap.api.dev.deploy.staticAppUrl, + sso: pipelineConfigMap.sso.dev + } }, test: { - ...pipelineConfigMap.api.deploy.test, - phase: 'test', - namespace: 'af2668-test', - name: pipelineConfigMap.module.api, - dbName: pipelineConfigMap.module.db, - changeId: 'deploy', - suffix: `-test`, - instance: `${pipelineConfigMap.module.api}-test`, - version: `deploy-${changeId}`, - tag: `test-${pipelineConfigMap.version}`, - host: pipelineConfigMap.api.deploy.test.staticApiUrl, - appHost: pipelineConfigMap.api.deploy.test.staticAppUrl, - sso: pipelineConfigMap.sso.test + build: { + ...pipelineConfigMap.api.test.build, + namespace: 'af2668-tools', + name: pipelineConfigMap.module.api, + dbName: pipelineConfigMap.module.db, + changeId: changeId, + suffix: `-build-${changeId}`, + instance: `${pipelineConfigMap.module.api}-build-${changeId}`, + version: `${pipelineConfigMap.version}-${changeId}`, + tag: tag, + branch: branch + }, + deploy: { + ...pipelineConfigMap.api.test.deploy, + phase: 'test', + namespace: 'af2668-test', + name: pipelineConfigMap.module.api, + dbName: pipelineConfigMap.module.db, + changeId: 'deploy', + suffix: `-test`, + instance: `${pipelineConfigMap.module.api}-test`, + version: `deploy-${changeId}`, + tag: `test-${pipelineConfigMap.version}`, + host: pipelineConfigMap.api.test.deploy.staticApiUrl, + appHost: pipelineConfigMap.api.test.deploy.staticAppUrl, + sso: pipelineConfigMap.sso.test + } }, prod: { - ...pipelineConfigMap.api.deploy.prod, - phase: 'prod', - namespace: 'af2668-prod', - name: pipelineConfigMap.module.api, - dbName: pipelineConfigMap.module.db, - changeId: 'deploy', - suffix: `-prod`, - instance: `${pipelineConfigMap.module.api}-prod`, - version: `deploy-${changeId}`, - tag: `prod-${pipelineConfigMap.version}`, - host: pipelineConfigMap.api.deploy.prod.staticApiUrl, - appHost: pipelineConfigMap.api.deploy.prod.staticAppVanityUrl, - sso: pipelineConfigMap.sso.prod + build: { + ...pipelineConfigMap.api.prod.build, + namespace: 'af2668-tools', + name: pipelineConfigMap.module.api, + dbName: pipelineConfigMap.module.db, + + changeId: changeId, + suffix: `-build-${changeId}`, + instance: `${pipelineConfigMap.module.api}-build-${changeId}`, + version: `${pipelineConfigMap.version}-${changeId}`, + tag: tag, + branch: branch + }, + deploy: { + ...pipelineConfigMap.api.prod.deploy, + phase: 'prod', + namespace: 'af2668-prod', + name: pipelineConfigMap.module.api, + dbName: pipelineConfigMap.module.db, + changeId: 'deploy', + suffix: `-prod`, + instance: `${pipelineConfigMap.module.api}-prod`, + version: `deploy-${changeId}`, + tag: `prod-${pipelineConfigMap.version}`, + host: pipelineConfigMap.api.prod.deploy.staticApiUrl, + appHost: pipelineConfigMap.api.prod.deploy.staticAppVanityUrl, + sso: pipelineConfigMap.sso.prod + } } }; diff --git a/api/.pipeline/lib/api.build.js b/api/.pipeline/lib/api.build.js index c6a8e83a88..39aad3dc75 100644 --- a/api/.pipeline/lib/api.build.js +++ b/api/.pipeline/lib/api.build.js @@ -11,27 +11,29 @@ const path = require('path'); const apiBuild = (settings) => { const phases = settings.phases; const options = settings.options; + const env = settings.options.env; const phase = settings.options.phase; console.log('4=============================================='); console.log('api options', options); + console.log('api env', env); console.log('api phase', phase); - console.log('api phases', phases[phase]); + console.log('api phases', phases[env][phase]); console.log('5=============================================='); - const oc = new OpenShiftClientX(Object.assign({ namespace: phases[phase].namespace }, options)); + const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env][phase].namespace }, options)); console.log('6=============================================='); console.log({ - NAME: phases[phase].name, - SUFFIX: phases[phase].suffix, - VERSION: phases[phase].tag, + NAME: phases[env][phase].name, + SUFFIX: phases[env][phase].suffix, + VERSION: phases[env][phase].tag, SOURCE_REPOSITORY_URL: oc.git.http_url, - SOURCE_REPOSITORY_REF: phases[phase].branch || oc.git.ref, - CPU_REQUEST: phases[phase].cpuRequest, - CPU_LIMIT: phases[phase].cpuLimit, - MEMORY_REQUEST: phases[phase].memoryRequest, - MEMORY_LIMIT: phases[phase].memoryLimit + SOURCE_REPOSITORY_REF: phases[env][phase].branch || oc.git.ref, + CPU_REQUEST: phases[env][phase].cpuRequest, + CPU_LIMIT: phases[env][phase].cpuLimit, + MEMORY_REQUEST: phases[env][phase].memoryRequest, + MEMORY_LIMIT: phases[env][phase].memoryLimit }); console.log('7=============================================='); @@ -42,20 +44,26 @@ const apiBuild = (settings) => { objects.push( ...oc.processDeploymentTemplate(`${templatesLocalBaseUrl}/api.bc.yaml`, { param: { - NAME: phases[phase].name, - SUFFIX: phases[phase].suffix, - VERSION: phases[phase].tag, + NAME: phases[env][phase].name, + SUFFIX: phases[env][phase].suffix, + VERSION: phases[env][phase].tag, SOURCE_REPOSITORY_URL: oc.git.http_url, - SOURCE_REPOSITORY_REF: phases[phase].branch || oc.git.ref, - CPU_REQUEST: phases[phase].cpuRequest, - CPU_LIMIT: phases[phase].cpuLimit, - MEMORY_REQUEST: phases[phase].memoryRequest, - MEMORY_LIMIT: phases[phase].memoryLimit + SOURCE_REPOSITORY_REF: phases[env][phase].branch || oc.git.ref, + CPU_REQUEST: phases[env][phase].cpuRequest, + CPU_LIMIT: phases[env][phase].cpuLimit, + MEMORY_REQUEST: phases[env][phase].memoryRequest, + MEMORY_LIMIT: phases[env][phase].memoryLimit } }) ); - oc.applyRecommendedLabels(objects, phases[phase].name, phase, phases[phase].changeId, phases[phase].instance); + oc.applyRecommendedLabels( + objects, + phases[env][phase].name, + env, + phases[env][phase].changeId, + phases[env][phase].instance + ); oc.applyAndBuild(objects); }; diff --git a/api/.pipeline/lib/api.deploy.js b/api/.pipeline/lib/api.deploy.js index a40edd736f..f7854ddb02 100644 --- a/api/.pipeline/lib/api.deploy.js +++ b/api/.pipeline/lib/api.deploy.js @@ -12,76 +12,77 @@ const path = require('path'); const apiDeploy = async (settings) => { const phases = settings.phases; const options = settings.options; + const env = settings.options.env; const phase = settings.options.phase; - const oc = new OpenShiftClientX(Object.assign({ namespace: phases[phase].namespace }, options)); + const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env][phase].namespace }, options)); const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, '../templates')); - const changeId = phases[phase].changeId; + const changeId = phases[env][phase].changeId; let objects = []; objects.push( ...oc.processDeploymentTemplate(`${templatesLocalBaseUrl}/api.dc.yaml`, { param: { - NAME: phases[phase].name, - SUFFIX: phases[phase].suffix, - VERSION: phases[phase].tag, - HOST: phases[phase].host, - APP_HOST: phases[phase].appHost, + NAME: phases[env][phase].name, + SUFFIX: phases[env][phase].suffix, + VERSION: phases[env][phase].tag, + HOST: phases[env][phase].host, + APP_HOST: phases[env][phase].appHost, CHANGE_ID: phases.build.changeId || changeId, // Node - NODE_ENV: phases[phase].nodeEnv, - NODE_OPTIONS: phases[phase].nodeOptions, + NODE_ENV: phases[env][phase].nodeEnv, + NODE_OPTIONS: phases[env][phase].nodeOptions, // BioHub Platform (aka: Backbone) - BACKBONE_API_HOST: phases[phase].backboneApiHost, - BACKBONE_INTAKE_PATH: phases[phase].backboneIntakePath, - BACKBONE_ARTIFACT_INTAKE_PATH: phases[phase].backboneArtifactIntakePath, - BACKBONE_INTAKE_ENABLED: phases[phase].backboneIntakeEnabled, + BACKBONE_API_HOST: phases[env][phase].backboneApiHost, + BACKBONE_INTAKE_PATH: phases[env][phase].backboneIntakePath, + BACKBONE_ARTIFACT_INTAKE_PATH: phases[env][phase].backboneArtifactIntakePath, + BACKBONE_INTAKE_ENABLED: phases[env][phase].backboneIntakeEnabled, // BCTW / Critterbase - BCTW_API_HOST: phases[phase].bctwApiHost, - CB_API_HOST: phases[phase].critterbaseApiHost, + BCTW_API_HOST: phases[env][phase].bctwApiHost, + CB_API_HOST: phases[env][phase].critterbaseApiHost, // Elastic Search - ELASTICSEARCH_URL: phases[phase].elasticsearchURL, - ELASTICSEARCH_TAXONOMY_INDEX: phases[phase].elasticsearchTaxonomyIndex, + ELASTICSEARCH_URL: phases[env][phase].elasticsearchURL, + ELASTICSEARCH_TAXONOMY_INDEX: phases[env][phase].elasticsearchTaxonomyIndex, // S3 - S3_KEY_PREFIX: phases[phase].s3KeyPrefix, + S3_KEY_PREFIX: phases[env][phase].s3KeyPrefix, // Database - TZ: phases[phase].tz, - DB_SERVICE_NAME: `${phases[phase].dbName}-postgresql${phases[phase].suffix}`, + TZ: phases[env][phase].tz, + DB_SERVICE_NAME: `${phases[env][phase].dbName}-postgresql${phases[env][phase].suffix}`, // Keycloak - KEYCLOAK_HOST: phases[phase].sso.host, - KEYCLOAK_REALM: phases[phase].sso.realm, - KEYCLOAK_CLIENT_ID: phases[phase].sso.clientId, + KEYCLOAK_HOST: phases[env][phase].sso.host, + KEYCLOAK_REALM: phases[env][phase].sso.realm, + KEYCLOAK_CLIENT_ID: phases[env][phase].sso.clientId, // Keycloak secret - KEYCLOAK_SECRET: phases[phase].sso.keycloakSecret, + KEYCLOAK_SECRET: phases[env][phase].sso.keycloakSecret, // Keycloak Service Client - KEYCLOAK_ADMIN_USERNAME: phases[phase].sso.serviceClient.serviceClientName, - KEYCLOAK_SECRET_ADMIN_PASSWORD_KEY: phases[phase].sso.serviceClient.keycloakSecretServiceClientPasswordKey, + KEYCLOAK_ADMIN_USERNAME: phases[env][phase].sso.serviceClient.serviceClientName, + KEYCLOAK_SECRET_ADMIN_PASSWORD_KEY: phases[env][phase].sso.serviceClient.keycloakSecretServiceClientPasswordKey, // Keycloak CSS API - KEYCLOAK_API_TOKEN_URL: phases[phase].sso.cssApi.cssApiTokenUrl, - KEYCLOAK_API_CLIENT_ID: phases[phase].sso.cssApi.cssApiClientId, - KEYCLOAK_API_CLIENT_SECRET_KEY: phases[phase].sso.cssApi.keycloakSecretCssApiSecretKey, - KEYCLOAK_API_HOST: phases[phase].sso.cssApi.cssApiHost, - KEYCLOAK_API_ENVIRONMENT: phases[phase].sso.cssApi.cssApiEnvironment, + KEYCLOAK_API_TOKEN_URL: phases[env][phase].sso.cssApi.cssApiTokenUrl, + KEYCLOAK_API_CLIENT_ID: phases[env][phase].sso.cssApi.cssApiClientId, + KEYCLOAK_API_CLIENT_SECRET_KEY: phases[env][phase].sso.cssApi.keycloakSecretCssApiSecretKey, + KEYCLOAK_API_HOST: phases[env][phase].sso.cssApi.cssApiHost, + KEYCLOAK_API_ENVIRONMENT: phases[env][phase].sso.cssApi.cssApiEnvironment, // Log Level - LOG_LEVEL: phases[phase].logLevel || 'info', + LOG_LEVEL: phases[env][phase].logLevel || 'info', // Openshift Resources - CPU_REQUEST: phases[phase].cpuRequest, - CPU_LIMIT: phases[phase].cpuLimit, - MEMORY_REQUEST: phases[phase].memoryRequest, - MEMORY_LIMIT: phases[phase].memoryLimit, - REPLICAS: phases[phase].replicas, - REPLICAS_MAX: phases[phase].replicasMax + CPU_REQUEST: phases[env][phase].cpuRequest, + CPU_LIMIT: phases[env][phase].cpuLimit, + MEMORY_REQUEST: phases[env][phase].memoryRequest, + MEMORY_LIMIT: phases[env][phase].memoryLimit, + REPLICAS: phases[env][phase].replicas, + REPLICAS_MAX: phases[env][phase].replicasMax } }) ); - oc.applyRecommendedLabels(objects, phases[phase].name, phase, `${changeId}`, phases[phase].instance); - oc.importImageStreams(objects, phases[phase].tag, phases.build.namespace, phases.build.tag); + oc.applyRecommendedLabels(objects, phases[env][phase].name, env, `${changeId}`, phases[env][phase].instance); + oc.importImageStreams(objects, phases[env][phase].tag, phases.build.namespace, phases.build.tag); - await oc.applyAndDeploy(objects, phases[phase].instance); + await oc.applyAndDeploy(objects, phases[env][phase].instance); }; module.exports = { apiDeploy }; diff --git a/api/.pipeline/lib/clean.js b/api/.pipeline/lib/clean.js index 5269acf030..44fa671415 100644 --- a/api/.pipeline/lib/clean.js +++ b/api/.pipeline/lib/clean.js @@ -10,6 +10,7 @@ const { OpenShiftClientX } = require('pipeline-cli'); const clean = (settings) => { const phases = settings.phases; const options = settings.options; + const target_env = settings.options.env; const target_phase = settings.options.phase; const oc = new OpenShiftClientX(Object.assign({ namespace: phases.build.namespace }, options)); diff --git a/api/.pipeline/scripts/api.build.js b/api/.pipeline/scripts/api.build.js index 50ba782a41..e69590ad61 100644 --- a/api/.pipeline/scripts/api.build.js +++ b/api/.pipeline/scripts/api.build.js @@ -3,7 +3,5 @@ const { apiBuild } = require('../lib/api.build.js'); const config = require('../config.js'); -const settings = { ...config, phase: 'build' }; - // Builds the api image -apiBuild(settings); +apiBuild(config); diff --git a/api/.pipeline/utils/configMapSchema.js b/api/.pipeline/utils/configMapSchema.js index bc2af68393..9bd7403dc0 100644 --- a/api/.pipeline/utils/configMapSchema.js +++ b/api/.pipeline/utils/configMapSchema.js @@ -16,15 +16,15 @@ const PipelineConfigMapSchema = z.object({ app: z.string() }), api: z.object({ - build: z.object({ - tz: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string() - }), - deploy: z.object({ - pr: z.object({ + pr: z.object({ + build: z.object({ + tz: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() + }), + deploy: z.object({ nodeEnv: z.string(), tz: z.string(), backboneApiHost: z.string(), @@ -43,8 +43,17 @@ const PipelineConfigMapSchema = z.object({ memoryLimit: z.string(), replicas: z.string(), replicasMax: z.string() + }) + }), + dev: z.object({ + build: z.object({ + tz: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() }), - dev: z.object({ + deploy: z.object({ nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), @@ -65,8 +74,17 @@ const PipelineConfigMapSchema = z.object({ memoryLimit: z.string(), replicas: z.string(), replicasMax: z.string() + }) + }), + test: z.object({ + build: z.object({ + tz: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() }), - test: z.object({ + deploy: z.object({ nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), @@ -87,8 +105,17 @@ const PipelineConfigMapSchema = z.object({ memoryLimit: z.string(), replicas: z.string(), replicasMax: z.string() + }) + }), + prod: z.object({ + build: z.object({ + tz: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() }), - prod: z.object({ + deploy: z.object({ nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), @@ -114,14 +141,14 @@ const PipelineConfigMapSchema = z.object({ }) }), app: z.object({ - build: z.object({ - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string() - }), - deploy: z.object({ - pr: z.object({ + pr: z.object({ + build: z.object({ + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() + }), + deploy: z.object({ nodeEnv: z.string(), siteminderLogoutURL: z.string(), maxUploadNumFiles: z.number(), @@ -133,8 +160,16 @@ const PipelineConfigMapSchema = z.object({ memoryLimit: z.string(), replicas: z.string(), replicasMax: z.string() + }) + }), + dev: z.object({ + build: z.object({ + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() }), - dev: z.object({ + deploy: z.object({ nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), @@ -148,8 +183,16 @@ const PipelineConfigMapSchema = z.object({ memoryLimit: z.string(), replicas: z.string(), replicasMax: z.string() + }) + }), + test: z.object({ + build: z.object({ + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() }), - test: z.object({ + deploy: z.object({ nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), @@ -163,8 +206,16 @@ const PipelineConfigMapSchema = z.object({ memoryLimit: z.string(), replicas: z.string(), replicasMax: z.string() + }) + }), + prod: z.object({ + build: z.object({ + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() }), - prod: z.object({ + deploy: z.object({ nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), @@ -183,11 +234,16 @@ const PipelineConfigMapSchema = z.object({ }) }), database: z.object({ - build: z.object({ - tz: z.string() - }), - deploy: z.object({ - pr: z.object({ + pr: z.object({ + build: z.object({ + tz: z.string(), + dbSetupDockerfilePath: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() + }), + deploy: z.object({ nodeEnv: z.string(), tz: z.string(), dbSetupDockerfilePath: z.string(), @@ -197,8 +253,18 @@ const PipelineConfigMapSchema = z.object({ memoryRequest: z.string(), memoryLimit: z.string(), replicas: z.string() + }) + }), + dev: z.object({ + build: z.object({ + tz: z.string(), + dbSetupDockerfilePath: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() }), - dev: z.object({ + deploy: z.object({ nodeEnv: z.string(), tz: z.string(), dbSetupDockerfilePath: z.string(), @@ -208,8 +274,18 @@ const PipelineConfigMapSchema = z.object({ memoryRequest: z.string(), memoryLimit: z.string(), replicas: z.string() + }) + }), + test: z.object({ + build: z.object({ + tz: z.string(), + dbSetupDockerfilePath: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() }), - test: z.object({ + deploy: z.object({ nodeEnv: z.string(), tz: z.string(), dbSetupDockerfilePath: z.string(), @@ -219,8 +295,18 @@ const PipelineConfigMapSchema = z.object({ memoryRequest: z.string(), memoryLimit: z.string(), replicas: z.string() + }) + }), + prod: z.object({ + build: z.object({ + tz: z.string(), + dbSetupDockerfilePath: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() }), - prod: z.object({ + deploy: z.object({ nodeEnv: z.string(), tz: z.string(), dbSetupDockerfilePath: z.string(), diff --git a/app/.pipeline/config.js b/app/.pipeline/config.js index f3f786451b..01ce81932e 100644 --- a/app/.pipeline/config.js +++ b/app/.pipeline/config.js @@ -76,73 +76,113 @@ function processOptions(options) { const options = processOptions(rawOptions); const phases = { - build: { - ...pipelineConfigMap.app.build, - namespace: 'af2668-tools', - name: pipelineConfigMap.module.app, - phase: 'build', - changeId: changeId, - suffix: `-build-${changeId}`, - instance: `${pipelineConfigMap.module.app}-build-${changeId}`, - version: `${pipelineConfigMap.version}-${changeId}`, - tag: tag, - branch: branch - }, pr: { - ...pipelineConfigMap.app.deploy.pr, - namespace: 'af2668-dev', - name: pipelineConfigMap.module.app, - phase: 'dev', - changeId: changeId, - suffix: `-dev-${changeId}`, - instance: `${pipelineConfigMap.module.app}-dev-${changeId}`, - version: `${changeId}-${changeId}`, - tag: `dev-${pipelineConfigMap.version}-${changeId}`, - host: `${pipelineConfigMap.module.app}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, - apiHost: `${pipelineConfigMap.module.api}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, - sso: pipelineConfigMap.sso.dev + build: { + ...pipelineConfigMap.app.pr.build, + namespace: 'af2668-tools', + name: pipelineConfigMap.module.app, + changeId: changeId, + suffix: `-build-${changeId}`, + instance: `${pipelineConfigMap.module.app}-build-${changeId}`, + version: `${pipelineConfigMap.version}-${changeId}`, + tag: tag, + branch: branch + }, + deploy: { + ...pipelineConfigMap.app.pr.deploy, + namespace: 'af2668-dev', + name: pipelineConfigMap.module.app, + phase: 'dev', + changeId: changeId, + suffix: `-dev-${changeId}`, + instance: `${pipelineConfigMap.module.app}-dev-${changeId}`, + version: `${changeId}-${changeId}`, + tag: `dev-${pipelineConfigMap.version}-${changeId}`, + host: `${pipelineConfigMap.module.app}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, + apiHost: `${pipelineConfigMap.module.api}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, + sso: pipelineConfigMap.sso.dev + } }, dev: { - ...pipelineConfigMap.app.deploy.dev, - namespace: 'af2668-dev', - name: pipelineConfigMap.module.app, - phase: 'dev', - changeId: 'deploy', - suffix: '-dev-deploy', - instance: `${pipelineConfigMap.module.app}-dev-deploy`, - version: `deploy-${changeId}`, - tag: `dev-${pipelineConfigMap.version}-deploy`, - host: pipelineConfigMap.app.deploy.dev.staticAppUrl, - apiHost: pipelineConfigMap.app.deploy.dev.staticApiUrl, - sso: pipelineConfigMap.sso.dev + build: { + ...pipelineConfigMap.app.dev.build, + namespace: 'af2668-tools', + name: pipelineConfigMap.module.app, + changeId: changeId, + suffix: `-build-${changeId}`, + instance: `${pipelineConfigMap.module.app}-build-${changeId}`, + version: `${pipelineConfigMap.version}-${changeId}`, + tag: tag, + branch: branch + }, + deploy: { + ...pipelineConfigMap.app.dev.deploy, + namespace: 'af2668-dev', + name: pipelineConfigMap.module.app, + phase: 'dev', + changeId: 'deploy', + suffix: '-dev-deploy', + instance: `${pipelineConfigMap.module.app}-dev-deploy`, + version: `deploy-${changeId}`, + tag: `dev-${pipelineConfigMap.version}-deploy`, + host: pipelineConfigMap.app.dev.deploy.staticAppUrl, + apiHost: pipelineConfigMap.app.dev.deploy.staticApiUrl, + sso: pipelineConfigMap.sso.dev + } }, test: { - ...pipelineConfigMap.app.deploy.test, - namespace: 'af2668-test', - name: pipelineConfigMap.module.app, - phase: 'test', - changeId: 'deploy', - suffix: `-test`, - instance: `${pipelineConfigMap.module.app}-test`, - version: pipelineConfigMap.version, - tag: `test-${pipelineConfigMap.version}`, - host: pipelineConfigMap.app.deploy.test.staticAppUrl, - apiHost: pipelineConfigMap.app.deploy.test.staticApiUrl, - sso: pipelineConfigMap.sso.test + build: { + ...pipelineConfigMap.app.test.build, + namespace: 'af2668-tools', + name: pipelineConfigMap.module.app, + changeId: changeId, + suffix: `-build-${changeId}`, + instance: `${pipelineConfigMap.module.app}-build-${changeId}`, + version: `${pipelineConfigMap.version}-${changeId}`, + tag: tag, + branch: branch + }, + deploy: { + ...pipelineConfigMap.app.test.deploy, + namespace: 'af2668-test', + name: pipelineConfigMap.module.app, + phase: 'test', + changeId: 'deploy', + suffix: `-test`, + instance: `${pipelineConfigMap.module.app}-test`, + version: pipelineConfigMap.version, + tag: `test-${pipelineConfigMap.version}`, + host: pipelineConfigMap.app.test.deploy.staticAppUrl, + apiHost: pipelineConfigMap.app.test.deploy.staticApiUrl, + sso: pipelineConfigMap.sso.test + } }, prod: { - ...pipelineConfigMap.app.deploy.prod, - namespace: 'af2668-prod', - name: pipelineConfigMap.module.app, - phase: 'prod', - changeId: 'deploy', - suffix: `-prod`, - instance: `${pipelineConfigMap.module.app}-prod`, - version: pipelineConfigMap.version, - tag: `prod-${pipelineConfigMap.version}`, - host: pipelineConfigMap.app.deploy.prod.staticAppUrl, - apiHost: pipelineConfigMap.app.deploy.prod.staticApiUrl, - sso: pipelineConfigMap.sso.prod + build: { + ...pipelineConfigMap.app.prod.build, + namespace: 'af2668-tools', + name: pipelineConfigMap.module.app, + changeId: changeId, + suffix: `-build-${changeId}`, + instance: `${pipelineConfigMap.module.app}-build-${changeId}`, + version: `${pipelineConfigMap.version}-${changeId}`, + tag: tag, + branch: branch + }, + deploy: { + ...pipelineConfigMap.app.prod.deploy, + namespace: 'af2668-prod', + name: pipelineConfigMap.module.app, + phase: 'prod', + changeId: 'deploy', + suffix: `-prod`, + instance: `${pipelineConfigMap.module.app}-prod`, + version: pipelineConfigMap.version, + tag: `prod-${pipelineConfigMap.version}`, + host: pipelineConfigMap.app.prod.deploy.staticAppUrl, + apiHost: pipelineConfigMap.app.prod.deploy.staticApiUrl, + sso: pipelineConfigMap.sso.prod + } } }; diff --git a/app/.pipeline/lib/app.build.js b/app/.pipeline/lib/app.build.js index 1b5485dcc8..23c302a908 100644 --- a/app/.pipeline/lib/app.build.js +++ b/app/.pipeline/lib/app.build.js @@ -11,9 +11,10 @@ const path = require('path'); const appBuild = (settings) => { const phases = settings.phases; const options = settings.options; + const env = settings.options.env; const phase = settings.options.phase; - const oc = new OpenShiftClientX(Object.assign({ namespace: phases[phase].namespace }, options)); + const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env][phase].namespace }, options)); const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, '../templates')); @@ -22,20 +23,20 @@ const appBuild = (settings) => { objects.push( ...oc.processDeploymentTemplate(`${templatesLocalBaseUrl}/app.bc.yaml`, { param: { - NAME: phases[phase].name, - SUFFIX: phases[phase].suffix, - VERSION: phases[phase].tag, + NAME: phases[env][phase].name, + SUFFIX: phases[env][phase].suffix, + VERSION: phases[env][phase].tag, SOURCE_REPOSITORY_URL: oc.git.http_url, - SOURCE_REPOSITORY_REF: phases[phase].branch || oc.git.ref, - CPU_REQUEST: phases[phase].cpuRequest, - CPU_LIMIT: phases[phase].cpuLimit, - MEMORY_REQUEST: phases[phase].memoryRequest, - MEMORY_LIMIT: phases[phase].memoryLimit + SOURCE_REPOSITORY_REF: phases[env][phase].branch || oc.git.ref, + CPU_REQUEST: phases[env][phase].cpuRequest, + CPU_LIMIT: phases[env][phase].cpuLimit, + MEMORY_REQUEST: phases[env][phase].memoryRequest, + MEMORY_LIMIT: phases[env][phase].memoryLimit } }) ); - oc.applyRecommendedLabels(objects, phases[phase].name, phase, phases[phase].changeId, phases[phase].instance); + oc.applyRecommendedLabels(objects, phases[env][phase].name, env, phases[env][phase].changeId, phases[env][phase].instance); oc.applyAndBuild(objects); }; diff --git a/app/.pipeline/lib/app.deploy.js b/app/.pipeline/lib/app.deploy.js index ddbb2e6665..c9a9ffd72d 100644 --- a/app/.pipeline/lib/app.deploy.js +++ b/app/.pipeline/lib/app.deploy.js @@ -6,52 +6,53 @@ const path = require('path'); const appDeploy = async (settings) => { const phases = settings.phases; const options = settings.options; + const env = settings.options.env; const phase = settings.options.phase; - const oc = new OpenShiftClientX(Object.assign({ namespace: phases[phase].namespace }, options)); + const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env][phase].namespace }, options)); const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, '../templates')); - const changeId = phases[phase].changeId; + const changeId = phases[env][phase].changeId; const objects = []; objects.push( ...oc.processDeploymentTemplate(`${templatesLocalBaseUrl}/app.dc.yaml`, { param: { - NAME: phases[phase].name, - SUFFIX: phases[phase].suffix, - VERSION: phases[phase].tag, - HOST: phases[phase].host, + NAME: phases[env][phase].name, + SUFFIX: phases[env][phase].suffix, + VERSION: phases[env][phase].tag, + HOST: phases[env][phase].host, CHANGE_ID: phases.build.changeId || changeId, - REACT_APP_API_HOST: phases[phase].apiHost, - REACT_APP_SITEMINDER_LOGOUT_URL: phases[phase].siteminderLogoutURL, + REACT_APP_API_HOST: phases[env][phase].apiHost, + REACT_APP_SITEMINDER_LOGOUT_URL: phases[env][phase].siteminderLogoutURL, // File Upload Settings - REACT_APP_MAX_UPLOAD_NUM_FILES: phases[phase].maxUploadNumFiles, - REACT_APP_MAX_UPLOAD_FILE_SIZE: phases[phase].maxUploadFileSize, + REACT_APP_MAX_UPLOAD_NUM_FILES: phases[env][phase].maxUploadNumFiles, + REACT_APP_MAX_UPLOAD_FILE_SIZE: phases[env][phase].maxUploadFileSize, // Node - NODE_ENV: phases[phase].nodeEnv, - REACT_APP_NODE_ENV: phases[phase].nodeEnv, + NODE_ENV: phases[env][phase].nodeEnv, + REACT_APP_NODE_ENV: phases[env][phase].nodeEnv, // Keycloak - REACT_APP_KEYCLOAK_HOST: phases[phase].sso.host, - REACT_APP_KEYCLOAK_REALM: phases[phase].sso.realm, - REACT_APP_KEYCLOAK_CLIENT_ID: phases[phase].sso.clientId, + REACT_APP_KEYCLOAK_HOST: phases[env][phase].sso.host, + REACT_APP_KEYCLOAK_REALM: phases[env][phase].sso.realm, + REACT_APP_KEYCLOAK_CLIENT_ID: phases[env][phase].sso.clientId, // Openshift Resources - CPU_REQUEST: phases[phase].cpuRequest, - CPU_LIMIT: phases[phase].cpuLimit, - MEMORY_REQUEST: phases[phase].memoryRequest, - MEMORY_LIMIT: phases[phase].memoryLimit, - REPLICAS: phases[phase].replicas, - REPLICAS_MAX: phases[phase].replicasMax, - REACT_APP_BIOHUB_FEATURE_FLAG: phases[phase].biohubFeatureFlag + CPU_REQUEST: phases[env][phase].cpuRequest, + CPU_LIMIT: phases[env][phase].cpuLimit, + MEMORY_REQUEST: phases[env][phase].memoryRequest, + MEMORY_LIMIT: phases[env][phase].memoryLimit, + REPLICAS: phases[env][phase].replicas, + REPLICAS_MAX: phases[env][phase].replicasMax, + REACT_APP_BIOHUB_FEATURE_FLAG: phases[env][phase].biohubFeatureFlag } }) ); - oc.applyRecommendedLabels(objects, phases[phase].name, phase, `${changeId}`, phases[phase].instance); - oc.importImageStreams(objects, phases[phase].tag, phases.build.namespace, phases.build.tag); + oc.applyRecommendedLabels(objects, phases[env][phase].name, env, `${changeId}`, phases[env][phase].instance); + oc.importImageStreams(objects, phases[env][phase].tag, phases.build.namespace, phases.build.tag); - await oc.applyAndDeploy(objects, phases[phase].instance); + await oc.applyAndDeploy(objects, phases[env][phase].instance); }; module.exports = { appDeploy }; diff --git a/app/.pipeline/lib/clean.js b/app/.pipeline/lib/clean.js index 1ebf3629a6..c90607d34b 100644 --- a/app/.pipeline/lib/clean.js +++ b/app/.pipeline/lib/clean.js @@ -10,6 +10,7 @@ const { OpenShiftClientX } = require('pipeline-cli'); const clean = (settings) => { const phases = settings.phases; const options = settings.options; + const target_env = settings.options.env; const target_phase = settings.options.phase; const oc = new OpenShiftClientX(Object.assign({ namespace: phases.build.namespace }, options)); diff --git a/app/.pipeline/scripts/app.build.js b/app/.pipeline/scripts/app.build.js index 341763e97d..95881a34be 100644 --- a/app/.pipeline/scripts/app.build.js +++ b/app/.pipeline/scripts/app.build.js @@ -3,7 +3,5 @@ const { appBuild } = require('../lib/app.build.js'); const config = require('../config.js'); -const settings = { ...config, phase: 'build' }; - // Builds the app image -appBuild(settings); +appBuild(config); diff --git a/app/.pipeline/utils/configMapSchema.js b/app/.pipeline/utils/configMapSchema.js index bc2af68393..9bd7403dc0 100644 --- a/app/.pipeline/utils/configMapSchema.js +++ b/app/.pipeline/utils/configMapSchema.js @@ -16,15 +16,15 @@ const PipelineConfigMapSchema = z.object({ app: z.string() }), api: z.object({ - build: z.object({ - tz: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string() - }), - deploy: z.object({ - pr: z.object({ + pr: z.object({ + build: z.object({ + tz: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() + }), + deploy: z.object({ nodeEnv: z.string(), tz: z.string(), backboneApiHost: z.string(), @@ -43,8 +43,17 @@ const PipelineConfigMapSchema = z.object({ memoryLimit: z.string(), replicas: z.string(), replicasMax: z.string() + }) + }), + dev: z.object({ + build: z.object({ + tz: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() }), - dev: z.object({ + deploy: z.object({ nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), @@ -65,8 +74,17 @@ const PipelineConfigMapSchema = z.object({ memoryLimit: z.string(), replicas: z.string(), replicasMax: z.string() + }) + }), + test: z.object({ + build: z.object({ + tz: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() }), - test: z.object({ + deploy: z.object({ nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), @@ -87,8 +105,17 @@ const PipelineConfigMapSchema = z.object({ memoryLimit: z.string(), replicas: z.string(), replicasMax: z.string() + }) + }), + prod: z.object({ + build: z.object({ + tz: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() }), - prod: z.object({ + deploy: z.object({ nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), @@ -114,14 +141,14 @@ const PipelineConfigMapSchema = z.object({ }) }), app: z.object({ - build: z.object({ - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string() - }), - deploy: z.object({ - pr: z.object({ + pr: z.object({ + build: z.object({ + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() + }), + deploy: z.object({ nodeEnv: z.string(), siteminderLogoutURL: z.string(), maxUploadNumFiles: z.number(), @@ -133,8 +160,16 @@ const PipelineConfigMapSchema = z.object({ memoryLimit: z.string(), replicas: z.string(), replicasMax: z.string() + }) + }), + dev: z.object({ + build: z.object({ + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() }), - dev: z.object({ + deploy: z.object({ nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), @@ -148,8 +183,16 @@ const PipelineConfigMapSchema = z.object({ memoryLimit: z.string(), replicas: z.string(), replicasMax: z.string() + }) + }), + test: z.object({ + build: z.object({ + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() }), - test: z.object({ + deploy: z.object({ nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), @@ -163,8 +206,16 @@ const PipelineConfigMapSchema = z.object({ memoryLimit: z.string(), replicas: z.string(), replicasMax: z.string() + }) + }), + prod: z.object({ + build: z.object({ + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() }), - prod: z.object({ + deploy: z.object({ nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), @@ -183,11 +234,16 @@ const PipelineConfigMapSchema = z.object({ }) }), database: z.object({ - build: z.object({ - tz: z.string() - }), - deploy: z.object({ - pr: z.object({ + pr: z.object({ + build: z.object({ + tz: z.string(), + dbSetupDockerfilePath: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() + }), + deploy: z.object({ nodeEnv: z.string(), tz: z.string(), dbSetupDockerfilePath: z.string(), @@ -197,8 +253,18 @@ const PipelineConfigMapSchema = z.object({ memoryRequest: z.string(), memoryLimit: z.string(), replicas: z.string() + }) + }), + dev: z.object({ + build: z.object({ + tz: z.string(), + dbSetupDockerfilePath: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() }), - dev: z.object({ + deploy: z.object({ nodeEnv: z.string(), tz: z.string(), dbSetupDockerfilePath: z.string(), @@ -208,8 +274,18 @@ const PipelineConfigMapSchema = z.object({ memoryRequest: z.string(), memoryLimit: z.string(), replicas: z.string() + }) + }), + test: z.object({ + build: z.object({ + tz: z.string(), + dbSetupDockerfilePath: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() }), - test: z.object({ + deploy: z.object({ nodeEnv: z.string(), tz: z.string(), dbSetupDockerfilePath: z.string(), @@ -219,8 +295,18 @@ const PipelineConfigMapSchema = z.object({ memoryRequest: z.string(), memoryLimit: z.string(), replicas: z.string() + }) + }), + prod: z.object({ + build: z.object({ + tz: z.string(), + dbSetupDockerfilePath: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() }), - prod: z.object({ + deploy: z.object({ nodeEnv: z.string(), tz: z.string(), dbSetupDockerfilePath: z.string(), diff --git a/database/.pipeline/config.js b/database/.pipeline/config.js index 21f3e1f9b1..e9a16c8ee7 100644 --- a/database/.pipeline/config.js +++ b/database/.pipeline/config.js @@ -79,61 +79,101 @@ function processOptions(options) { const options = processOptions(rawOptions); const phases = { - build: { - ...pipelineConfigMap.database.build, - phase: 'build', - namespace: 'af2668-tools', - name: pipelineConfigMap.module.db, - changeId: changeId, - suffix: `-build-${changeId}`, - instance: `${pipelineConfigMap.module.db}-build-${changeId}`, - version: `${pipelineConfigMap.version}-${changeId}`, - tag: tag, - branch: branch - }, pr: { - ...pipelineConfigMap.database.deploy.pr, - phase: 'dev', - namespace: 'af2668-dev', - name: pipelineConfigMap.module.db, - changeId: deployChangeId, - suffix: `-dev-${deployChangeId}`, - instance: `${pipelineConfigMap.module.db}-dev-${deployChangeId}`, - version: `${deployChangeId}-${changeId}`, - tag: `dev-${pipelineConfigMap.version}-${deployChangeId}` + build: { + ...pipelineConfigMap.database.pr.build, + namespace: 'af2668-tools', + name: pipelineConfigMap.module.db, + changeId: changeId, + suffix: `-build-${changeId}`, + instance: `${pipelineConfigMap.module.db}-build-${changeId}`, + version: `${pipelineConfigMap.version}-${changeId}`, + tag: tag, + branch: branch + }, + deploy: { + ...pipelineConfigMap.database.pr.deploy, + phase: 'dev', + namespace: 'af2668-dev', + name: pipelineConfigMap.module.db, + changeId: deployChangeId, + suffix: `-dev-${deployChangeId}`, + instance: `${pipelineConfigMap.module.db}-dev-${deployChangeId}`, + version: `${deployChangeId}-${changeId}`, + tag: `dev-${pipelineConfigMap.version}-${deployChangeId}` + } }, dev: { - ...pipelineConfigMap.database.deploy.dev, - phase: 'dev', - namespace: 'af2668-dev', - name: pipelineConfigMap.module.db, - changeId: deployChangeId, - suffix: `-dev-${deployChangeId}`, - instance: `${pipelineConfigMap.module.db}-dev-${deployChangeId}`, - version: `${deployChangeId}-${changeId}`, - tag: `dev-${pipelineConfigMap.version}-${deployChangeId}` + build: { + ...pipelineConfigMap.database.dev.build, + namespace: 'af2668-tools', + name: pipelineConfigMap.module.db, + changeId: changeId, + suffix: `-build-${changeId}`, + instance: `${pipelineConfigMap.module.db}-build-${changeId}`, + version: `${pipelineConfigMap.version}-${changeId}`, + tag: tag, + branch: branch + }, + deploy: { + ...pipelineConfigMap.database.dev.deploy, + phase: 'dev', + namespace: 'af2668-dev', + name: pipelineConfigMap.module.db, + changeId: deployChangeId, + suffix: `-dev-${deployChangeId}`, + instance: `${pipelineConfigMap.module.db}-dev-${deployChangeId}`, + version: `${deployChangeId}-${changeId}`, + tag: `dev-${pipelineConfigMap.version}-${deployChangeId}` + } }, test: { - ...pipelineConfigMap.database.deploy.test, - phase: 'test', - namespace: 'af2668-test', - name: pipelineConfigMap.module.db, - changeId: deployChangeId, - suffix: `-test`, - instance: `${pipelineConfigMap.module.db}-test`, - version: pipelineConfigMap.version, - tag: `test-${pipelineConfigMap.version}` + build: { + ...pipelineConfigMap.database.test.build, + namespace: 'af2668-tools', + name: pipelineConfigMap.module.db, + changeId: changeId, + suffix: `-build-${changeId}`, + instance: `${pipelineConfigMap.module.db}-build-${changeId}`, + version: `${pipelineConfigMap.version}-${changeId}`, + tag: tag, + branch: branch + }, + deploy: { + ...pipelineConfigMap.database.test.deploy, + phase: 'test', + namespace: 'af2668-test', + name: pipelineConfigMap.module.db, + changeId: deployChangeId, + suffix: `-test`, + instance: `${pipelineConfigMap.module.db}-test`, + version: pipelineConfigMap.version, + tag: `test-${pipelineConfigMap.version}` + } }, prod: { - ...pipelineConfigMap.database.deploy.prod, - phase: 'prod', - namespace: 'af2668-prod', - name: pipelineConfigMap.module.db, - changeId: deployChangeId, - suffix: `-prod`, - instance: `${pipelineConfigMap.module.db}-prod`, - version: pipelineConfigMap.version, - tag: `prod-${pipelineConfigMap.version}` + build: { + ...pipelineConfigMap.database.prod.build, + namespace: 'af2668-tools', + name: pipelineConfigMap.module.db, + changeId: changeId, + suffix: `-build-${changeId}`, + instance: `${pipelineConfigMap.module.db}-build-${changeId}`, + version: `${pipelineConfigMap.version}-${changeId}`, + tag: tag, + branch: branch + }, + deploy: { + ...pipelineConfigMap.database.prod.deploy, + phase: 'prod', + namespace: 'af2668-prod', + name: pipelineConfigMap.module.db, + changeId: deployChangeId, + suffix: `-prod`, + instance: `${pipelineConfigMap.module.db}-prod`, + version: pipelineConfigMap.version, + tag: `prod-${pipelineConfigMap.version}` + } } }; diff --git a/database/.pipeline/lib/clean.js b/database/.pipeline/lib/clean.js index 2998bad9da..5174685d01 100644 --- a/database/.pipeline/lib/clean.js +++ b/database/.pipeline/lib/clean.js @@ -6,78 +6,79 @@ const { checkAndClean } = require('../utils/utils'); const clean = async (settings) => { const phases = settings.phases; const options = settings.options; - const target_phase = settings.options.phase; + const env = settings.options.env; + const phase = settings.options.phase; const oc = new OpenShiftClientX(Object.assign({ namespace: phases.build.namespace }, options)); - for (let phaseKey in phases) { - if (!Object.prototype.hasOwnProperty.call(phases, phaseKey)) { - continue; - } + if (!Object.prototype.hasOwnProperty.call(phases, env)) { + // is not a field of phases + return; + } - if (phaseKey !== target_phase) { - continue; - } + if (!Object.prototype.hasOwnProperty.call(phases[env], phase)) { + // is not a field of phases[env] + return; + } - const phaseObj = phases[phaseKey]; + const phaseObj = phases[env][phase]; - // Get build configs - let buildConfigs = oc.get('bc', { - selector: `app=${phaseObj.instance},env-id=${phaseObj.changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, - namespace: phaseObj.namespace - }); + // Get build configs + let buildConfigs = oc.get('bc', { + selector: `app=${phaseObj.instance},env-id=${phaseObj.changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, + namespace: phaseObj.namespace + }); - // Clean build configs - buildConfigs.forEach((bc) => { - if (bc.spec.output.to.kind == 'ImageStreamTag') { - oc.delete([`ImageStreamTag/${bc.spec.output.to.name}`], { + // Clean build configs + buildConfigs.forEach((bc) => { + if (bc.spec.output.to.kind == 'ImageStreamTag') { + oc.delete([`ImageStreamTag/${bc.spec.output.to.name}`], { + 'ignore-not-found': 'true', + wait: 'true', + namespace: phaseObj.namespace + }); + } + }); + + // get deployment configs + let deploymentConfigs = oc.get('dc', { + selector: `app=${phaseObj.instance},env-id=${phaseObj.changeId},env-name=${env},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, + namespace: phaseObj.namespace + }); + + // Clean deployment configs + deploymentConfigs.forEach((dc) => { + dc.spec.triggers.forEach((trigger) => { + if (trigger.type == 'ImageChange' && trigger.imageChangeParams.from.kind == 'ImageStreamTag') { + oc.delete([`ImageStreamTag/${trigger.imageChangeParams.from.name}`], { 'ignore-not-found': 'true', wait: 'true', namespace: phaseObj.namespace }); } }); + }); - // get deployment configs - let deploymentConfigs = oc.get('dc', { - selector: `app=${phaseObj.instance},env-id=${phaseObj.changeId},env-name=${phaseKey},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, - namespace: phaseObj.namespace + // Cleaning other pods + if (phase !== 'build') { + const newOC = new OpenShiftClientX(Object.assign({ namespace: phaseObj.namespace }, options)); + const setupPod = `${phaseObj.name}-setup${phaseObj.suffix}`; + await checkAndClean(`pod/${setupPod}`, 10, 5, 0, newOC).catch(() => { + // Ignore errors, nothing to clean }); + } - // Clean deployment configs - deploymentConfigs.forEach((dc) => { - dc.spec.triggers.forEach((trigger) => { - if (trigger.type == 'ImageChange' && trigger.imageChangeParams.from.kind == 'ImageStreamTag') { - oc.delete([`ImageStreamTag/${trigger.imageChangeParams.from.name}`], { - 'ignore-not-found': 'true', - wait: 'true', - namespace: phaseObj.namespace - }); - } - }); - }); - - // Cleaning other pods - if (phaseKey !== 'build') { - const newOC = new OpenShiftClientX(Object.assign({ namespace: phases[phaseKey].namespace }, options)); - const setupPod = `${phases[phaseKey].name}-setup${phases[phaseKey].suffix}`; - await checkAndClean(`pod/${setupPod}`, 10, 5, 0, newOC).catch(() => { - // Ignore errors, nothing to clean - }); - } - - oc.raw('delete', ['all'], { - selector: `app=${phaseObj.instance},env-id=${phaseObj.changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, - wait: 'true', - namespace: phaseObj.namespace - }); + oc.raw('delete', ['all'], { + selector: `app=${phaseObj.instance},env-id=${phaseObj.changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, + wait: 'true', + namespace: phaseObj.namespace + }); - oc.raw('delete', ['all,pvc,secrets,Secrets,secret,configmap,endpoints,Endpoints'], { - selector: `app=${phaseObj.instance},env-id=${phaseObj.changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, - wait: 'true', - namespace: phaseObj.namespace - }); - } + oc.raw('delete', ['all,pvc,secrets,Secrets,secret,configmap,endpoints,Endpoints'], { + selector: `app=${phaseObj.instance},env-id=${phaseObj.changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, + wait: 'true', + namespace: phaseObj.namespace + }); }; module.exports = { clean }; diff --git a/database/.pipeline/lib/db.build.js b/database/.pipeline/lib/db.build.js index 5056adb999..0dc99f86de 100644 --- a/database/.pipeline/lib/db.build.js +++ b/database/.pipeline/lib/db.build.js @@ -11,9 +11,10 @@ const path = require('path'); const dbBuild = (settings) => { const phases = settings.phases; const options = settings.options; + const env = settings.options.env; const phase = settings.options.phase; - const oc = new OpenShiftClientX(Object.assign({ namespace: phases[phase].namespace }, options)); + const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env][phase].namespace }, options)); const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, '../templates')); @@ -22,14 +23,14 @@ const dbBuild = (settings) => { objects.push( ...oc.processDeploymentTemplate(`${templatesLocalBaseUrl}/db.bc.yaml`, { param: { - NAME: phases[phase].name, - SUFFIX: phases[phase].suffix, - TAG_NAME: phases[phase].tag + NAME: phases[env][phase].name, + SUFFIX: phases[env][phase].suffix, + TAG_NAME: phases[env][phase].tag } }) ); - oc.applyRecommendedLabels(objects, phases[phase].name, phase, phases[phase].changeId, phases[phase].instance); + oc.applyRecommendedLabels(objects, phases[env][phase].name, env, phases[env][phase].changeId, phases[env][phase].instance); oc.applyAndBuild(objects); }; diff --git a/database/.pipeline/lib/db.deploy.js b/database/.pipeline/lib/db.deploy.js index 3d8f5a57ce..904fffb094 100644 --- a/database/.pipeline/lib/db.deploy.js +++ b/database/.pipeline/lib/db.deploy.js @@ -12,15 +12,16 @@ const path = require('path'); const dbDeploy = async (settings) => { const phases = settings.phases; const options = settings.options; + const env = settings.options.env; const phase = settings.options.phase; - const oc = new OpenShiftClientX(Object.assign({ namespace: phases[phase].namespace }, options)); + const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env][phase].namespace }, options)); const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, '../templates')); - const name = `${phases[phase].name}`; - const instance = `${phases[phase].instance}`; - const changeId = `${phases[phase].changeId}`; + const name = `${phases[env][phase].name}`; + const instance = `${phases[env][phase].instance}`; + const changeId = `${phases[env][phase].changeId}`; const objects = []; @@ -28,24 +29,24 @@ const dbDeploy = async (settings) => { ...oc.processDeploymentTemplate(`${templatesLocalBaseUrl}/db.dc.yaml`, { param: { NAME: name, - DATABASE_SERVICE_NAME: `${name}-postgresql${phases[phase].suffix}`, + DATABASE_SERVICE_NAME: `${name}-postgresql${phases[env][phase].suffix}`, IMAGE_STREAM_NAME: name, IMAGE_STREAM_VERSION: phases.build.tag, POSTGRESQL_DATABASE: 'biohubbc', - TZ: phases[phase].tz, + TZ: phases[env][phase].tz, IMAGE_STREAM_NAMESPACE: phases.build.namespace, - VOLUME_CAPACITY: phases[phase].volumeCapacity, - CPU_REQUEST: phases[phase].cpuRequest, - CPU_LIMIT: phases[phase].cpuLimit, - MEMORY_REQUEST: phases[phase].memoryRequest, - MEMORY_LIMIT: phases[phase].memoryLimit, - REPLICAS: phases[phase].replicas + VOLUME_CAPACITY: phases[env][phase].volumeCapacity, + CPU_REQUEST: phases[env][phase].cpuRequest, + CPU_LIMIT: phases[env][phase].cpuLimit, + MEMORY_REQUEST: phases[env][phase].memoryRequest, + MEMORY_LIMIT: phases[env][phase].memoryLimit, + REPLICAS: phases[env][phase].replicas } }) ); - oc.applyRecommendedLabels(objects, name, phase, changeId, instance); - oc.importImageStreams(objects, phases[phase].tag, phases.build.namespace, phases.build.tag); + oc.applyRecommendedLabels(objects, name, env, changeId, instance); + oc.importImageStreams(objects, phases[env][phase].tag, phases.build.namespace, phases.build.tag); await oc.applyAndDeploy(objects, instance); }; diff --git a/database/.pipeline/lib/db.setup.build.js b/database/.pipeline/lib/db.setup.build.js index 24f778c898..f0dc76c1e6 100644 --- a/database/.pipeline/lib/db.setup.build.js +++ b/database/.pipeline/lib/db.setup.build.js @@ -11,13 +11,14 @@ const path = require('path'); const dbSetupBuild = (settings) => { const phases = settings.phases; const options = settings.options; + const env = settings.options.env; const phase = settings.options.phase; - const oc = new OpenShiftClientX(Object.assign({ namespace: phases[phase].namespace }, options)); + const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env][phase].namespace }, options)); const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, '../templates')); - const name = `${phases[phase].name}-setup`; + const name = `${phases[env][phase].name}-setup`; const objects = []; @@ -25,21 +26,21 @@ const dbSetupBuild = (settings) => { ...oc.processDeploymentTemplate(`${templatesLocalBaseUrl}/db.setup.bc.yaml`, { param: { NAME: name, - SUFFIX: phases[phase].suffix, - VERSION: phases[phase].tag, - SOURCE_CONTEXT_DIR: 'database', - DB_SETUP_DOCKERFILE_PATH: phases[phase].dbSetupDockerfilePath, + SUFFIX: phases[env][phase].suffix, + VERSION: phases[env][phase].tag, + SOURCE_CONTEXT_DIR: phases[env][phase].sourceContextDir, + DB_SETUP_DOCKERFILE_PATH: phases[env][phase].dbSetupDockerfilePath, SOURCE_REPOSITORY_URL: oc.git.http_url, - SOURCE_REPOSITORY_REF: phases[phase].branch || oc.git.ref, - CPU_REQUEST: '50m', - CPU_LIMIT: '1000m', - MEMORY_REQUEST: '100Mi', - MEMORY_LIMIT: '1.5Gi' + SOURCE_REPOSITORY_REF: phases[env][phase].branch || oc.git.ref, + CPU_REQUEST: phases[env][phase].cpuRequest, + CPU_LIMIT: phases[env][phase].cpuLimit, + MEMORY_REQUEST: phases[env][phase].memoryRequest, + MEMORY_LIMIT: phases[env][phase].memoryLimit } }) ); - oc.applyRecommendedLabels(objects, name, phase, phases[phase].changeId, phases[phase].instance); + oc.applyRecommendedLabels(objects, name, env, phases[env][phase].changeId, phases[env][phase].instance); oc.applyAndBuild(objects); }; diff --git a/database/.pipeline/lib/db.setup.deploy.js b/database/.pipeline/lib/db.setup.deploy.js index 7a1f5775f1..9f1647a80d 100644 --- a/database/.pipeline/lib/db.setup.deploy.js +++ b/database/.pipeline/lib/db.setup.deploy.js @@ -14,18 +14,19 @@ const { const dbSetupDeploy = async (settings) => { const phases = settings.phases; const options = settings.options; + const env = settings.options.env; const phase = settings.options.phase; - const oc = new OpenShiftClientX(Object.assign({ namespace: phases[phase].namespace }, options)); + const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env][phase].deploy.namespace }, options)); const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, '../templates')); - const changeId = phases[phase].changeId; - const isName = `${phases[phase].name}-setup`; + const changeId = phases[env][phase].deploy.changeId; + const isName = `${phases[env][phase].deploy.name}-setup`; const instance = `${isName}-${changeId}`; - const isVersion = `${phases[phase].tag}-setup`; + const isVersion = `${phases[env][phase].deploy.tag}-setup`; const imageStreamName = `${isName}:${isVersion}`; - const dbName = `${phases[phase].name}-postgresql${phases[phase].suffix}`; + const dbName = `${phases[env][phase].deploy.name}-postgresql${phases[env][phase].deploy.suffix}`; const objects = []; const imageStreamObjects = []; @@ -44,7 +45,7 @@ const dbSetupDeploy = async (settings) => { }) ); - oc.applyRecommendedLabels(imageStreamObjects, isName, phase, `${changeId}`, instance); + oc.applyRecommendedLabels(imageStreamObjects, isName, env, `${changeId}`, instance); oc.importImageStreams(imageStreamObjects, isVersion, phases.build.namespace, phases.build.tag); // Get database setup image stream @@ -57,16 +58,16 @@ const dbSetupDeploy = async (settings) => { const dbSetupImageStream = fetchedImageStreams[0]; - const name = `${isName}${phases[phase].suffix}`; + const name = `${isName}${phases[env][phase].deploy.suffix}`; objects.push( ...oc.processDeploymentTemplate(`${templatesLocalBaseUrl}/db.setup.dc.yaml`, { param: { NAME: name, - SUFFIX: phases[phase].suffix, - VERSION: phases[phase].tag, + SUFFIX: phases[env][phase].deploy.suffix, + VERSION: phases[env][phase].deploy.tag, CHANGE_ID: changeId, - NODE_ENV: phases[phase].nodeEnv, + NODE_ENV: phases[env][phase].deploy.nodeEnv, DB_SERVICE_NAME: dbName, DB_SCHEMA: 'biohub', DB_SCHEMA_DAPI_V1: 'biohub_dapi_v1', @@ -94,8 +95,8 @@ const dbSetupDeploy = async (settings) => { ); // Deploy the db setup pod - oc.applyRecommendedLabels(objects, isName, phase, `${changeId}`, instance); - await oc.applyAndDeploy(objects, phases[phase].instance); + oc.applyRecommendedLabels(objects, isName, env, `${changeId}`, instance); + await oc.applyAndDeploy(objects, phases[env][phase].deploy.instance); // Wait to confirm if the db setup pod deployed successfully await waitForResourceToMeetCondition(() => getResourceByName(`pod/${name}`, oc), isResourceComplete, 30, 5, 0); diff --git a/database/.pipeline/scripts/db.build.js b/database/.pipeline/scripts/db.build.js index f7c622f3e0..664f29b96a 100644 --- a/database/.pipeline/scripts/db.build.js +++ b/database/.pipeline/scripts/db.build.js @@ -3,7 +3,5 @@ const { dbBuild } = require('../lib/db.build.js'); const config = require('../config.js'); -const settings = { ...config, phase: 'build' }; - // builds the database image -dbBuild(settings); +dbBuild(config); diff --git a/database/.pipeline/utils/configMapSchema.js b/database/.pipeline/utils/configMapSchema.js index bc2af68393..9bd7403dc0 100644 --- a/database/.pipeline/utils/configMapSchema.js +++ b/database/.pipeline/utils/configMapSchema.js @@ -16,15 +16,15 @@ const PipelineConfigMapSchema = z.object({ app: z.string() }), api: z.object({ - build: z.object({ - tz: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string() - }), - deploy: z.object({ - pr: z.object({ + pr: z.object({ + build: z.object({ + tz: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() + }), + deploy: z.object({ nodeEnv: z.string(), tz: z.string(), backboneApiHost: z.string(), @@ -43,8 +43,17 @@ const PipelineConfigMapSchema = z.object({ memoryLimit: z.string(), replicas: z.string(), replicasMax: z.string() + }) + }), + dev: z.object({ + build: z.object({ + tz: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() }), - dev: z.object({ + deploy: z.object({ nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), @@ -65,8 +74,17 @@ const PipelineConfigMapSchema = z.object({ memoryLimit: z.string(), replicas: z.string(), replicasMax: z.string() + }) + }), + test: z.object({ + build: z.object({ + tz: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() }), - test: z.object({ + deploy: z.object({ nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), @@ -87,8 +105,17 @@ const PipelineConfigMapSchema = z.object({ memoryLimit: z.string(), replicas: z.string(), replicasMax: z.string() + }) + }), + prod: z.object({ + build: z.object({ + tz: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() }), - prod: z.object({ + deploy: z.object({ nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), @@ -114,14 +141,14 @@ const PipelineConfigMapSchema = z.object({ }) }), app: z.object({ - build: z.object({ - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string() - }), - deploy: z.object({ - pr: z.object({ + pr: z.object({ + build: z.object({ + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() + }), + deploy: z.object({ nodeEnv: z.string(), siteminderLogoutURL: z.string(), maxUploadNumFiles: z.number(), @@ -133,8 +160,16 @@ const PipelineConfigMapSchema = z.object({ memoryLimit: z.string(), replicas: z.string(), replicasMax: z.string() + }) + }), + dev: z.object({ + build: z.object({ + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() }), - dev: z.object({ + deploy: z.object({ nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), @@ -148,8 +183,16 @@ const PipelineConfigMapSchema = z.object({ memoryLimit: z.string(), replicas: z.string(), replicasMax: z.string() + }) + }), + test: z.object({ + build: z.object({ + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() }), - test: z.object({ + deploy: z.object({ nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), @@ -163,8 +206,16 @@ const PipelineConfigMapSchema = z.object({ memoryLimit: z.string(), replicas: z.string(), replicasMax: z.string() + }) + }), + prod: z.object({ + build: z.object({ + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() }), - prod: z.object({ + deploy: z.object({ nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), @@ -183,11 +234,16 @@ const PipelineConfigMapSchema = z.object({ }) }), database: z.object({ - build: z.object({ - tz: z.string() - }), - deploy: z.object({ - pr: z.object({ + pr: z.object({ + build: z.object({ + tz: z.string(), + dbSetupDockerfilePath: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() + }), + deploy: z.object({ nodeEnv: z.string(), tz: z.string(), dbSetupDockerfilePath: z.string(), @@ -197,8 +253,18 @@ const PipelineConfigMapSchema = z.object({ memoryRequest: z.string(), memoryLimit: z.string(), replicas: z.string() + }) + }), + dev: z.object({ + build: z.object({ + tz: z.string(), + dbSetupDockerfilePath: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() }), - dev: z.object({ + deploy: z.object({ nodeEnv: z.string(), tz: z.string(), dbSetupDockerfilePath: z.string(), @@ -208,8 +274,18 @@ const PipelineConfigMapSchema = z.object({ memoryRequest: z.string(), memoryLimit: z.string(), replicas: z.string() + }) + }), + test: z.object({ + build: z.object({ + tz: z.string(), + dbSetupDockerfilePath: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() }), - test: z.object({ + deploy: z.object({ nodeEnv: z.string(), tz: z.string(), dbSetupDockerfilePath: z.string(), @@ -219,8 +295,18 @@ const PipelineConfigMapSchema = z.object({ memoryRequest: z.string(), memoryLimit: z.string(), replicas: z.string() + }) + }), + prod: z.object({ + build: z.object({ + tz: z.string(), + dbSetupDockerfilePath: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string() }), - prod: z.object({ + deploy: z.object({ nodeEnv: z.string(), tz: z.string(), dbSetupDockerfilePath: z.string(), diff --git a/database/.pipeline/utils/utils.js b/database/.pipeline/utils/utils.js index 216090830b..c61f707184 100644 --- a/database/.pipeline/utils/utils.js +++ b/database/.pipeline/utils/utils.js @@ -30,13 +30,13 @@ const getResourceByName = (resourceName, oc) => { */ const getResourceByRaw = (selector, type, settings, oc) => { const phases = settings.phases; - const options = settings.options; + const env = settings.options.env; const phase = settings.options.phase; const result = oc.raw('get', [type], { selector: selector, output: 'json', - namespace: phases[phase].namespace + namespace: phases[env][phase].namespace }); if (!result.stdout || !result.stdout.trim()) { From 10740516201551ef63058abb612a33239e43cd5a Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Fri, 26 Jan 2024 18:45:10 -0800 Subject: [PATCH 13/62] Add configmap --- .pipeline/configMaps/sims-configmap.json | 397 ++++++++++++++++++++++ .pipeline/configMaps/sims.configmap.yaml | 405 +++++++++++++++++++++++ 2 files changed, 802 insertions(+) create mode 100644 .pipeline/configMaps/sims-configmap.json create mode 100644 .pipeline/configMaps/sims.configmap.yaml diff --git a/.pipeline/configMaps/sims-configmap.json b/.pipeline/configMaps/sims-configmap.json new file mode 100644 index 0000000000..640dfa9238 --- /dev/null +++ b/.pipeline/configMaps/sims-configmap.json @@ -0,0 +1,397 @@ +{ + "name": "sims", + "namespaceSuffix": "af2668", + "namespace": { + "tools": "tools", + "dev": "dev", + "test": "test", + "prod": "prod" + }, + "version": "1.0.0", + "module": { + "db": "sims-db", + "api": "sims-api", + "app": "sims-app" + }, + "api": { + "pr": { + "build": { + "tz": "America/Vancouver", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "3Gi" + }, + "deploy": { + "nodeEnv": "development", + "staticApiUrl": "api-dev-sims.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "dev-sims.apps.silver.devops.gov.bc.ca", + "tz": "America/Vancouver", + "backboneApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", + "backboneIntakePath": "/api/dwc/submission/queue", + "backboneArtifactIntakePath": "/api/artifact/intake", + "backboneIntakeEnabled": false, + "bctwApiHost": "https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca", + "critterbaseApiHost": "https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api", + "elasticsearchURL": "http://es01.a0ec71-dev:9200", + "elasticsearchTaxonomyIndex": "taxonomy_3.0.0", + "s3KeyPrefix": "sims-pr", + "logLevel": "debug", + "cpuRequest": "50m", + "cpuLimit": "400m", + "memoryRequest": "100Mi", + "memoryLimit": "2Gi", + "replicas": "1", + "replicasMax": "2" + } + }, + "dev": { + "build": { + "tz": "America/Vancouver", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "3Gi" + }, + "deploy": { + "nodeEnv": "development", + "staticApiUrl": "api-dev-sims.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "dev-sims.apps.silver.devops.gov.bc.ca", + "tz": "America/Vancouver", + "backboneApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", + "backboneIntakePath": "/api/dwc/submission/queue", + "backboneArtifactIntakePath": "/api/artifact/intake", + "backboneIntakeEnabled": false, + "bctwApiHost": "https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca", + "critterbaseApiHost": "https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api", + "elasticsearchURL": "http://es01.a0ec71-dev:9200", + "elasticsearchTaxonomyIndex": "taxonomy_3.0.0", + "s3KeyPrefix": "sims", + "logLevel": "debug", + "cpuRequest": "50m", + "cpuLimit": "400m", + "memoryRequest": "100Mi", + "memoryLimit": "2Gi", + "replicas": "1", + "replicasMax": "2" + } + }, + "test": { + "build": { + "tz": "America/Vancouver", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "3Gi" + }, + "deploy": { + "nodeEnv": "production", + "staticApiUrl": "api-test-sims.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "test-sims.apps.silver.devops.gov.bc.ca", + "tz": "America/Vancouver", + "backboneApiHost": "https://api-test-biohub-platform.apps.silver.devops.gov.bc.ca", + "backboneIntakePath": "/api/dwc/submission/queue", + "backboneArtifactIntakePath": "/api/artifact/intake", + "backboneIntakeEnabled": false, + "bctwApiHost": "https://moe-bctw-api-test.apps.silver.devops.gov.bc.ca", + "critterbaseApiHost": "https://moe-critterbase-api-test.apps.silver.devops.gov.bc.ca/api", + "elasticsearchURL": "http://es01.a0ec71-dev:9200", + "elasticsearchTaxonomyIndex": "taxonomy_3.0.0", + "s3KeyPrefix": "sims", + "logLevel": "info", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "3Gi", + "replicas": "2", + "replicasMax": "4" + } + }, + "prod": { + "build": { + "tz": "America/Vancouver", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "3Gi" + }, + "deploy": { + "nodeEnv": "production", + "staticApiUrl": "api-sims.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "sims.apps.silver.devops.gov.bc.ca", + "staticAppVanityUrl": "sims.nrs.gov.bc.ca", + "tz": "America/Vancouver", + "backboneApiHost": "https://api-biohub-platform.apps.silver.devops.gov.bc.ca", + "backboneIntakePath": "/api/dwc/submission/queue", + "backboneArtifactIntakePath": "/api/artifact/intake", + "backboneIntakeEnabled": false, + "bctwApiHost": "https://moe-bctw-api-prod.apps.silver.devops.gov.bc.ca", + "critterbaseApiHost": "https://moe-critterbase-api-prod.apps.silver.devops.gov.bc.ca/api", + "elasticsearchURL": "http://es01.a0ec71-prod:9200", + "elasticsearchTaxonomyIndex": "taxonomy_3.0.0", + "s3KeyPrefix": "sims", + "logLevel": "warn", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "3Gi", + "replicas": "2", + "replicasMax": "4" + } + } + }, + "app": { + "pr": { + "build": { + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "5Gi" + }, + "deploy": { + "nodeEnv": "development", + "siteminderLogoutURL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", + "maxUploadNumFiles": 10, + "maxUploadFileSize": 52428800, + "biohubFeatureFlag": "true", + "cpuRequest": "50m", + "cpuLimit": "200m", + "memoryRequest": "100Mi", + "memoryLimit": "333Mi", + "replicas": "1", + "replicasMax": "1" + } + }, + "dev": { + "build": { + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "5Gi" + }, + "deploy": { + "nodeEnv": "development", + "staticApiUrl": "api-dev-sims.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "dev-sims.apps.silver.devops.gov.bc.ca", + "siteminderLogoutURL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", + "maxUploadNumFiles": 10, + "maxUploadFileSize": 52428800, + "biohubFeatureFlag": "true", + "cpuRequest": "50m", + "cpuLimit": "200m", + "memoryRequest": "100Mi", + "memoryLimit": "333Mi", + "replicas": "1", + "replicasMax": "1" + } + }, + "test": { + "build": { + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "5Gi" + }, + "deploy": { + "nodeEnv": "production", + "staticApiUrl": "api-test-sims.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "test-sims.apps.silver.devops.gov.bc.ca", + "siteminderLogoutURL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", + "maxUploadNumFiles": 10, + "maxUploadFileSize": 52428800, + "biohubFeatureFlag": "false", + "cpuRequest": "50m", + "cpuLimit": "500m", + "memoryRequest": "100Mi", + "memoryLimit": "500Mi", + "replicas": "2", + "replicasMax": "3" + } + }, + "prod": { + "build": { + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "5Gi" + }, + "deploy": { + "nodeEnv": "production", + "staticApiUrl": "api-sims.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "sims.apps.silver.devops.gov.bc.ca", + "staticAppVanityUrl": "sims.nrs.gov.bc.ca", + "siteminderLogoutURL": "https://logon7.gov.bc.ca/clp-cgi/logoff.cgi", + "maxUploadNumFiles": 10, + "maxUploadFileSize": 52428800, + "biohubFeatureFlag": "false", + "cpuRequest": "50m", + "cpuLimit": "500m", + "memoryRequest": "100Mi", + "memoryLimit": "500Mi", + "replicas": "2", + "replicasMax": "3" + } + } + }, + "database": { + "pr": { + "build": { + "tz": "America/Vancouver", + "sourceContextDir": "database", + "dbSetupDockerfilePath": "./.docker/db/Dockerfile.setup", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "1.5Gi" + }, + "deploy": { + "nodeEnv": "development", + "tz": "America/Vancouver", + "dbSetupDockerfilePath": "./.docker/db/Dockerfile.setup", + "volumeCapacity": "500Mi", + "cpuRequest": "50m", + "cpuLimit": "400m", + "memoryRequest": "100Mi", + "memoryLimit": "2Gi", + "replicas": "1" + } + }, + "dev": { + "build": { + "tz": "America/Vancouver", + "sourceContextDir": "database", + "dbSetupDockerfilePath": "./.docker/db/Dockerfile.setup", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "1.5Gi" + }, + "deploy": { + "nodeEnv": "development", + "tz": "America/Vancouver", + "dbSetupDockerfilePath": "./.docker/db/Dockerfile.setup", + "volumeCapacity": "3Gi", + "cpuRequest": "50m", + "cpuLimit": "400m", + "memoryRequest": "100Mi", + "memoryLimit": "2Gi", + "replicas": "1" + } + }, + "test": { + "build": { + "tz": "America/Vancouver", + "sourceContextDir": "database", + "dbSetupDockerfilePath": "./.docker/db/Dockerfile.migrate", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "1.5Gi" + }, + "deploy": { + "nodeEnv": "production", + "tz": "America/Vancouver", + "dbSetupDockerfilePath": "./.docker/db/Dockerfile.migrate", + "volumeCapacity": "3Gi", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "3Gi", + "replicas": "1" + } + }, + "prod": { + "build": { + "tz": "America/Vancouver", + "sourceContextDir": "database", + "dbSetupDockerfilePath": "./.docker/db/Dockerfile.migrate", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "1.5Gi" + }, + "deploy": { + "nodeEnv": "production", + "tz": "America/Vancouver", + "dbSetupDockerfilePath": "./.docker/db/Dockerfile.migrate", + "volumeCapacity": "5Gi", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "3Gi", + "replicas": "1" + } + }, + "deploy": {} + }, + "sso": { + "pr": { + "host": "https://dev.loginproxy.gov.bc.ca/auth", + "realm": "standard", + "clientId": "sims-4461", + "keycloakSecret": "keycloak", + "serviceClient": { + "serviceClientName": "sims-svc-4464", + "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" + }, + "cssApi": { + "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", + "cssApiClientId": "service-account-team-1190-4229", + "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", + "keycloakSecretCssApiSecretKey": "css_api_client_secret", + "cssApiEnvironment": "dev" + } + }, + "dev": { + "host": "https://dev.loginproxy.gov.bc.ca/auth", + "realm": "standard", + "clientId": "sims-4461", + "keycloakSecret": "keycloak", + "serviceClient": { + "serviceClientName": "sims-svc-4464", + "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" + }, + "cssApi": { + "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", + "cssApiClientId": "service-account-team-1190-4229", + "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", + "keycloakSecretCssApiSecretKey": "css_api_client_secret", + "cssApiEnvironment": "dev" + } + }, + "test": { + "host": "https://test.loginproxy.gov.bc.ca/auth", + "realm": "standard", + "clientId": "sims-4461", + "keycloakSecret": "keycloak", + "serviceClient": { + "serviceClientName": "sims-svc-4464", + "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" + }, + "cssApi": { + "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", + "cssApiClientId": "service-account-team-1190-4229", + "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", + "keycloakSecretCssApiSecretKey": "css_api_client_secret", + "cssApiEnvironment": "test" + } + }, + "prod": { + "host": "https://loginproxy.gov.bc.ca/auth", + "realm": "standard", + "clientId": "sims-4461", + "keycloakSecret": "keycloak", + "serviceClient": { + "serviceClientName": "sims-svc-4464", + "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" + }, + "cssApi": { + "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", + "cssApiClientId": "service-account-team-1190-4229", + "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", + "keycloakSecretCssApiSecretKey": "css_api_client_secret", + "cssApiEnvironment": "prod" + } + } + } +} diff --git a/.pipeline/configMaps/sims.configmap.yaml b/.pipeline/configMaps/sims.configmap.yaml new file mode 100644 index 0000000000..a5942e8973 --- /dev/null +++ b/.pipeline/configMaps/sims.configmap.yaml @@ -0,0 +1,405 @@ +kind: ConfigMap +apiVersion: v1 +metadata: + name: sims-pipeline-config + namespace: af2668-dev +immutable: false +data: + config: | + { + "name": "sims", + "namespaceSuffix": "af2668", + "namespace": { + "tools": "tools", + "dev": "dev", + "test": "test", + "prod": "prod" + }, + "version": "1.0.0", + "module": { + "db": "sims-db", + "api": "sims-api", + "app": "sims-app" + }, + "api": { + "pr": { + "build": { + "tz": "America/Vancouver", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "3Gi" + }, + "deploy": { + "nodeEnv": "development", + "staticApiUrl": "api-dev-sims.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "dev-sims.apps.silver.devops.gov.bc.ca", + "tz": "America/Vancouver", + "backboneApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", + "backboneIntakePath": "/api/dwc/submission/queue", + "backboneArtifactIntakePath": "/api/artifact/intake", + "backboneIntakeEnabled": false, + "bctwApiHost": "https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca", + "critterbaseApiHost": "https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api", + "elasticsearchURL": "http://es01.a0ec71-dev:9200", + "elasticsearchTaxonomyIndex": "taxonomy_3.0.0", + "s3KeyPrefix": "sims-pr", + "logLevel": "debug", + "cpuRequest": "50m", + "cpuLimit": "400m", + "memoryRequest": "100Mi", + "memoryLimit": "2Gi", + "replicas": "1", + "replicasMax": "2" + } + }, + "dev": { + "build": { + "tz": "America/Vancouver", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "3Gi" + }, + "deploy": { + "nodeEnv": "development", + "staticApiUrl": "api-dev-sims.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "dev-sims.apps.silver.devops.gov.bc.ca", + "tz": "America/Vancouver", + "backboneApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", + "backboneIntakePath": "/api/dwc/submission/queue", + "backboneArtifactIntakePath": "/api/artifact/intake", + "backboneIntakeEnabled": false, + "bctwApiHost": "https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca", + "critterbaseApiHost": "https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api", + "elasticsearchURL": "http://es01.a0ec71-dev:9200", + "elasticsearchTaxonomyIndex": "taxonomy_3.0.0", + "s3KeyPrefix": "sims", + "logLevel": "debug", + "cpuRequest": "50m", + "cpuLimit": "400m", + "memoryRequest": "100Mi", + "memoryLimit": "2Gi", + "replicas": "1", + "replicasMax": "2" + } + }, + "test": { + "build": { + "tz": "America/Vancouver", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "3Gi" + }, + "deploy": { + "nodeEnv": "production", + "staticApiUrl": "api-test-sims.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "test-sims.apps.silver.devops.gov.bc.ca", + "tz": "America/Vancouver", + "backboneApiHost": "https://api-test-biohub-platform.apps.silver.devops.gov.bc.ca", + "backboneIntakePath": "/api/dwc/submission/queue", + "backboneArtifactIntakePath": "/api/artifact/intake", + "backboneIntakeEnabled": false, + "bctwApiHost": "https://moe-bctw-api-test.apps.silver.devops.gov.bc.ca", + "critterbaseApiHost": "https://moe-critterbase-api-test.apps.silver.devops.gov.bc.ca/api", + "elasticsearchURL": "http://es01.a0ec71-dev:9200", + "elasticsearchTaxonomyIndex": "taxonomy_3.0.0", + "s3KeyPrefix": "sims", + "logLevel": "info", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "3Gi", + "replicas": "2", + "replicasMax": "4" + } + }, + "prod": { + "build": { + "tz": "America/Vancouver", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "3Gi" + }, + "deploy": { + "nodeEnv": "production", + "staticApiUrl": "api-sims.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "sims.apps.silver.devops.gov.bc.ca", + "staticAppVanityUrl": "sims.nrs.gov.bc.ca", + "tz": "America/Vancouver", + "backboneApiHost": "https://api-biohub-platform.apps.silver.devops.gov.bc.ca", + "backboneIntakePath": "/api/dwc/submission/queue", + "backboneArtifactIntakePath": "/api/artifact/intake", + "backboneIntakeEnabled": false, + "bctwApiHost": "https://moe-bctw-api-prod.apps.silver.devops.gov.bc.ca", + "critterbaseApiHost": "https://moe-critterbase-api-prod.apps.silver.devops.gov.bc.ca/api", + "elasticsearchURL": "http://es01.a0ec71-prod:9200", + "elasticsearchTaxonomyIndex": "taxonomy_3.0.0", + "s3KeyPrefix": "sims", + "logLevel": "warn", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "3Gi", + "replicas": "2", + "replicasMax": "4" + } + } + }, + "app": { + "pr": { + "build": { + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "5Gi" + }, + "deploy": { + "nodeEnv": "development", + "siteminderLogoutURL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", + "maxUploadNumFiles": 10, + "maxUploadFileSize": 52428800, + "biohubFeatureFlag": "true", + "cpuRequest": "50m", + "cpuLimit": "200m", + "memoryRequest": "100Mi", + "memoryLimit": "333Mi", + "replicas": "1", + "replicasMax": "1" + } + }, + "dev": { + "build": { + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "5Gi" + }, + "deploy": { + "nodeEnv": "development", + "staticApiUrl": "api-dev-sims.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "dev-sims.apps.silver.devops.gov.bc.ca", + "siteminderLogoutURL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", + "maxUploadNumFiles": 10, + "maxUploadFileSize": 52428800, + "biohubFeatureFlag": "true", + "cpuRequest": "50m", + "cpuLimit": "200m", + "memoryRequest": "100Mi", + "memoryLimit": "333Mi", + "replicas": "1", + "replicasMax": "1" + } + }, + "test": { + "build": { + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "5Gi" + }, + "deploy": { + "nodeEnv": "production", + "staticApiUrl": "api-test-sims.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "test-sims.apps.silver.devops.gov.bc.ca", + "siteminderLogoutURL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", + "maxUploadNumFiles": 10, + "maxUploadFileSize": 52428800, + "biohubFeatureFlag": "false", + "cpuRequest": "50m", + "cpuLimit": "500m", + "memoryRequest": "100Mi", + "memoryLimit": "500Mi", + "replicas": "2", + "replicasMax": "3" + } + }, + "prod": { + "build": { + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "5Gi" + }, + "deploy": { + "nodeEnv": "production", + "staticApiUrl": "api-sims.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "sims.apps.silver.devops.gov.bc.ca", + "staticAppVanityUrl": "sims.nrs.gov.bc.ca", + "siteminderLogoutURL": "https://logon7.gov.bc.ca/clp-cgi/logoff.cgi", + "maxUploadNumFiles": 10, + "maxUploadFileSize": 52428800, + "biohubFeatureFlag": "false", + "cpuRequest": "50m", + "cpuLimit": "500m", + "memoryRequest": "100Mi", + "memoryLimit": "500Mi", + "replicas": "2", + "replicasMax": "3" + } + } + }, + "database": { + "pr": { + "build": { + "tz": "America/Vancouver", + "sourceContextDir": "database", + "dbSetupDockerfilePath": "./.docker/db/Dockerfile.setup", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "1.5Gi" + }, + "deploy": { + "nodeEnv": "development", + "tz": "America/Vancouver", + "dbSetupDockerfilePath": "./.docker/db/Dockerfile.setup", + "volumeCapacity": "500Mi", + "cpuRequest": "50m", + "cpuLimit": "400m", + "memoryRequest": "100Mi", + "memoryLimit": "2Gi", + "replicas": "1" + } + }, + "dev": { + "build": { + "tz": "America/Vancouver", + "sourceContextDir": "database", + "dbSetupDockerfilePath": "./.docker/db/Dockerfile.setup", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "1.5Gi" + }, + "deploy": { + "nodeEnv": "development", + "tz": "America/Vancouver", + "dbSetupDockerfilePath": "./.docker/db/Dockerfile.setup", + "volumeCapacity": "3Gi", + "cpuRequest": "50m", + "cpuLimit": "400m", + "memoryRequest": "100Mi", + "memoryLimit": "2Gi", + "replicas": "1" + } + }, + "test": { + "build": { + "tz": "America/Vancouver", + "sourceContextDir": "database", + "dbSetupDockerfilePath": "./.docker/db/Dockerfile.migrate", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "1.5Gi" + }, + "deploy": { + "nodeEnv": "production", + "tz": "America/Vancouver", + "dbSetupDockerfilePath": "./.docker/db/Dockerfile.migrate", + "volumeCapacity": "3Gi", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "3Gi", + "replicas": "1" + } + }, + "prod": { + "build": { + "tz": "America/Vancouver", + "sourceContextDir": "database", + "dbSetupDockerfilePath": "./.docker/db/Dockerfile.migrate", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "1.5Gi" + }, + "deploy": { + "nodeEnv": "production", + "tz": "America/Vancouver", + "dbSetupDockerfilePath": "./.docker/db/Dockerfile.migrate", + "volumeCapacity": "5Gi", + "cpuRequest": "50m", + "cpuLimit": "1000m", + "memoryRequest": "100Mi", + "memoryLimit": "3Gi", + "replicas": "1" + } + }, + "deploy": {} + }, + "sso": { + "pr": { + "host": "https://dev.loginproxy.gov.bc.ca/auth", + "realm": "standard", + "clientId": "sims-4461", + "keycloakSecret": "keycloak", + "serviceClient": { + "serviceClientName": "sims-svc-4464", + "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" + }, + "cssApi": { + "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", + "cssApiClientId": "service-account-team-1190-4229", + "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", + "keycloakSecretCssApiSecretKey": "css_api_client_secret", + "cssApiEnvironment": "dev" + } + }, + "dev": { + "host": "https://dev.loginproxy.gov.bc.ca/auth", + "realm": "standard", + "clientId": "sims-4461", + "keycloakSecret": "keycloak", + "serviceClient": { + "serviceClientName": "sims-svc-4464", + "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" + }, + "cssApi": { + "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", + "cssApiClientId": "service-account-team-1190-4229", + "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", + "keycloakSecretCssApiSecretKey": "css_api_client_secret", + "cssApiEnvironment": "dev" + } + }, + "test": { + "host": "https://test.loginproxy.gov.bc.ca/auth", + "realm": "standard", + "clientId": "sims-4461", + "keycloakSecret": "keycloak", + "serviceClient": { + "serviceClientName": "sims-svc-4464", + "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" + }, + "cssApi": { + "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", + "cssApiClientId": "service-account-team-1190-4229", + "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", + "keycloakSecretCssApiSecretKey": "css_api_client_secret", + "cssApiEnvironment": "test" + } + }, + "prod": { + "host": "https://loginproxy.gov.bc.ca/auth", + "realm": "standard", + "clientId": "sims-4461", + "keycloakSecret": "keycloak", + "serviceClient": { + "serviceClientName": "sims-svc-4464", + "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" + }, + "cssApi": { + "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", + "cssApiClientId": "service-account-team-1190-4229", + "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", + "keycloakSecretCssApiSecretKey": "css_api_client_secret", + "cssApiEnvironment": "prod" + } + } + } + } From 5423351b22d9054f14f8fbff4c5e74bc24f13f94 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Fri, 26 Jan 2024 21:34:02 -0800 Subject: [PATCH 14/62] Fixes --- api/.pipeline/lib/api.deploy.js | 4 +- api/.pipeline/lib/clean.js | 100 ++++++++++++++-------------- api/.pipeline/scripts/clean.js | 5 +- app/.pipeline/lib/clean.js | 100 ++++++++++++++-------------- app/.pipeline/scripts/clean.js | 5 +- database/.pipeline/lib/clean.js | 41 ++++++------ database/.pipeline/scripts/clean.js | 5 +- 7 files changed, 133 insertions(+), 127 deletions(-) diff --git a/api/.pipeline/lib/api.deploy.js b/api/.pipeline/lib/api.deploy.js index f7854ddb02..ee210468ba 100644 --- a/api/.pipeline/lib/api.deploy.js +++ b/api/.pipeline/lib/api.deploy.js @@ -19,8 +19,6 @@ const apiDeploy = async (settings) => { const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, '../templates')); - const changeId = phases[env][phase].changeId; - let objects = []; objects.push( @@ -31,7 +29,7 @@ const apiDeploy = async (settings) => { VERSION: phases[env][phase].tag, HOST: phases[env][phase].host, APP_HOST: phases[env][phase].appHost, - CHANGE_ID: phases.build.changeId || changeId, + CHANGE_ID: phases[env][phase].changeId, // Node NODE_ENV: phases[env][phase].nodeEnv, NODE_OPTIONS: phases[env][phase].nodeOptions, diff --git a/api/.pipeline/lib/clean.js b/api/.pipeline/lib/clean.js index 44fa671415..03d5b3cd3c 100644 --- a/api/.pipeline/lib/clean.js +++ b/api/.pipeline/lib/clean.js @@ -7,73 +7,71 @@ const { OpenShiftClientX } = require('pipeline-cli'); * * @param {*} settings */ -const clean = (settings) => { +const clean = async (settings) => { const phases = settings.phases; const options = settings.options; - const target_env = settings.options.env; - const target_phase = settings.options.phase; + const env = settings.options.env; + const phase = settings.options.phase; const oc = new OpenShiftClientX(Object.assign({ namespace: phases.build.namespace }, options)); - for (let phaseKey in phases) { - if (!Object.prototype.hasOwnProperty.call(phases, phaseKey)) { - continue; - } + if (!Object.prototype.hasOwnProperty.call(phases, env)) { + // is not a field of phases + return; + } - if (phaseKey !== target_phase) { - continue; - } + if (!Object.prototype.hasOwnProperty.call(phases[env], phase)) { + // is not a field of phases[env] + return; + } - const phaseObj = phases[phaseKey]; + // Get build configs + let buildConfigs = oc.get('bc', { + selector: `app=${phases[env][phase].instance},env-id=${phases[env][phase].changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, + namespace: phases[env][phase].namespace + }); - // Get build configs - let buildConfigs = oc.get('bc', { - selector: `app=${phaseObj.instance},env-id=${phaseObj.changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, - namespace: phaseObj.namespace - }); + // Clean build configs + buildConfigs.forEach((buildConfig) => { + if (buildConfig.spec.output.to.kind == 'ImageStreamTag') { + oc.delete([`ImageStreamTag/${buildConfig.spec.output.to.name}`], { + 'ignore-not-found': 'true', + wait: 'true', + namespace: phases[env][phase].namespace + }); + } + }); + + // get deployment configs + let deploymentConfigs = oc.get('dc', { + selector: `app=${phases[env][phase].instance},env-id=${phases[env][phase].changeId},env-name=${phaseKey},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, + namespace: phases[env][phase].namespace + }); - // Clean build configs - buildConfigs.forEach((buildConfig) => { - if (buildConfig.spec.output.to.kind == 'ImageStreamTag') { - oc.delete([`ImageStreamTag/${buildConfig.spec.output.to.name}`], { + // Clean deployment configs + deploymentConfigs.forEach((deploymentConfig) => { + deploymentConfig.spec.triggers.forEach((trigger) => { + if (trigger.type == 'ImageChange' && trigger.imageChangeParams.from.kind == 'ImageStreamTag') { + oc.delete([`ImageStreamTag/${trigger.imageChangeParams.from.name}`], { 'ignore-not-found': 'true', wait: 'true', - namespace: phaseObj.namespace + namespace: phases[env][phase].namespace }); } }); + }); - // get deployment configs - let deploymentConfigs = oc.get('dc', { - selector: `app=${phaseObj.instance},env-id=${phaseObj.changeId},env-name=${phaseKey},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, - namespace: phaseObj.namespace - }); - - // Clean deployment configs - deploymentConfigs.forEach((deploymentConfig) => { - deploymentConfig.spec.triggers.forEach((trigger) => { - if (trigger.type == 'ImageChange' && trigger.imageChangeParams.from.kind == 'ImageStreamTag') { - oc.delete([`ImageStreamTag/${trigger.imageChangeParams.from.name}`], { - 'ignore-not-found': 'true', - wait: 'true', - namespace: phaseObj.namespace - }); - } - }); - }); + oc.raw('delete', ['all'], { + selector: `app=${phases[env][phase].instance},env-id=${phases[env][phase].changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, + wait: 'true', + namespace: phases[env][phase].namespace + }); - oc.raw('delete', ['all'], { - selector: `app=${phaseObj.instance},env-id=${phaseObj.changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, - wait: 'true', - namespace: phaseObj.namespace - }); - - oc.raw('delete', ['all,pvc,secrets,Secrets,secret,configmap,endpoints,Endpoints'], { - selector: `app=${phaseObj.instance},env-id=${phaseObj.changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, - wait: 'true', - namespace: phaseObj.namespace - }); - } + oc.raw('delete', ['all,pvc,secrets,Secrets,secret,configmap,endpoints,Endpoints'], { + selector: `app=${phases[env][phase].instance},env-id=${phases[env][phase].changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, + wait: 'true', + namespace: phases[env][phase].namespace + }); }; module.exports = { clean }; diff --git a/api/.pipeline/scripts/clean.js b/api/.pipeline/scripts/clean.js index 598bb50187..49b9253982 100644 --- a/api/.pipeline/scripts/clean.js +++ b/api/.pipeline/scripts/clean.js @@ -4,4 +4,7 @@ const { clean } = require('../lib/clean.js'); const config = require('../config.js'); // Cleans all build and deployment artifacts (pods, etc) -clean(config); +clean(config).catch((error) => { + console.log('api clean - catch - error: ', error); + throw error; +}); diff --git a/app/.pipeline/lib/clean.js b/app/.pipeline/lib/clean.js index c90607d34b..03d5b3cd3c 100644 --- a/app/.pipeline/lib/clean.js +++ b/app/.pipeline/lib/clean.js @@ -7,73 +7,71 @@ const { OpenShiftClientX } = require('pipeline-cli'); * * @param {*} settings */ -const clean = (settings) => { +const clean = async (settings) => { const phases = settings.phases; const options = settings.options; - const target_env = settings.options.env; - const target_phase = settings.options.phase; + const env = settings.options.env; + const phase = settings.options.phase; const oc = new OpenShiftClientX(Object.assign({ namespace: phases.build.namespace }, options)); - for (let phaseKey in phases) { - if (!Object.prototype.hasOwnProperty.call(phases, phaseKey)) { - continue; - } + if (!Object.prototype.hasOwnProperty.call(phases, env)) { + // is not a field of phases + return; + } - if (phaseKey !== target_phase) { - continue; - } + if (!Object.prototype.hasOwnProperty.call(phases[env], phase)) { + // is not a field of phases[env] + return; + } - const phaseObj = phases[phaseKey]; + // Get build configs + let buildConfigs = oc.get('bc', { + selector: `app=${phases[env][phase].instance},env-id=${phases[env][phase].changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, + namespace: phases[env][phase].namespace + }); - // Get build configs - let buildConfigs = oc.get('bc', { - selector: `app=${phaseObj.instance},env-id=${phaseObj.changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, - namespace: phaseObj.namespace - }); + // Clean build configs + buildConfigs.forEach((buildConfig) => { + if (buildConfig.spec.output.to.kind == 'ImageStreamTag') { + oc.delete([`ImageStreamTag/${buildConfig.spec.output.to.name}`], { + 'ignore-not-found': 'true', + wait: 'true', + namespace: phases[env][phase].namespace + }); + } + }); + + // get deployment configs + let deploymentConfigs = oc.get('dc', { + selector: `app=${phases[env][phase].instance},env-id=${phases[env][phase].changeId},env-name=${phaseKey},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, + namespace: phases[env][phase].namespace + }); - // Clean build configs - buildConfigs.forEach((buildConfig) => { - if (buildConfig.spec.output.to.kind == 'ImageStreamTag') { - oc.delete([`ImageStreamTag/${buildConfig.spec.output.to.name}`], { + // Clean deployment configs + deploymentConfigs.forEach((deploymentConfig) => { + deploymentConfig.spec.triggers.forEach((trigger) => { + if (trigger.type == 'ImageChange' && trigger.imageChangeParams.from.kind == 'ImageStreamTag') { + oc.delete([`ImageStreamTag/${trigger.imageChangeParams.from.name}`], { 'ignore-not-found': 'true', wait: 'true', - namespace: phaseObj.namespace + namespace: phases[env][phase].namespace }); } }); + }); - // get deployment configs - let deploymentConfigs = oc.get('dc', { - selector: `app=${phaseObj.instance},env-id=${phaseObj.changeId},env-name=${phaseKey},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, - namespace: phaseObj.namespace - }); - - // Clean deployment configs - deploymentConfigs.forEach((deploymentConfig) => { - deploymentConfig.spec.triggers.forEach((trigger) => { - if (trigger.type == 'ImageChange' && trigger.imageChangeParams.from.kind == 'ImageStreamTag') { - oc.delete([`ImageStreamTag/${trigger.imageChangeParams.from.name}`], { - 'ignore-not-found': 'true', - wait: 'true', - namespace: phaseObj.namespace - }); - } - }); - }); + oc.raw('delete', ['all'], { + selector: `app=${phases[env][phase].instance},env-id=${phases[env][phase].changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, + wait: 'true', + namespace: phases[env][phase].namespace + }); - oc.raw('delete', ['all'], { - selector: `app=${phaseObj.instance},env-id=${phaseObj.changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, - wait: 'true', - namespace: phaseObj.namespace - }); - - oc.raw('delete', ['pvc,Secret,secrets,secret,configmap,endpoints,Endpoints'], { - selector: `app=${phaseObj.instance},env-id=${phaseObj.changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, - wait: 'true', - namespace: phaseObj.namespace - }); - } + oc.raw('delete', ['all,pvc,secrets,Secrets,secret,configmap,endpoints,Endpoints'], { + selector: `app=${phases[env][phase].instance},env-id=${phases[env][phase].changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, + wait: 'true', + namespace: phases[env][phase].namespace + }); }; module.exports = { clean }; diff --git a/app/.pipeline/scripts/clean.js b/app/.pipeline/scripts/clean.js index 598bb50187..71df40003e 100644 --- a/app/.pipeline/scripts/clean.js +++ b/app/.pipeline/scripts/clean.js @@ -4,4 +4,7 @@ const { clean } = require('../lib/clean.js'); const config = require('../config.js'); // Cleans all build and deployment artifacts (pods, etc) -clean(config); +clean(config).catch((error) => { + console.log('app clean - catch - error: ', error); + throw error; +}); diff --git a/database/.pipeline/lib/clean.js b/database/.pipeline/lib/clean.js index 5174685d01..398c3e5e4a 100644 --- a/database/.pipeline/lib/clean.js +++ b/database/.pipeline/lib/clean.js @@ -3,6 +3,11 @@ const { OpenShiftClientX } = require('pipeline-cli'); const { checkAndClean } = require('../utils/utils'); +/** + * Run OC commands to clean all build and deployment artifacts (pods, imagestreams, builds/deployment configs, etc). + * + * @param {*} settings + */ const clean = async (settings) => { const phases = settings.phases; const options = settings.options; @@ -21,39 +26,37 @@ const clean = async (settings) => { return; } - const phaseObj = phases[env][phase]; - // Get build configs let buildConfigs = oc.get('bc', { - selector: `app=${phaseObj.instance},env-id=${phaseObj.changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, - namespace: phaseObj.namespace + selector: `app=${phases[env][phase].instance},env-id=${phases[env][phase].changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, + namespace: phases[env][phase].namespace }); // Clean build configs - buildConfigs.forEach((bc) => { - if (bc.spec.output.to.kind == 'ImageStreamTag') { - oc.delete([`ImageStreamTag/${bc.spec.output.to.name}`], { + buildConfigs.forEach((buildConfig) => { + if (buildConfig.spec.output.to.kind == 'ImageStreamTag') { + oc.delete([`ImageStreamTag/${buildConfig.spec.output.to.name}`], { 'ignore-not-found': 'true', wait: 'true', - namespace: phaseObj.namespace + namespace: phases[env][phase].namespace }); } }); // get deployment configs let deploymentConfigs = oc.get('dc', { - selector: `app=${phaseObj.instance},env-id=${phaseObj.changeId},env-name=${env},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, - namespace: phaseObj.namespace + selector: `app=${phases[env][phase].instance},env-id=${phases[env][phase].changeId},env-name=${env},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, + namespace: phases[env][phase].namespace }); // Clean deployment configs - deploymentConfigs.forEach((dc) => { - dc.spec.triggers.forEach((trigger) => { + deploymentConfigs.forEach((deploymentConfig) => { + deploymentConfig.spec.triggers.forEach((trigger) => { if (trigger.type == 'ImageChange' && trigger.imageChangeParams.from.kind == 'ImageStreamTag') { oc.delete([`ImageStreamTag/${trigger.imageChangeParams.from.name}`], { 'ignore-not-found': 'true', wait: 'true', - namespace: phaseObj.namespace + namespace: phases[env][phase].namespace }); } }); @@ -61,23 +64,23 @@ const clean = async (settings) => { // Cleaning other pods if (phase !== 'build') { - const newOC = new OpenShiftClientX(Object.assign({ namespace: phaseObj.namespace }, options)); - const setupPod = `${phaseObj.name}-setup${phaseObj.suffix}`; + const newOC = new OpenShiftClientX(Object.assign({ namespace: phases[env][phase].namespace }, options)); + const setupPod = `${phases[env][phase].name}-setup${phases[env][phase].suffix}`; await checkAndClean(`pod/${setupPod}`, 10, 5, 0, newOC).catch(() => { // Ignore errors, nothing to clean }); } oc.raw('delete', ['all'], { - selector: `app=${phaseObj.instance},env-id=${phaseObj.changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, + selector: `app=${phases[env][phase].instance},env-id=${phases[env][phase].changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, wait: 'true', - namespace: phaseObj.namespace + namespace: phases[env][phase].namespace }); oc.raw('delete', ['all,pvc,secrets,Secrets,secret,configmap,endpoints,Endpoints'], { - selector: `app=${phaseObj.instance},env-id=${phaseObj.changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, + selector: `app=${phases[env][phase].instance},env-id=${phases[env][phase].changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, wait: 'true', - namespace: phaseObj.namespace + namespace: phases[env][phase].namespace }); }; diff --git a/database/.pipeline/scripts/clean.js b/database/.pipeline/scripts/clean.js index 598bb50187..1e9f2c10fc 100644 --- a/database/.pipeline/scripts/clean.js +++ b/database/.pipeline/scripts/clean.js @@ -4,4 +4,7 @@ const { clean } = require('../lib/clean.js'); const config = require('../config.js'); // Cleans all build and deployment artifacts (pods, etc) -clean(config); +clean(config).catch((error) => { + console.log('database clean - catch - error: ', error); + throw error; +}); From d9ecf8118f77be8dd577f3cee2908bb3acfd2736 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Fri, 26 Jan 2024 23:37:51 -0800 Subject: [PATCH 15/62] Fixes --- api/.pipeline/config.js | 8 ++++---- api/.pipeline/lib/api.build.js | 4 ++-- api/.pipeline/lib/api.deploy.js | 8 +++++++- app/.pipeline/config.js | 8 ++++---- app/.pipeline/lib/app.build.js | 2 +- app/.pipeline/lib/app.deploy.js | 12 ++++++++---- database/.pipeline/config.js | 8 ++++---- database/.pipeline/lib/db.setup.build.js | 2 +- database/.pipeline/lib/db.setup.deploy.js | 10 +++++----- 9 files changed, 36 insertions(+), 26 deletions(-) diff --git a/api/.pipeline/config.js b/api/.pipeline/config.js index d28be74e9a..b2bc8ee824 100644 --- a/api/.pipeline/config.js +++ b/api/.pipeline/config.js @@ -86,7 +86,7 @@ const phases = { instance: `${pipelineConfigMap.module.api}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, tag: tag, - branch: branch + branch: branch || options.git.ref }, deploy: { ...pipelineConfigMap.api.pr.deploy, @@ -116,7 +116,7 @@ const phases = { instance: `${pipelineConfigMap.module.api}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, tag: tag, - branch: branch + branch: branch || options.git.ref }, deploy: { ...pipelineConfigMap.api.dev.deploy, @@ -145,7 +145,7 @@ const phases = { instance: `${pipelineConfigMap.module.api}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, tag: tag, - branch: branch + branch: branch || options.git.ref }, deploy: { ...pipelineConfigMap.api.test.deploy, @@ -175,7 +175,7 @@ const phases = { instance: `${pipelineConfigMap.module.api}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, tag: tag, - branch: branch + branch: branch || options.git.ref }, deploy: { ...pipelineConfigMap.api.prod.deploy, diff --git a/api/.pipeline/lib/api.build.js b/api/.pipeline/lib/api.build.js index 39aad3dc75..aaa17f53c0 100644 --- a/api/.pipeline/lib/api.build.js +++ b/api/.pipeline/lib/api.build.js @@ -29,7 +29,7 @@ const apiBuild = (settings) => { SUFFIX: phases[env][phase].suffix, VERSION: phases[env][phase].tag, SOURCE_REPOSITORY_URL: oc.git.http_url, - SOURCE_REPOSITORY_REF: phases[env][phase].branch || oc.git.ref, + SOURCE_REPOSITORY_REF: phases[env][phase].branch, CPU_REQUEST: phases[env][phase].cpuRequest, CPU_LIMIT: phases[env][phase].cpuLimit, MEMORY_REQUEST: phases[env][phase].memoryRequest, @@ -48,7 +48,7 @@ const apiBuild = (settings) => { SUFFIX: phases[env][phase].suffix, VERSION: phases[env][phase].tag, SOURCE_REPOSITORY_URL: oc.git.http_url, - SOURCE_REPOSITORY_REF: phases[env][phase].branch || oc.git.ref, + SOURCE_REPOSITORY_REF: phases[env][phase].branch, CPU_REQUEST: phases[env][phase].cpuRequest, CPU_LIMIT: phases[env][phase].cpuLimit, MEMORY_REQUEST: phases[env][phase].memoryRequest, diff --git a/api/.pipeline/lib/api.deploy.js b/api/.pipeline/lib/api.deploy.js index ee210468ba..55d139958d 100644 --- a/api/.pipeline/lib/api.deploy.js +++ b/api/.pipeline/lib/api.deploy.js @@ -77,7 +77,13 @@ const apiDeploy = async (settings) => { }) ); - oc.applyRecommendedLabels(objects, phases[env][phase].name, env, `${changeId}`, phases[env][phase].instance); + oc.applyRecommendedLabels( + objects, + phases[env][phase].name, + env, + phases[env][phase].changeId, + phases[env][phase].instance + ); oc.importImageStreams(objects, phases[env][phase].tag, phases.build.namespace, phases.build.tag); await oc.applyAndDeploy(objects, phases[env][phase].instance); diff --git a/app/.pipeline/config.js b/app/.pipeline/config.js index 01ce81932e..d47c9d38ef 100644 --- a/app/.pipeline/config.js +++ b/app/.pipeline/config.js @@ -86,7 +86,7 @@ const phases = { instance: `${pipelineConfigMap.module.app}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, tag: tag, - branch: branch + branch: branch || options.git.ref }, deploy: { ...pipelineConfigMap.app.pr.deploy, @@ -113,7 +113,7 @@ const phases = { instance: `${pipelineConfigMap.module.app}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, tag: tag, - branch: branch + branch: branch || options.git.ref }, deploy: { ...pipelineConfigMap.app.dev.deploy, @@ -140,7 +140,7 @@ const phases = { instance: `${pipelineConfigMap.module.app}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, tag: tag, - branch: branch + branch: branch || options.git.ref }, deploy: { ...pipelineConfigMap.app.test.deploy, @@ -167,7 +167,7 @@ const phases = { instance: `${pipelineConfigMap.module.app}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, tag: tag, - branch: branch + branch: branch || options.git.ref }, deploy: { ...pipelineConfigMap.app.prod.deploy, diff --git a/app/.pipeline/lib/app.build.js b/app/.pipeline/lib/app.build.js index 23c302a908..1983b968fc 100644 --- a/app/.pipeline/lib/app.build.js +++ b/app/.pipeline/lib/app.build.js @@ -27,7 +27,7 @@ const appBuild = (settings) => { SUFFIX: phases[env][phase].suffix, VERSION: phases[env][phase].tag, SOURCE_REPOSITORY_URL: oc.git.http_url, - SOURCE_REPOSITORY_REF: phases[env][phase].branch || oc.git.ref, + SOURCE_REPOSITORY_REF: phases[env][phase].branch, CPU_REQUEST: phases[env][phase].cpuRequest, CPU_LIMIT: phases[env][phase].cpuLimit, MEMORY_REQUEST: phases[env][phase].memoryRequest, diff --git a/app/.pipeline/lib/app.deploy.js b/app/.pipeline/lib/app.deploy.js index c9a9ffd72d..3913284d94 100644 --- a/app/.pipeline/lib/app.deploy.js +++ b/app/.pipeline/lib/app.deploy.js @@ -13,8 +13,6 @@ const appDeploy = async (settings) => { const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, '../templates')); - const changeId = phases[env][phase].changeId; - const objects = []; objects.push( @@ -24,7 +22,7 @@ const appDeploy = async (settings) => { SUFFIX: phases[env][phase].suffix, VERSION: phases[env][phase].tag, HOST: phases[env][phase].host, - CHANGE_ID: phases.build.changeId || changeId, + CHANGE_ID: phases[env][phase].changeId, REACT_APP_API_HOST: phases[env][phase].apiHost, REACT_APP_SITEMINDER_LOGOUT_URL: phases[env][phase].siteminderLogoutURL, // File Upload Settings @@ -49,7 +47,13 @@ const appDeploy = async (settings) => { }) ); - oc.applyRecommendedLabels(objects, phases[env][phase].name, env, `${changeId}`, phases[env][phase].instance); + oc.applyRecommendedLabels( + objects, + phases[env][phase].name, + env, + phases[env][phase].changeId, + phases[env][phase].instance + ); oc.importImageStreams(objects, phases[env][phase].tag, phases.build.namespace, phases.build.tag); await oc.applyAndDeploy(objects, phases[env][phase].instance); diff --git a/database/.pipeline/config.js b/database/.pipeline/config.js index e9a16c8ee7..5c326795c6 100644 --- a/database/.pipeline/config.js +++ b/database/.pipeline/config.js @@ -89,7 +89,7 @@ const phases = { instance: `${pipelineConfigMap.module.db}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, tag: tag, - branch: branch + branch: branch || options.git.ref }, deploy: { ...pipelineConfigMap.database.pr.deploy, @@ -113,7 +113,7 @@ const phases = { instance: `${pipelineConfigMap.module.db}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, tag: tag, - branch: branch + branch: branch || options.git.ref }, deploy: { ...pipelineConfigMap.database.dev.deploy, @@ -137,7 +137,7 @@ const phases = { instance: `${pipelineConfigMap.module.db}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, tag: tag, - branch: branch + branch: branch || options.git.ref }, deploy: { ...pipelineConfigMap.database.test.deploy, @@ -161,7 +161,7 @@ const phases = { instance: `${pipelineConfigMap.module.db}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, tag: tag, - branch: branch + branch: branch || options.git.ref }, deploy: { ...pipelineConfigMap.database.prod.deploy, diff --git a/database/.pipeline/lib/db.setup.build.js b/database/.pipeline/lib/db.setup.build.js index f0dc76c1e6..c2ae4af5e8 100644 --- a/database/.pipeline/lib/db.setup.build.js +++ b/database/.pipeline/lib/db.setup.build.js @@ -31,7 +31,7 @@ const dbSetupBuild = (settings) => { SOURCE_CONTEXT_DIR: phases[env][phase].sourceContextDir, DB_SETUP_DOCKERFILE_PATH: phases[env][phase].dbSetupDockerfilePath, SOURCE_REPOSITORY_URL: oc.git.http_url, - SOURCE_REPOSITORY_REF: phases[env][phase].branch || oc.git.ref, + SOURCE_REPOSITORY_REF: phases[env][phase].branch, CPU_REQUEST: phases[env][phase].cpuRequest, CPU_LIMIT: phases[env][phase].cpuLimit, MEMORY_REQUEST: phases[env][phase].memoryRequest, diff --git a/database/.pipeline/lib/db.setup.deploy.js b/database/.pipeline/lib/db.setup.deploy.js index 9f1647a80d..4b6009eb35 100644 --- a/database/.pipeline/lib/db.setup.deploy.js +++ b/database/.pipeline/lib/db.setup.deploy.js @@ -72,10 +72,10 @@ const dbSetupDeploy = async (settings) => { DB_SCHEMA: 'biohub', DB_SCHEMA_DAPI_V1: 'biohub_dapi_v1', IMAGE: dbSetupImageStream.image.dockerImageReference, - CPU_REQUEST: '50m', - CPU_LIMIT: '1000m', - MEMORY_REQUEST: '100Mi', - MEMORY_LIMIT: '1.5Gi' + CPU_REQUEST: phases[env][phase].cpuRequest, + CPU_LIMIT: phases[env][phase].cpuLimit, + MEMORY_REQUEST: phases[env][phase].memoryRequest, + MEMORY_LIMIT: phases[env][phase].memoryLimit } }) ); @@ -95,7 +95,7 @@ const dbSetupDeploy = async (settings) => { ); // Deploy the db setup pod - oc.applyRecommendedLabels(objects, isName, env, `${changeId}`, instance); + oc.applyRecommendedLabels(objects, isName, env, changeId, instance); await oc.applyAndDeploy(objects, phases[env][phase].deploy.instance); // Wait to confirm if the db setup pod deployed successfully From 077b54cc3db411824c3e76563ac9c55a8e48f29f Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Sat, 27 Jan 2024 00:02:38 -0800 Subject: [PATCH 16/62] Fixes --- api/.pipeline/lib/api.deploy.js | 4 ++-- api/.pipeline/lib/clean.js | 2 +- app/.pipeline/lib/app.deploy.js | 4 ++-- app/.pipeline/lib/clean.js | 2 +- database/.pipeline/lib/clean.js | 2 +- database/.pipeline/lib/db.deploy.js | 8 ++++---- database/.pipeline/lib/db.setup.deploy.js | 22 +++++++++++----------- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/api/.pipeline/lib/api.deploy.js b/api/.pipeline/lib/api.deploy.js index 55d139958d..4f76a1f634 100644 --- a/api/.pipeline/lib/api.deploy.js +++ b/api/.pipeline/lib/api.deploy.js @@ -29,7 +29,7 @@ const apiDeploy = async (settings) => { VERSION: phases[env][phase].tag, HOST: phases[env][phase].host, APP_HOST: phases[env][phase].appHost, - CHANGE_ID: phases[env][phase].changeId, + CHANGE_ID: phases[env].build.changeId || phases[env][phase].changeId, // Node NODE_ENV: phases[env][phase].nodeEnv, NODE_OPTIONS: phases[env][phase].nodeOptions, @@ -84,7 +84,7 @@ const apiDeploy = async (settings) => { phases[env][phase].changeId, phases[env][phase].instance ); - oc.importImageStreams(objects, phases[env][phase].tag, phases.build.namespace, phases.build.tag); + oc.importImageStreams(objects, phases[env][phase].tag, phases[env].build.namespace, phases[env].build.tag); await oc.applyAndDeploy(objects, phases[env][phase].instance); }; diff --git a/api/.pipeline/lib/clean.js b/api/.pipeline/lib/clean.js index 03d5b3cd3c..1cebee2759 100644 --- a/api/.pipeline/lib/clean.js +++ b/api/.pipeline/lib/clean.js @@ -13,7 +13,7 @@ const clean = async (settings) => { const env = settings.options.env; const phase = settings.options.phase; - const oc = new OpenShiftClientX(Object.assign({ namespace: phases.build.namespace }, options)); + const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env].build.namespace }, options)); if (!Object.prototype.hasOwnProperty.call(phases, env)) { // is not a field of phases diff --git a/app/.pipeline/lib/app.deploy.js b/app/.pipeline/lib/app.deploy.js index 3913284d94..74448ad8a4 100644 --- a/app/.pipeline/lib/app.deploy.js +++ b/app/.pipeline/lib/app.deploy.js @@ -22,7 +22,7 @@ const appDeploy = async (settings) => { SUFFIX: phases[env][phase].suffix, VERSION: phases[env][phase].tag, HOST: phases[env][phase].host, - CHANGE_ID: phases[env][phase].changeId, + CHANGE_ID: phases[env].build.changeId || phases[env][phase].changeId, REACT_APP_API_HOST: phases[env][phase].apiHost, REACT_APP_SITEMINDER_LOGOUT_URL: phases[env][phase].siteminderLogoutURL, // File Upload Settings @@ -54,7 +54,7 @@ const appDeploy = async (settings) => { phases[env][phase].changeId, phases[env][phase].instance ); - oc.importImageStreams(objects, phases[env][phase].tag, phases.build.namespace, phases.build.tag); + oc.importImageStreams(objects, phases[env][phase].tag, phases[env].build.namespace, phases[env].build.tag); await oc.applyAndDeploy(objects, phases[env][phase].instance); }; diff --git a/app/.pipeline/lib/clean.js b/app/.pipeline/lib/clean.js index 03d5b3cd3c..1cebee2759 100644 --- a/app/.pipeline/lib/clean.js +++ b/app/.pipeline/lib/clean.js @@ -13,7 +13,7 @@ const clean = async (settings) => { const env = settings.options.env; const phase = settings.options.phase; - const oc = new OpenShiftClientX(Object.assign({ namespace: phases.build.namespace }, options)); + const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env].build.namespace }, options)); if (!Object.prototype.hasOwnProperty.call(phases, env)) { // is not a field of phases diff --git a/database/.pipeline/lib/clean.js b/database/.pipeline/lib/clean.js index 398c3e5e4a..78b87a80d3 100644 --- a/database/.pipeline/lib/clean.js +++ b/database/.pipeline/lib/clean.js @@ -14,7 +14,7 @@ const clean = async (settings) => { const env = settings.options.env; const phase = settings.options.phase; - const oc = new OpenShiftClientX(Object.assign({ namespace: phases.build.namespace }, options)); + const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env].build.namespace }, options)); if (!Object.prototype.hasOwnProperty.call(phases, env)) { // is not a field of phases diff --git a/database/.pipeline/lib/db.deploy.js b/database/.pipeline/lib/db.deploy.js index 904fffb094..ebb4c1cf17 100644 --- a/database/.pipeline/lib/db.deploy.js +++ b/database/.pipeline/lib/db.deploy.js @@ -31,10 +31,10 @@ const dbDeploy = async (settings) => { NAME: name, DATABASE_SERVICE_NAME: `${name}-postgresql${phases[env][phase].suffix}`, IMAGE_STREAM_NAME: name, - IMAGE_STREAM_VERSION: phases.build.tag, + IMAGE_STREAM_VERSION: phases[env].build.tag, POSTGRESQL_DATABASE: 'biohubbc', TZ: phases[env][phase].tz, - IMAGE_STREAM_NAMESPACE: phases.build.namespace, + IMAGE_STREAM_NAMESPACE: phases[env].build.namespace, VOLUME_CAPACITY: phases[env][phase].volumeCapacity, CPU_REQUEST: phases[env][phase].cpuRequest, CPU_LIMIT: phases[env][phase].cpuLimit, @@ -46,8 +46,8 @@ const dbDeploy = async (settings) => { ); oc.applyRecommendedLabels(objects, name, env, changeId, instance); - oc.importImageStreams(objects, phases[env][phase].tag, phases.build.namespace, phases.build.tag); - + oc.importImageStreams(objects, phases[env][phase].tag, phases[env].build.namespace, phases[env].build.tag); + await oc.applyAndDeploy(objects, instance); }; diff --git a/database/.pipeline/lib/db.setup.deploy.js b/database/.pipeline/lib/db.setup.deploy.js index 4b6009eb35..6a53532aec 100644 --- a/database/.pipeline/lib/db.setup.deploy.js +++ b/database/.pipeline/lib/db.setup.deploy.js @@ -17,16 +17,16 @@ const dbSetupDeploy = async (settings) => { const env = settings.options.env; const phase = settings.options.phase; - const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env][phase].deploy.namespace }, options)); + const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env][phase].namespace }, options)); const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, '../templates')); - const changeId = phases[env][phase].deploy.changeId; - const isName = `${phases[env][phase].deploy.name}-setup`; + const changeId = phases[env][phase].changeId; + const isName = `${phases[env][phase].name}-setup`; const instance = `${isName}-${changeId}`; - const isVersion = `${phases[env][phase].deploy.tag}-setup`; + const isVersion = `${phases[env][phase].tag}-setup`; const imageStreamName = `${isName}:${isVersion}`; - const dbName = `${phases[env][phase].deploy.name}-postgresql${phases[env][phase].deploy.suffix}`; + const dbName = `${phases[env][phase].name}-postgresql${phases[env][phase].suffix}`; const objects = []; const imageStreamObjects = []; @@ -46,7 +46,7 @@ const dbSetupDeploy = async (settings) => { ); oc.applyRecommendedLabels(imageStreamObjects, isName, env, `${changeId}`, instance); - oc.importImageStreams(imageStreamObjects, isVersion, phases.build.namespace, phases.build.tag); + oc.importImageStreams(imageStreamObjects, isVersion, phases[env].build.namespace, phases[env].build.tag); // Get database setup image stream const fetchedImageStreams = oc.get(`istag/${imageStreamName}`) || []; @@ -58,16 +58,16 @@ const dbSetupDeploy = async (settings) => { const dbSetupImageStream = fetchedImageStreams[0]; - const name = `${isName}${phases[env][phase].deploy.suffix}`; + const name = `${isName}${phases[env][phase].suffix}`; objects.push( ...oc.processDeploymentTemplate(`${templatesLocalBaseUrl}/db.setup.dc.yaml`, { param: { NAME: name, - SUFFIX: phases[env][phase].deploy.suffix, - VERSION: phases[env][phase].deploy.tag, + SUFFIX: phases[env][phase].suffix, + VERSION: phases[env][phase].tag, CHANGE_ID: changeId, - NODE_ENV: phases[env][phase].deploy.nodeEnv, + NODE_ENV: phases[env][phase].nodeEnv, DB_SERVICE_NAME: dbName, DB_SCHEMA: 'biohub', DB_SCHEMA_DAPI_V1: 'biohub_dapi_v1', @@ -96,7 +96,7 @@ const dbSetupDeploy = async (settings) => { // Deploy the db setup pod oc.applyRecommendedLabels(objects, isName, env, changeId, instance); - await oc.applyAndDeploy(objects, phases[env][phase].deploy.instance); + await oc.applyAndDeploy(objects, phases[env][phase].instance); // Wait to confirm if the db setup pod deployed successfully await waitForResourceToMeetCondition(() => getResourceByName(`pod/${name}`, oc), isResourceComplete, 30, 5, 0); From 7bb9932be8b81cb9b085f1f8c60de818deb82234 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Sat, 27 Jan 2024 14:31:21 -0800 Subject: [PATCH 17/62] ignore-skip From ee6593e55012219eb52685b6028e5e12f5ff0b85 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Sat, 27 Jan 2024 14:56:53 -0800 Subject: [PATCH 18/62] Updates --- .github/workflows/addComments.yml | 4 +- .github/workflows/cleanClosedPR.yml | 2 +- .github/workflows/cleanMergedPR.yml | 2 +- .github/workflows/deploy.yml | 6 +- .github/workflows/deployStatic.yml | 2 +- .pipeline/configMaps/sims-configmap.json | 4 -- .pipeline/configMaps/sims.configmap.yaml | 4 -- api/.pipeline/config.js | 14 ++--- api/.pipeline/lib/api.build.js | 21 ------- api/.pipeline/scripts/api.deploy.js | 6 +- api/.pipeline/scripts/clean.js | 2 +- api/.pipeline/templates/api.dc.yaml | 2 +- .../templates/prereqs/biohubbc-db.yaml | 2 +- .../prereqs/biohubbc-object-store.yaml | 2 +- api/.pipeline/utils/configMapSchema.js | 4 -- app/.pipeline/config.js | 14 ++--- app/.pipeline/scripts/app.deploy.js | 6 +- app/.pipeline/scripts/clean.js | 2 +- app/.pipeline/templates/app.dc.yaml | 2 +- app/.pipeline/utils/configMapSchema.js | 4 -- database/.pipeline/config.js | 12 ++-- database/.pipeline/lib/db.setup.build.js | 18 +++++- database/.pipeline/lib/db.setup.deploy.js | 2 +- database/.pipeline/scripts/clean.js | 2 +- database/.pipeline/scripts/db.deploy.js | 6 +- database/.pipeline/scripts/db.setup.deploy.js | 6 +- database/.pipeline/templates/db.dc.yaml | 2 +- database/.pipeline/utils/configMapSchema.js | 4 -- database/.pipeline/utils/utils.js | 60 +++++++++---------- 29 files changed, 90 insertions(+), 127 deletions(-) diff --git a/.github/workflows/addComments.yml b/.github/workflows/addComments.yml index fb2f63be4e..bfd5469349 100644 --- a/.github/workflows/addComments.yml +++ b/.github/workflows/addComments.yml @@ -19,6 +19,6 @@ jobs: issue-number: ${{ github.event.number }} body: | Openshift URLs for the PR Deployment: - - App Route: https://biohubbc-app-${{ github.event.number }}-af2668-dev.apps.silver.devops.gov.bc.ca/ - - Api Route: https://biohubbc-api-${{ github.event.number }}-af2668-dev.apps.silver.devops.gov.bc.ca/ + - App Route: https://sims-app-${{ github.event.number }}-af2668-dev.apps.silver.devops.gov.bc.ca/ + - Api Route: https://sims-api-${{ github.event.number }}-af2668-dev.apps.silver.devops.gov.bc.ca/ - Pods: https://console.apps.silver.devops.gov.bc.ca/k8s/ns/af2668-dev/pods?name=${{ github.event.number }} diff --git a/.github/workflows/cleanClosedPR.yml b/.github/workflows/cleanClosedPR.yml index 6213ef2ecb..577bd9da76 100644 --- a/.github/workflows/cleanClosedPR.yml +++ b/.github/workflows/cleanClosedPR.yml @@ -73,7 +73,7 @@ jobs: # Clean the reamaining build/deployment artifacts - name: Clean remaining Artifacts env: - POD_SELECTOR: biohubbc + POD_SELECTOR: sims run: | 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 diff --git a/.github/workflows/cleanMergedPR.yml b/.github/workflows/cleanMergedPR.yml index 680c34c0b3..3903d5cf64 100644 --- a/.github/workflows/cleanMergedPR.yml +++ b/.github/workflows/cleanMergedPR.yml @@ -77,7 +77,7 @@ jobs: # Clean the reamaining build/deployment artifacts - name: Clean remaining Artifacts env: - POD_SELECTOR: biohubbc + POD_SELECTOR: sims run: | 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 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d8007a3efd..87928edc3c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -166,7 +166,7 @@ jobs: fromJSON(needs.skipDuplicateActions.outputs.paths_result).app.skipped_by.branch != github.head_ref ) }} env: PR_NUMBER: ${{ github.event.number }} - APP_NAME: "biohubbc-app" + APP_NAME: "sims-app" PIPELINE_CONFIG: ${{ needs.getPipelineConfigMap.outputs.pipeline_config }} needs: - checkoutRepo @@ -230,7 +230,7 @@ jobs: fromJSON(needs.skipDuplicateActions.outputs.paths_result).database.skipped_by.branch != github.head_ref ) }} env: PR_NUMBER: ${{ github.event.number }} - APP_NAME: "biohubbc-db" + APP_NAME: "sims-db" PIPELINE_CONFIG: ${{ needs.getPipelineConfigMap.outputs.pipeline_config }} needs: - checkoutRepo @@ -351,7 +351,7 @@ jobs: fromJSON(needs.skipDuplicateActions.outputs.paths_result).api.skipped_by.branch != github.head_ref ) }} env: PR_NUMBER: ${{ github.event.number }} - APP_NAME: "biohubbc-api" + APP_NAME: "sims-api" PIPELINE_CONFIG: ${{ needs.getPipelineConfigMap.outputs.pipeline_config }} needs: - checkoutRepo diff --git a/.github/workflows/deployStatic.yml b/.github/workflows/deployStatic.yml index 5f617cabda..57c033f6b2 100644 --- a/.github/workflows/deployStatic.yml +++ b/.github/workflows/deployStatic.yml @@ -599,7 +599,7 @@ jobs: # Clean the reamaining build/deployment artifacts - name: Clean remaining Artifacts env: - POD_SELECTOR: biohubbc + POD_SELECTOR: sims run: | 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 diff --git a/.pipeline/configMaps/sims-configmap.json b/.pipeline/configMaps/sims-configmap.json index 640dfa9238..2498254d62 100644 --- a/.pipeline/configMaps/sims-configmap.json +++ b/.pipeline/configMaps/sims-configmap.json @@ -247,7 +247,6 @@ "deploy": { "nodeEnv": "development", "tz": "America/Vancouver", - "dbSetupDockerfilePath": "./.docker/db/Dockerfile.setup", "volumeCapacity": "500Mi", "cpuRequest": "50m", "cpuLimit": "400m", @@ -269,7 +268,6 @@ "deploy": { "nodeEnv": "development", "tz": "America/Vancouver", - "dbSetupDockerfilePath": "./.docker/db/Dockerfile.setup", "volumeCapacity": "3Gi", "cpuRequest": "50m", "cpuLimit": "400m", @@ -291,7 +289,6 @@ "deploy": { "nodeEnv": "production", "tz": "America/Vancouver", - "dbSetupDockerfilePath": "./.docker/db/Dockerfile.migrate", "volumeCapacity": "3Gi", "cpuRequest": "50m", "cpuLimit": "1000m", @@ -313,7 +310,6 @@ "deploy": { "nodeEnv": "production", "tz": "America/Vancouver", - "dbSetupDockerfilePath": "./.docker/db/Dockerfile.migrate", "volumeCapacity": "5Gi", "cpuRequest": "50m", "cpuLimit": "1000m", diff --git a/.pipeline/configMaps/sims.configmap.yaml b/.pipeline/configMaps/sims.configmap.yaml index a5942e8973..1747f3f037 100644 --- a/.pipeline/configMaps/sims.configmap.yaml +++ b/.pipeline/configMaps/sims.configmap.yaml @@ -255,7 +255,6 @@ data: "deploy": { "nodeEnv": "development", "tz": "America/Vancouver", - "dbSetupDockerfilePath": "./.docker/db/Dockerfile.setup", "volumeCapacity": "500Mi", "cpuRequest": "50m", "cpuLimit": "400m", @@ -277,7 +276,6 @@ data: "deploy": { "nodeEnv": "development", "tz": "America/Vancouver", - "dbSetupDockerfilePath": "./.docker/db/Dockerfile.setup", "volumeCapacity": "3Gi", "cpuRequest": "50m", "cpuLimit": "400m", @@ -299,7 +297,6 @@ data: "deploy": { "nodeEnv": "production", "tz": "America/Vancouver", - "dbSetupDockerfilePath": "./.docker/db/Dockerfile.migrate", "volumeCapacity": "3Gi", "cpuRequest": "50m", "cpuLimit": "1000m", @@ -321,7 +318,6 @@ data: "deploy": { "nodeEnv": "production", "tz": "America/Vancouver", - "dbSetupDockerfilePath": "./.docker/db/Dockerfile.migrate", "volumeCapacity": "5Gi", "cpuRequest": "50m", "cpuLimit": "1000m", diff --git a/api/.pipeline/config.js b/api/.pipeline/config.js index b2bc8ee824..842b95e5c9 100644 --- a/api/.pipeline/config.js +++ b/api/.pipeline/config.js @@ -90,7 +90,7 @@ const phases = { }, deploy: { ...pipelineConfigMap.api.pr.deploy, - phase: 'pr', + // phase: 'pr', namespace: 'af2668-dev', name: pipelineConfigMap.module.api, dbName: pipelineConfigMap.module.db, @@ -120,7 +120,7 @@ const phases = { }, deploy: { ...pipelineConfigMap.api.dev.deploy, - phase: 'dev', + // phase: 'dev', namespace: 'af2668-dev', name: pipelineConfigMap.module.api, dbName: pipelineConfigMap.module.db, @@ -149,7 +149,7 @@ const phases = { }, deploy: { ...pipelineConfigMap.api.test.deploy, - phase: 'test', + // phase: 'test', namespace: 'af2668-test', name: pipelineConfigMap.module.api, dbName: pipelineConfigMap.module.db, @@ -179,7 +179,7 @@ const phases = { }, deploy: { ...pipelineConfigMap.api.prod.deploy, - phase: 'prod', + // phase: 'prod', namespace: 'af2668-prod', name: pipelineConfigMap.module.api, dbName: pipelineConfigMap.module.db, @@ -195,10 +195,4 @@ const phases = { } }; -console.log('1=============================================='); -console.log('api phases', phases); -console.log('2=============================================='); -console.log('api options', options); -console.log('3=============================================='); - module.exports = exports = { phases, options }; diff --git a/api/.pipeline/lib/api.build.js b/api/.pipeline/lib/api.build.js index aaa17f53c0..d6fb6b61a2 100644 --- a/api/.pipeline/lib/api.build.js +++ b/api/.pipeline/lib/api.build.js @@ -14,29 +14,8 @@ const apiBuild = (settings) => { const env = settings.options.env; const phase = settings.options.phase; - console.log('4=============================================='); - console.log('api options', options); - console.log('api env', env); - console.log('api phase', phase); - console.log('api phases', phases[env][phase]); - console.log('5=============================================='); - const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env][phase].namespace }, options)); - console.log('6=============================================='); - console.log({ - NAME: phases[env][phase].name, - SUFFIX: phases[env][phase].suffix, - VERSION: phases[env][phase].tag, - SOURCE_REPOSITORY_URL: oc.git.http_url, - SOURCE_REPOSITORY_REF: phases[env][phase].branch, - CPU_REQUEST: phases[env][phase].cpuRequest, - CPU_LIMIT: phases[env][phase].cpuLimit, - MEMORY_REQUEST: phases[env][phase].memoryRequest, - MEMORY_LIMIT: phases[env][phase].memoryLimit - }); - console.log('7=============================================='); - const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, '../templates')); const objects = []; diff --git a/api/.pipeline/scripts/api.deploy.js b/api/.pipeline/scripts/api.deploy.js index 820f1443f6..9c4b98f2ff 100644 --- a/api/.pipeline/scripts/api.deploy.js +++ b/api/.pipeline/scripts/api.deploy.js @@ -5,16 +5,16 @@ const { apiDeploy } = require('../lib/api.deploy.js'); const config = require('../config.js'); process.on('unhandledRejection', (reason, promise) => { - console.log('api deploy - unhandled rejection:', promise, 'reason:', reason); + console.debug('api deploy - unhandled rejection:', promise, 'reason:', reason); process.exit(1); }); process.on('exit', (code) => { - console.log('api deploy - exit:', 'code:', code); + console.debug('api deploy - exit:', 'code:', code); }); // Deploys the api image apiDeploy(config).catch((error) => { - console.log('api deploy - catch - error: ', error); + console.debug('api deploy - catch - error: ', error); throw error; }); diff --git a/api/.pipeline/scripts/clean.js b/api/.pipeline/scripts/clean.js index 49b9253982..6d44c86eeb 100644 --- a/api/.pipeline/scripts/clean.js +++ b/api/.pipeline/scripts/clean.js @@ -5,6 +5,6 @@ const config = require('../config.js'); // Cleans all build and deployment artifacts (pods, etc) clean(config).catch((error) => { - console.log('api clean - catch - error: ', error); + console.debug('api clean - catch - error: ', error); throw error; }); diff --git a/api/.pipeline/templates/api.dc.yaml b/api/.pipeline/templates/api.dc.yaml index 74bbb609a1..344cb07bcd 100644 --- a/api/.pipeline/templates/api.dc.yaml +++ b/api/.pipeline/templates/api.dc.yaml @@ -116,7 +116,7 @@ parameters: # Object Store (S3) - name: OBJECT_STORE_SECRETS description: Secrets used to read and write to the S3 storage - value: 'biohubbc-object-store' + value: 'sims-object-store' - name: S3_KEY_PREFIX description: S3 key optional prefix required: false diff --git a/api/.pipeline/templates/prereqs/biohubbc-db.yaml b/api/.pipeline/templates/prereqs/biohubbc-db.yaml index 1a8d9ef09f..cfa1f364e7 100644 --- a/api/.pipeline/templates/prereqs/biohubbc-db.yaml +++ b/api/.pipeline/templates/prereqs/biohubbc-db.yaml @@ -1,7 +1,7 @@ kind: Secret apiVersion: v1 metadata: - name: biohubbc-creds + name: sims-database data: database-admin: database-admin-password: diff --git a/api/.pipeline/templates/prereqs/biohubbc-object-store.yaml b/api/.pipeline/templates/prereqs/biohubbc-object-store.yaml index d8ebf0bdde..d1432cb893 100644 --- a/api/.pipeline/templates/prereqs/biohubbc-object-store.yaml +++ b/api/.pipeline/templates/prereqs/biohubbc-object-store.yaml @@ -1,7 +1,7 @@ kind: Secret apiVersion: v1 metadata: - name: biohubbc-object-store + name: sims-object-store data: object_store_access_key_id: object_store_bucket_name: diff --git a/api/.pipeline/utils/configMapSchema.js b/api/.pipeline/utils/configMapSchema.js index 9bd7403dc0..df0edf24e3 100644 --- a/api/.pipeline/utils/configMapSchema.js +++ b/api/.pipeline/utils/configMapSchema.js @@ -246,7 +246,6 @@ const PipelineConfigMapSchema = z.object({ deploy: z.object({ nodeEnv: z.string(), tz: z.string(), - dbSetupDockerfilePath: z.string(), volumeCapacity: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), @@ -267,7 +266,6 @@ const PipelineConfigMapSchema = z.object({ deploy: z.object({ nodeEnv: z.string(), tz: z.string(), - dbSetupDockerfilePath: z.string(), volumeCapacity: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), @@ -288,7 +286,6 @@ const PipelineConfigMapSchema = z.object({ deploy: z.object({ nodeEnv: z.string(), tz: z.string(), - dbSetupDockerfilePath: z.string(), volumeCapacity: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), @@ -309,7 +306,6 @@ const PipelineConfigMapSchema = z.object({ deploy: z.object({ nodeEnv: z.string(), tz: z.string(), - dbSetupDockerfilePath: z.string(), volumeCapacity: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), diff --git a/app/.pipeline/config.js b/app/.pipeline/config.js index d47c9d38ef..7fadd4e386 100644 --- a/app/.pipeline/config.js +++ b/app/.pipeline/config.js @@ -92,7 +92,7 @@ const phases = { ...pipelineConfigMap.app.pr.deploy, namespace: 'af2668-dev', name: pipelineConfigMap.module.app, - phase: 'dev', + // phase: 'dev', changeId: changeId, suffix: `-dev-${changeId}`, instance: `${pipelineConfigMap.module.app}-dev-${changeId}`, @@ -119,7 +119,7 @@ const phases = { ...pipelineConfigMap.app.dev.deploy, namespace: 'af2668-dev', name: pipelineConfigMap.module.app, - phase: 'dev', + // phase: 'dev', changeId: 'deploy', suffix: '-dev-deploy', instance: `${pipelineConfigMap.module.app}-dev-deploy`, @@ -146,7 +146,7 @@ const phases = { ...pipelineConfigMap.app.test.deploy, namespace: 'af2668-test', name: pipelineConfigMap.module.app, - phase: 'test', + // phase: 'test', changeId: 'deploy', suffix: `-test`, instance: `${pipelineConfigMap.module.app}-test`, @@ -173,7 +173,7 @@ const phases = { ...pipelineConfigMap.app.prod.deploy, namespace: 'af2668-prod', name: pipelineConfigMap.module.app, - phase: 'prod', + // phase: 'prod', changeId: 'deploy', suffix: `-prod`, instance: `${pipelineConfigMap.module.app}-prod`, @@ -186,10 +186,4 @@ const phases = { } }; -console.log('1=============================================='); -console.log('api phases', phases); -console.log('2=============================================='); -console.log('api options', options); -console.log('3=============================================='); - module.exports = exports = { phases, options }; diff --git a/app/.pipeline/scripts/app.deploy.js b/app/.pipeline/scripts/app.deploy.js index 6e9ef3d5da..34ad2496fe 100644 --- a/app/.pipeline/scripts/app.deploy.js +++ b/app/.pipeline/scripts/app.deploy.js @@ -5,16 +5,16 @@ const { appDeploy } = require('../lib/app.deploy.js'); const config = require('../config.js'); process.on('unhandledRejection', (reason, promise) => { - console.log('app deploy - unhandled rejection:', promise, 'reason:', reason); + console.debug('app deploy - unhandled rejection:', promise, 'reason:', reason); process.exit(1); }); process.on('exit', (code) => { - console.log('app deploy - exit:', 'code:', code); + console.debug('app deploy - exit:', 'code:', code); }); // Deploys the app image appDeploy(config).catch((error) => { - console.log('app deploy - catch - error: ', error); + console.debug('app deploy - catch - error: ', error); throw error; }); diff --git a/app/.pipeline/scripts/clean.js b/app/.pipeline/scripts/clean.js index 71df40003e..d37abfa54f 100644 --- a/app/.pipeline/scripts/clean.js +++ b/app/.pipeline/scripts/clean.js @@ -5,6 +5,6 @@ const config = require('../config.js'); // Cleans all build and deployment artifacts (pods, etc) clean(config).catch((error) => { - console.log('app clean - catch - error: ', error); + console.debug('app clean - catch - error: ', error); throw error; }); diff --git a/app/.pipeline/templates/app.dc.yaml b/app/.pipeline/templates/app.dc.yaml index 64c7850e02..08c36e65f6 100644 --- a/app/.pipeline/templates/app.dc.yaml +++ b/app/.pipeline/templates/app.dc.yaml @@ -37,7 +37,7 @@ parameters: value: 'development' - name: OBJECT_STORE_SECRETS description: Secrets used to read and write to the S3 storage - value: 'biohubbc-object-store' + value: 'sims-object-store' - name: APP_PORT_DEFAULT description: Application default port value: '7100' diff --git a/app/.pipeline/utils/configMapSchema.js b/app/.pipeline/utils/configMapSchema.js index 9bd7403dc0..df0edf24e3 100644 --- a/app/.pipeline/utils/configMapSchema.js +++ b/app/.pipeline/utils/configMapSchema.js @@ -246,7 +246,6 @@ const PipelineConfigMapSchema = z.object({ deploy: z.object({ nodeEnv: z.string(), tz: z.string(), - dbSetupDockerfilePath: z.string(), volumeCapacity: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), @@ -267,7 +266,6 @@ const PipelineConfigMapSchema = z.object({ deploy: z.object({ nodeEnv: z.string(), tz: z.string(), - dbSetupDockerfilePath: z.string(), volumeCapacity: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), @@ -288,7 +286,6 @@ const PipelineConfigMapSchema = z.object({ deploy: z.object({ nodeEnv: z.string(), tz: z.string(), - dbSetupDockerfilePath: z.string(), volumeCapacity: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), @@ -309,7 +306,6 @@ const PipelineConfigMapSchema = z.object({ deploy: z.object({ nodeEnv: z.string(), tz: z.string(), - dbSetupDockerfilePath: z.string(), volumeCapacity: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), diff --git a/database/.pipeline/config.js b/database/.pipeline/config.js index 5c326795c6..944cb82cbb 100644 --- a/database/.pipeline/config.js +++ b/database/.pipeline/config.js @@ -93,7 +93,7 @@ const phases = { }, deploy: { ...pipelineConfigMap.database.pr.deploy, - phase: 'dev', + // phase: 'dev', namespace: 'af2668-dev', name: pipelineConfigMap.module.db, changeId: deployChangeId, @@ -117,7 +117,7 @@ const phases = { }, deploy: { ...pipelineConfigMap.database.dev.deploy, - phase: 'dev', + // phase: 'dev', namespace: 'af2668-dev', name: pipelineConfigMap.module.db, changeId: deployChangeId, @@ -141,7 +141,7 @@ const phases = { }, deploy: { ...pipelineConfigMap.database.test.deploy, - phase: 'test', + // phase: 'test', namespace: 'af2668-test', name: pipelineConfigMap.module.db, changeId: deployChangeId, @@ -165,7 +165,7 @@ const phases = { }, deploy: { ...pipelineConfigMap.database.prod.deploy, - phase: 'prod', + // phase: 'prod', namespace: 'af2668-prod', name: pipelineConfigMap.module.db, changeId: deployChangeId, @@ -178,9 +178,9 @@ const phases = { }; console.log('1=============================================='); -console.log('api phases', phases); +console.log('phases', phases); console.log('2=============================================='); -console.log('api options', options); +console.log('options', options); console.log('3=============================================='); module.exports = exports = { phases, options }; diff --git a/database/.pipeline/lib/db.setup.build.js b/database/.pipeline/lib/db.setup.build.js index c2ae4af5e8..33cb6abcec 100644 --- a/database/.pipeline/lib/db.setup.build.js +++ b/database/.pipeline/lib/db.setup.build.js @@ -16,6 +16,22 @@ const dbSetupBuild = (settings) => { const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env][phase].namespace }, options)); + console.log('4=========================================='); + console.log({ + NAME: name, + SUFFIX: phases[env][phase].suffix, + VERSION: phases[env][phase].tag, + SOURCE_CONTEXT_DIR: phases[env][phase].sourceContextDir, + DB_SETUP_DOCKERFILE_PATH: phases[env][phase].dbSetupDockerfilePath, + SOURCE_REPOSITORY_URL: oc.git.http_url, + SOURCE_REPOSITORY_REF: phases[env][phase].branch, + CPU_REQUEST: phases[env][phase].cpuRequest, + CPU_LIMIT: phases[env][phase].cpuLimit, + MEMORY_REQUEST: phases[env][phase].memoryRequest, + MEMORY_LIMIT: phases[env][phase].memoryLimit + }); + console.log('5=========================================='); + const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, '../templates')); const name = `${phases[env][phase].name}-setup`; @@ -28,7 +44,7 @@ const dbSetupBuild = (settings) => { NAME: name, SUFFIX: phases[env][phase].suffix, VERSION: phases[env][phase].tag, - SOURCE_CONTEXT_DIR: phases[env][phase].sourceContextDir, + // SOURCE_CONTEXT_DIR: phases[env][phase].sourceContextDir, DB_SETUP_DOCKERFILE_PATH: phases[env][phase].dbSetupDockerfilePath, SOURCE_REPOSITORY_URL: oc.git.http_url, SOURCE_REPOSITORY_REF: phases[env][phase].branch, diff --git a/database/.pipeline/lib/db.setup.deploy.js b/database/.pipeline/lib/db.setup.deploy.js index 6a53532aec..1b6e92bfa6 100644 --- a/database/.pipeline/lib/db.setup.deploy.js +++ b/database/.pipeline/lib/db.setup.deploy.js @@ -52,7 +52,7 @@ const dbSetupDeploy = async (settings) => { const fetchedImageStreams = oc.get(`istag/${imageStreamName}`) || []; if (!fetchedImageStreams.length) { - console.log('Unable to fetch Database image reference for use in database setup deployment'); + console.debug('Unable to fetch Database image reference for use in database setup deployment'); process.exit(0); } diff --git a/database/.pipeline/scripts/clean.js b/database/.pipeline/scripts/clean.js index 1e9f2c10fc..cbaabb14e6 100644 --- a/database/.pipeline/scripts/clean.js +++ b/database/.pipeline/scripts/clean.js @@ -5,6 +5,6 @@ const config = require('../config.js'); // Cleans all build and deployment artifacts (pods, etc) clean(config).catch((error) => { - console.log('database clean - catch - error: ', error); + console.debug('database clean - catch - error: ', error); throw error; }); diff --git a/database/.pipeline/scripts/db.deploy.js b/database/.pipeline/scripts/db.deploy.js index 45107090cb..064d3c727e 100644 --- a/database/.pipeline/scripts/db.deploy.js +++ b/database/.pipeline/scripts/db.deploy.js @@ -5,16 +5,16 @@ const { dbDeploy } = require('../lib/db.deploy.js'); const config = require('../config.js'); process.on('unhandledRejection', (reason, promise) => { - console.log('database deploy - unhandled rejection:', promise, 'reason:', reason); + console.debug('database deploy - unhandled rejection:', promise, 'reason:', reason); process.exit(1); }); process.on('exit', (code) => { - console.log('database deploy - exit:', 'code:', code); + console.debug('database deploy - exit:', 'code:', code); }); // Deploys the database image dbDeploy(config).catch((error) => { - console.log('database deploy - catch - error: ', error); + console.debug('database deploy - catch - error: ', error); throw error; }); diff --git a/database/.pipeline/scripts/db.setup.deploy.js b/database/.pipeline/scripts/db.setup.deploy.js index 97d53d4857..48b2193803 100644 --- a/database/.pipeline/scripts/db.setup.deploy.js +++ b/database/.pipeline/scripts/db.setup.deploy.js @@ -5,16 +5,16 @@ const { dbSetupDeploy } = require('../lib/db.setup.deploy.js'); const config = require('../config.js'); process.on('unhandledRejection', (reason, promise) => { - console.log('database setup deploy - unhandled rejection:', promise, 'reason:', reason); + console.debug('database setup deploy - unhandled rejection:', promise, 'reason:', reason); process.exit(1); }); process.on('exit', (code) => { - console.log('database setup deploy - exit:', 'code:', code); + console.debug('database setup deploy - exit:', 'code:', code); }); // deploy database setup (migrations, seeding, etc) dbSetupDeploy(config).catch((error) => { - console.log('database setup deploy - catch - error: ', error); + console.debug('database setup deploy - catch - error: ', error); throw error; }); diff --git a/database/.pipeline/templates/db.dc.yaml b/database/.pipeline/templates/db.dc.yaml index 162dc86e38..202efad224 100644 --- a/database/.pipeline/templates/db.dc.yaml +++ b/database/.pipeline/templates/db.dc.yaml @@ -93,7 +93,7 @@ objects: template.openshift.io/expose-password: "{.data['database-user-password']}" template.openshift.io/expose-admin-password: "{.data['database-admin-password']}" template.openshift.io/expose-admin-username: "{.data['database-user']}" - as-copy-of: biohubbc-creds + as-copy-of: sims-creds name: '${DATABASE_SERVICE_NAME}' stringData: database-name: '${POSTGRESQL_DATABASE}' diff --git a/database/.pipeline/utils/configMapSchema.js b/database/.pipeline/utils/configMapSchema.js index 9bd7403dc0..df0edf24e3 100644 --- a/database/.pipeline/utils/configMapSchema.js +++ b/database/.pipeline/utils/configMapSchema.js @@ -246,7 +246,6 @@ const PipelineConfigMapSchema = z.object({ deploy: z.object({ nodeEnv: z.string(), tz: z.string(), - dbSetupDockerfilePath: z.string(), volumeCapacity: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), @@ -267,7 +266,6 @@ const PipelineConfigMapSchema = z.object({ deploy: z.object({ nodeEnv: z.string(), tz: z.string(), - dbSetupDockerfilePath: z.string(), volumeCapacity: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), @@ -288,7 +286,6 @@ const PipelineConfigMapSchema = z.object({ deploy: z.object({ nodeEnv: z.string(), tz: z.string(), - dbSetupDockerfilePath: z.string(), volumeCapacity: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), @@ -309,7 +306,6 @@ const PipelineConfigMapSchema = z.object({ deploy: z.object({ nodeEnv: z.string(), tz: z.string(), - dbSetupDockerfilePath: z.string(), volumeCapacity: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), diff --git a/database/.pipeline/utils/utils.js b/database/.pipeline/utils/utils.js index c61f707184..ba08779ca1 100644 --- a/database/.pipeline/utils/utils.js +++ b/database/.pipeline/utils/utils.js @@ -9,7 +9,7 @@ * @throws an Error if the oc command fails */ const getResourceByName = (resourceName, oc) => { - console.log(`1 - getResourceByName - Fetching resource: ${resourceName}`); + console.debug(`1 - getResourceByName - Fetching resource: ${resourceName}`); const matches = oc.get(resourceName); if (!matches || !matches.length) { @@ -60,7 +60,7 @@ const getResourceByRaw = (selector, type, settings, oc) => { * @return {*} */ const deleteResourceByName = (resourceName, oc) => { - console.log(`1 - deleteResourceByName - Deleting resource: ${resourceName}`); + console.debug(`1 - deleteResourceByName - Deleting resource: ${resourceName}`); return oc.delete([resourceName], { 'ignore-not-found': 'true', wait: 'true' }); }; @@ -75,29 +75,29 @@ const isResourceRunning = (resource) => { const status = resource.status || { conditions: [], containerStatuses: [] }; if (!status.conditions) { - console.log(`1 - isResourceRunning - Resource 'status.conditions' is null or undefined`); + console.debug(`1 - isResourceRunning - Resource 'status.conditions' is null or undefined`); return false; } if (status.conditions && !status.conditions.length) { - console.log(`2 - isResourceRunning - Resource 'status.conditions' is empty`); + console.debug(`2 - isResourceRunning - Resource 'status.conditions' is empty`); return false; } if (!status.containerStatuses) { - console.log(`3 - isResourceRunning - Resource 'status.containerStatuses' is null or undefined`); + console.debug(`3 - isResourceRunning - Resource 'status.containerStatuses' is null or undefined`); return false; } if (!status.containerStatuses.length) { - console.log(`4 - isResourceRunning - Resource 'status.containerStatuses' is empty`); + console.debug(`4 - isResourceRunning - Resource 'status.containerStatuses' is empty`); return false; } const containerStatus = status.containerStatuses[0] || {}; if (!containerStatus.state) { - console.log(`5 - isResourceRunning - Resource 'status.containerStatus[0].state' is null or undefined`); + console.debug(`5 - isResourceRunning - Resource 'status.containerStatus[0].state' is null or undefined`); return false; } @@ -105,21 +105,21 @@ const isResourceRunning = (resource) => { if (state.terminated) { if (state.terminated.reason.toLowerCase() === 'completed') { - console.log(`8 - isResourceRunning - Resource completed successfully`); + console.debug(`8 - isResourceRunning - Resource completed successfully`); throw new Error(`7 - isResourceRunning - Resource terminated without error`); } else { - console.log(`9 - isResourceRunning - Resource terminated with error`); - console.log(`9 - isResourceRunning - Error: resource status = ${JSON.stringify(resource.status, null, 2)}`); + console.debug(`9 - isResourceRunning - Resource terminated with error`); + console.debug(`9 - isResourceRunning - Error: resource status = ${JSON.stringify(resource.status, null, 2)}`); throw new Error(`9 - isResourceRunning - Resource terminated with error`); } } if (state.running) { - console.log(`6 - isResourceRunning - Resource is running`); + console.debug(`6 - isResourceRunning - Resource is running`); return true; // Happy path } - console.log(`7 - isResourceRunning - Resource is pending`); + console.debug(`7 - isResourceRunning - Resource is pending`); return false; }; @@ -135,29 +135,29 @@ const isResourceComplete = (resource) => { const status = resource.status || { conditions: [], containerStatuses: [] }; if (!status.conditions) { - console.log(`1 - isResourceComplete - Resource 'status.conditions' is null or undefined`); + console.debug(`1 - isResourceComplete - Resource 'status.conditions' is null or undefined`); return false; } if (status.conditions && !status.conditions.length) { - console.log(`2 - isResourceComplete - Resource 'status.conditions' is empty`); + console.debug(`2 - isResourceComplete - Resource 'status.conditions' is empty`); return false; } if (!status.containerStatuses) { - console.log(`3 - isResourceComplete - Resource 'status.containerStatuses' is null or undefined`); + console.debug(`3 - isResourceComplete - Resource 'status.containerStatuses' is null or undefined`); return false; } if (!status.containerStatuses.length) { - console.log(`4 - isResourceComplete - Resource 'status.containerStatuses' is empty`); + console.debug(`4 - isResourceComplete - Resource 'status.containerStatuses' is empty`); return false; } const containerStatus = status.containerStatuses[0] || {}; if (!containerStatus.state) { - console.log(`5 - isResourceComplete - Resource 'status.containerStatus[0].state' is null or undefined`); + console.debug(`5 - isResourceComplete - Resource 'status.containerStatus[0].state' is null or undefined`); return false; } @@ -165,16 +165,16 @@ const isResourceComplete = (resource) => { if (state.terminated) { if (state.terminated.reason.toLowerCase() === 'completed') { - console.log(`7 - isResourceComplete - Resource completed successfully`); + console.debug(`7 - isResourceComplete - Resource completed successfully`); return true; // Happy path } else { - console.log(`8 - isResourceComplete - Resource terminated with error`); - console.log(`8 - isResourceComplete - Error: resource status = ${JSON.stringify(resource.status, null, 2)}`); + console.debug(`8 - isResourceComplete - Resource terminated with error`); + console.debug(`8 - isResourceComplete - Error: resource status = ${JSON.stringify(resource.status, null, 2)}`); throw new Error(`8 - isResourceComplete - Resource terminated with error`); } } - console.log(`6 - isResourceComplete - Resource is pending`); + console.debug(`6 - isResourceComplete - Resource is pending`); return false; }; @@ -215,7 +215,7 @@ const waitForResourceToMeetCondition = async ( const retry = async () => { if (count > 0) { count = count - 1; - console.log(`4 - waitForResourceToMeetCondition - Waiting for resource: retry count = ${count}`); + console.debug(`4 - waitForResourceToMeetCondition - Waiting for resource: retry count = ${count}`); await sleep(timeout); return check(); } else { @@ -224,19 +224,19 @@ const waitForResourceToMeetCondition = async ( }; const check = async () => { - console.log(`1 - waitForResourceToMeetCondition - Waiting for resource begin`); + console.debug(`1 - waitForResourceToMeetCondition - Waiting for resource begin`); let resource; try { resource = getResourceFunction(); } catch { - console.log(`2 - waitForResourceToMeetCondition - Resource was not found`); + console.debug(`2 - waitForResourceToMeetCondition - Resource was not found`); return retry(); } if (!resource) { - console.log(`3 - waitForResourceToMeetCondition - Resource was not found`); + console.debug(`3 - waitForResourceToMeetCondition - Resource was not found`); return retry(); } @@ -275,7 +275,7 @@ const checkAndClean = async (resourceName, numberOfRetries, timeoutBetweenRetrie const retry = async () => { if (count > 0) { count = count - 1; - console.log(`5 - checkAndClean - Waiting for resource: retry count = ${count}`); + console.debug(`5 - checkAndClean - Waiting for resource: retry count = ${count}`); await sleep(timeout); return check(); } else { @@ -284,7 +284,7 @@ const checkAndClean = async (resourceName, numberOfRetries, timeoutBetweenRetrie }; const check = async () => { - console.log(`1 - checkAndClean - Waiting for resource begin`); + console.debug(`1 - checkAndClean - Waiting for resource begin`); try { let resource; @@ -292,16 +292,16 @@ const checkAndClean = async (resourceName, numberOfRetries, timeoutBetweenRetrie try { resource = getResourceByName(resourceName, oc); } catch { - console.log(`2 - checkAndClean - Resource was not found`); + console.debug(`2 - checkAndClean - Resource was not found`); return retry(); } if (!resource) { - console.log(`3 - checkAndClean - Resource was not found`); + console.debug(`3 - checkAndClean - Resource was not found`); return retry(); } - console.log(`4 - checkAndClean - Deleting resource: ${resourceName}`); + console.debug(`4 - checkAndClean - Deleting resource: ${resourceName}`); deleteResourceByName(resourceName, oc); } catch { console.error(`7 - checkAndClean - Error: waiting for resource failed`); From f1b3a367dc7cdf67299e9bb89f20378a907e7342 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Sat, 27 Jan 2024 14:57:34 -0800 Subject: [PATCH 19/62] ignore-skip From 75be2ffc3547fd47e20d79d3c4ed3af4cebf7f29 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Sat, 27 Jan 2024 15:02:03 -0800 Subject: [PATCH 20/62] Fix bad log --- database/.pipeline/lib/db.setup.build.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/database/.pipeline/lib/db.setup.build.js b/database/.pipeline/lib/db.setup.build.js index 33cb6abcec..dd67a0b897 100644 --- a/database/.pipeline/lib/db.setup.build.js +++ b/database/.pipeline/lib/db.setup.build.js @@ -16,6 +16,12 @@ const dbSetupBuild = (settings) => { const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env][phase].namespace }, options)); + const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, '../templates')); + + const name = `${phases[env][phase].name}-setup`; + + const objects = []; + console.log('4=========================================='); console.log({ NAME: name, @@ -32,12 +38,6 @@ const dbSetupBuild = (settings) => { }); console.log('5=========================================='); - const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, '../templates')); - - const name = `${phases[env][phase].name}-setup`; - - const objects = []; - objects.push( ...oc.processDeploymentTemplate(`${templatesLocalBaseUrl}/db.setup.bc.yaml`, { param: { From 4a8ac9b295b7b26e46b8226c608b7b5f17bbe584 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Sat, 27 Jan 2024 15:06:43 -0800 Subject: [PATCH 21/62] Fix secret name --- database/.pipeline/templates/db.dc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/.pipeline/templates/db.dc.yaml b/database/.pipeline/templates/db.dc.yaml index 202efad224..75a41829b8 100644 --- a/database/.pipeline/templates/db.dc.yaml +++ b/database/.pipeline/templates/db.dc.yaml @@ -93,7 +93,7 @@ objects: template.openshift.io/expose-password: "{.data['database-user-password']}" template.openshift.io/expose-admin-password: "{.data['database-admin-password']}" template.openshift.io/expose-admin-username: "{.data['database-user']}" - as-copy-of: sims-creds + as-copy-of: sims-database name: '${DATABASE_SERVICE_NAME}' stringData: database-name: '${POSTGRESQL_DATABASE}' From 0cb233fdd8b852f79d3233aa05b3aea64cd6ae72 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Sat, 27 Jan 2024 15:24:23 -0800 Subject: [PATCH 22/62] Updates --- .github/workflows/cleanClosedPR.yml | 6 +++--- .github/workflows/cleanMergedPR.yml | 6 +++--- api/.pipeline/config.js | 7 +++++-- app/.pipeline/config.js | 8 +++++--- database/.pipeline/config.js | 31 ++++++++++++++--------------- 5 files changed, 31 insertions(+), 27 deletions(-) diff --git a/.github/workflows/cleanClosedPR.yml b/.github/workflows/cleanClosedPR.yml index 577bd9da76..f59f4c5b02 100644 --- a/.github/workflows/cleanClosedPR.yml +++ b/.github/workflows/cleanClosedPR.yml @@ -52,7 +52,7 @@ jobs: run: | npm ci DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=pr --phase=build - 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 @@ -60,7 +60,7 @@ jobs: run: | npm ci DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=pr --phase=build - 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 @@ -68,7 +68,7 @@ jobs: run: | npm ci DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=pr --phase=build - 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 diff --git a/.github/workflows/cleanMergedPR.yml b/.github/workflows/cleanMergedPR.yml index 3903d5cf64..9f4a9ae2eb 100644 --- a/.github/workflows/cleanMergedPR.yml +++ b/.github/workflows/cleanMergedPR.yml @@ -56,7 +56,7 @@ 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 @@ -64,7 +64,7 @@ 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 api deployment artifacts - name: Clean API Deployment @@ -72,7 +72,7 @@ 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 reamaining build/deployment artifacts - name: Clean remaining Artifacts diff --git a/api/.pipeline/config.js b/api/.pipeline/config.js index 842b95e5c9..5e137b476f 100644 --- a/api/.pipeline/config.js +++ b/api/.pipeline/config.js @@ -45,7 +45,10 @@ const tag = * ref: '', * branch_ref: '' * }, - * pr: '', + * env: 'pr' | 'dev' | 'test' | 'prod', + * phase: 'build' | 'deploy', + * pr?: '', + * branch?: '', * config: {}, // JSON config map * type?: 'static' * }} @@ -96,7 +99,7 @@ const phases = { dbName: pipelineConfigMap.module.db, changeId: changeId, suffix: `-dev-${changeId}`, - instance: `${pipelineConfigMap.module.api}-dev-${changeId}`, + instance: `${pipelineConfigMap.module.api}-pr-${changeId}`, version: `${changeId}-${changeId}`, tag: `dev-${pipelineConfigMap.version}-${changeId}`, host: `${pipelineConfigMap.module.api}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, diff --git a/app/.pipeline/config.js b/app/.pipeline/config.js index 7fadd4e386..fe2e9d24bb 100644 --- a/app/.pipeline/config.js +++ b/app/.pipeline/config.js @@ -18,7 +18,6 @@ const pipelineConfigMap = PipelineConfigMapSchema.parse(JSON.parse(rawPipelineCo // See `--type=static` in the `deployStatic.yml` git workflow const isStaticDeployment = rawOptions.type === 'static'; -// const deployChangeId = (isStaticDeployment && 'deploy') || changeId; const branch = (isStaticDeployment && rawOptions.branch) || null; const tag = @@ -46,7 +45,10 @@ const tag = * ref: '', * branch_ref: '' * }, - * pr: '', + * env: 'pr' | 'dev' | 'test' | 'prod', + * phase: 'build' | 'deploy', + * pr?: '', + * branch?: '', * config: {}, // JSON config map * type?: 'static' * }} @@ -95,7 +97,7 @@ const phases = { // phase: 'dev', changeId: changeId, suffix: `-dev-${changeId}`, - instance: `${pipelineConfigMap.module.app}-dev-${changeId}`, + instance: `${pipelineConfigMap.module.app}-pr-${changeId}`, version: `${changeId}-${changeId}`, tag: `dev-${pipelineConfigMap.version}-${changeId}`, host: `${pipelineConfigMap.module.app}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, diff --git a/database/.pipeline/config.js b/database/.pipeline/config.js index 944cb82cbb..bbfacf74d2 100644 --- a/database/.pipeline/config.js +++ b/database/.pipeline/config.js @@ -18,8 +18,6 @@ const pipelineConfigMap = PipelineConfigMapSchema.parse(JSON.parse(rawPipelineCo // See `--type=static` in the `deployStatic.yml` git workflow const isStaticDeployment = rawOptions.type === 'static'; -const deployChangeId = (isStaticDeployment && 'deploy') || changeId; - const branch = (isStaticDeployment && rawOptions.branch) || null; const tag = @@ -47,9 +45,10 @@ const tag = * ref: '', * branch_ref: '' * }, + * env: 'pr' | 'dev' | 'test' | 'prod', + * phase: 'build' | 'deploy', * pr?: '', - * branch?: '', - * static?: '', + * branch?: '', * config: {}, // JSON config map * type?: 'static' * }} @@ -96,11 +95,11 @@ const phases = { // phase: 'dev', namespace: 'af2668-dev', name: pipelineConfigMap.module.db, - changeId: deployChangeId, - suffix: `-dev-${deployChangeId}`, - instance: `${pipelineConfigMap.module.db}-dev-${deployChangeId}`, - version: `${deployChangeId}-${changeId}`, - tag: `dev-${pipelineConfigMap.version}-${deployChangeId}` + changeId: changeId, + suffix: `-dev-${changeId}`, + instance: `${pipelineConfigMap.module.db}-pr-${changeId}`, + version: `${changeId}-${changeId}`, + tag: `dev-${pipelineConfigMap.version}-${changeId}` } }, dev: { @@ -120,11 +119,11 @@ const phases = { // phase: 'dev', namespace: 'af2668-dev', name: pipelineConfigMap.module.db, - changeId: deployChangeId, - suffix: `-dev-${deployChangeId}`, - instance: `${pipelineConfigMap.module.db}-dev-${deployChangeId}`, - version: `${deployChangeId}-${changeId}`, - tag: `dev-${pipelineConfigMap.version}-${deployChangeId}` + changeId: 'deploy', + suffix: `-dev-deploy`, + instance: `${pipelineConfigMap.module.db}-dev-deploy`, + version: `deploy-${changeId}`, + tag: `dev-${pipelineConfigMap.version}-deploy` } }, test: { @@ -144,7 +143,7 @@ const phases = { // phase: 'test', namespace: 'af2668-test', name: pipelineConfigMap.module.db, - changeId: deployChangeId, + changeId: 'deploy', suffix: `-test`, instance: `${pipelineConfigMap.module.db}-test`, version: pipelineConfigMap.version, @@ -168,7 +167,7 @@ const phases = { // phase: 'prod', namespace: 'af2668-prod', name: pipelineConfigMap.module.db, - changeId: deployChangeId, + changeId: 'deploy', suffix: `-prod`, instance: `${pipelineConfigMap.module.db}-prod`, version: pipelineConfigMap.version, From 440424cc39600d6bc6ccc0db7bb8dea771ac7c67 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Sat, 27 Jan 2024 15:40:27 -0800 Subject: [PATCH 23/62] Tweaks --- .pipeline/README.md | 17 ----------------- .pipeline/configMaps/README.md | 17 +++++++++++++++++ database/.pipeline/lib/db.setup.deploy.js | 2 +- 3 files changed, 18 insertions(+), 18 deletions(-) delete mode 100644 .pipeline/README.md create mode 100644 .pipeline/configMaps/README.md diff --git a/.pipeline/README.md b/.pipeline/README.md deleted file mode 100644 index a7364ccb5f..0000000000 --- a/.pipeline/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# Openshift Config Map - -`sims-pipeline-config.json` is a sample of the config map that should be created in each openshift environment. - -It is not guaranteed to contain the correct values. - -The config map is validated at build time against the `PipelineConfigMapSchema` zod schema, which should always be kept up to date. See `configMapSchema.js` in each of the api, app, and database `/.pipeline` folders. - -**Note: This config map should never contain secrets, passwords, or other sensitive values. Those should always be stored in Openshift secrets.** - -## Create Config Map in Openshift - -Under `Workloads` -> `ConfigMaps` - -- **name:** `sims-pipeline-config` - - **key:** `config` - - **value:** A JSON object containing the config map settings. diff --git a/.pipeline/configMaps/README.md b/.pipeline/configMaps/README.md new file mode 100644 index 0000000000..bc0c9301df --- /dev/null +++ b/.pipeline/configMaps/README.md @@ -0,0 +1,17 @@ +# Openshift Config Map + +`sims-pipeline-config.json` is a sample of the config map that should be created in each openshift environment. + +`sims.configmap.yaml` is a fully defined config map yaml which can be imported into OpenShift when first creating the config map. Edits can be made against the existing config map in OpenShift, but should also be captured here for future use and backup. + +The config map is validated at build and deployment time against the `PipelineConfigMapSchema` zod schema, which should always be kept up to date. See `configMapSchema.js` in each of the api, app, and database `/.pipeline` folders. + +**Note: Config maps should never contain secrets, passwords, or other sensitive values. They are not protected in OpenShift and their values may appear in logs, etc. Sensitive data should always be stored in Openshift secrets.** + +## Create Config Map in Openshift + +Under `Workloads` -> `ConfigMaps` + +- **name:** `sims-pipeline-config` + - **key:** `config` + - **value:** A JSON object containing the config map settings. diff --git a/database/.pipeline/lib/db.setup.deploy.js b/database/.pipeline/lib/db.setup.deploy.js index 1b6e92bfa6..a78f0cb38c 100644 --- a/database/.pipeline/lib/db.setup.deploy.js +++ b/database/.pipeline/lib/db.setup.deploy.js @@ -45,7 +45,7 @@ const dbSetupDeploy = async (settings) => { }) ); - oc.applyRecommendedLabels(imageStreamObjects, isName, env, `${changeId}`, instance); + oc.applyRecommendedLabels(imageStreamObjects, isName, env, changeId, instance); oc.importImageStreams(imageStreamObjects, isVersion, phases[env].build.namespace, phases[env].build.tag); // Get database setup image stream From b0fd43c50571fa4d7e0f57469abf036fa49295b3 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Mon, 5 Feb 2024 09:38:44 -0800 Subject: [PATCH 24/62] Minor tweaks, cleanup. ignore-skip --- .../configMaps/PipelineConfigMapSchema.js | 156 +++++--- .pipeline/configMaps/README.md | 2 +- .pipeline/configMaps/sims-configmap.json | 36 +- .pipeline/configMaps/sims.configmap.yaml | 36 +- api/.pipeline/config.js | 22 +- app/.pipeline/config.js | 22 +- app/.pipeline/utils/configMapSchema.js | 373 ------------------ database/.pipeline/config.js | 20 +- database/.pipeline/utils/configMapSchema.js | 373 ------------------ 9 files changed, 162 insertions(+), 878 deletions(-) rename api/.pipeline/utils/configMapSchema.js => .pipeline/configMaps/PipelineConfigMapSchema.js (77%) delete mode 100644 app/.pipeline/utils/configMapSchema.js delete mode 100644 database/.pipeline/utils/configMapSchema.js diff --git a/api/.pipeline/utils/configMapSchema.js b/.pipeline/configMaps/PipelineConfigMapSchema.js similarity index 77% rename from api/.pipeline/utils/configMapSchema.js rename to .pipeline/configMaps/PipelineConfigMapSchema.js index df0edf24e3..c3d608005d 100644 --- a/api/.pipeline/utils/configMapSchema.js +++ b/.pipeline/configMaps/PipelineConfigMapSchema.js @@ -1,30 +1,25 @@ -const z = require('zod'); +const z = require("zod"); const PipelineConfigMapSchema = z.object({ name: z.string(), - namespaceSuffix: z.string(), - namespace: z.object({ - tools: z.string(), - dev: z.string(), - test: z.string(), - prod: z.string() - }), version: z.string(), module: z.object({ db: z.string(), api: z.string(), - app: z.string() + app: z.string(), }), api: z.object({ pr: z.object({ build: z.object({ + namespace: z.string(), tz: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), memoryRequest: z.string(), - memoryLimit: z.string() + memoryLimit: z.string(), }), deploy: z.object({ + namespace: z.string(), nodeEnv: z.string(), tz: z.string(), backboneApiHost: z.string(), @@ -42,18 +37,20 @@ const PipelineConfigMapSchema = z.object({ memoryRequest: z.string(), memoryLimit: z.string(), replicas: z.string(), - replicasMax: z.string() - }) + replicasMax: z.string(), + }), }), dev: z.object({ build: z.object({ + namespace: z.string(), tz: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), memoryRequest: z.string(), - memoryLimit: z.string() + memoryLimit: z.string(), }), deploy: z.object({ + namespace: z.string(), nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), @@ -73,18 +70,20 @@ const PipelineConfigMapSchema = z.object({ memoryRequest: z.string(), memoryLimit: z.string(), replicas: z.string(), - replicasMax: z.string() - }) + replicasMax: z.string(), + }), }), test: z.object({ build: z.object({ + namespace: z.string(), tz: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), memoryRequest: z.string(), - memoryLimit: z.string() + memoryLimit: z.string(), }), deploy: z.object({ + namespace: z.string(), nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), @@ -104,18 +103,20 @@ const PipelineConfigMapSchema = z.object({ memoryRequest: z.string(), memoryLimit: z.string(), replicas: z.string(), - replicasMax: z.string() - }) + replicasMax: z.string(), + }), }), prod: z.object({ build: z.object({ + namespace: z.string(), tz: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), memoryRequest: z.string(), - memoryLimit: z.string() + memoryLimit: z.string(), }), deploy: z.object({ + namespace: z.string(), nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), @@ -136,19 +137,21 @@ const PipelineConfigMapSchema = z.object({ memoryRequest: z.string(), memoryLimit: z.string(), replicas: z.string(), - replicasMax: z.string() - }) - }) + replicasMax: z.string(), + }), + }), }), app: z.object({ pr: z.object({ build: z.object({ + namespace: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), memoryRequest: z.string(), - memoryLimit: z.string() + memoryLimit: z.string(), }), deploy: z.object({ + namespace: z.string(), nodeEnv: z.string(), siteminderLogoutURL: z.string(), maxUploadNumFiles: z.number(), @@ -159,17 +162,19 @@ const PipelineConfigMapSchema = z.object({ memoryRequest: z.string(), memoryLimit: z.string(), replicas: z.string(), - replicasMax: z.string() - }) + replicasMax: z.string(), + }), }), dev: z.object({ build: z.object({ + namespace: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), memoryRequest: z.string(), - memoryLimit: z.string() + memoryLimit: z.string(), }), deploy: z.object({ + namespace: z.string(), nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), @@ -182,17 +187,19 @@ const PipelineConfigMapSchema = z.object({ memoryRequest: z.string(), memoryLimit: z.string(), replicas: z.string(), - replicasMax: z.string() - }) + replicasMax: z.string(), + }), }), test: z.object({ build: z.object({ + namespace: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), memoryRequest: z.string(), - memoryLimit: z.string() + memoryLimit: z.string(), }), deploy: z.object({ + namespace: z.string(), nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), @@ -205,17 +212,19 @@ const PipelineConfigMapSchema = z.object({ memoryRequest: z.string(), memoryLimit: z.string(), replicas: z.string(), - replicasMax: z.string() - }) + replicasMax: z.string(), + }), }), prod: z.object({ build: z.object({ + namespace: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), memoryRequest: z.string(), - memoryLimit: z.string() + memoryLimit: z.string(), }), deploy: z.object({ + namespace: z.string(), nodeEnv: z.string(), staticApiUrl: z.string(), staticAppUrl: z.string(), @@ -229,21 +238,24 @@ const PipelineConfigMapSchema = z.object({ memoryRequest: z.string(), memoryLimit: z.string(), replicas: z.string(), - replicasMax: z.string() - }) - }) + replicasMax: z.string(), + }), + }), }), database: z.object({ pr: z.object({ build: z.object({ + namespace: z.string(), tz: z.string(), + sourceContextDir: z.string(), dbSetupDockerfilePath: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), memoryRequest: z.string(), - memoryLimit: z.string() + memoryLimit: z.string(), }), deploy: z.object({ + namespace: z.string(), nodeEnv: z.string(), tz: z.string(), volumeCapacity: z.string(), @@ -251,19 +263,22 @@ const PipelineConfigMapSchema = z.object({ cpuLimit: z.string(), memoryRequest: z.string(), memoryLimit: z.string(), - replicas: z.string() - }) + replicas: z.string(), + }), }), dev: z.object({ build: z.object({ + namespace: z.string(), tz: z.string(), + sourceContextDir: z.string(), dbSetupDockerfilePath: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), memoryRequest: z.string(), - memoryLimit: z.string() + memoryLimit: z.string(), }), deploy: z.object({ + namespace: z.string(), nodeEnv: z.string(), tz: z.string(), volumeCapacity: z.string(), @@ -271,19 +286,22 @@ const PipelineConfigMapSchema = z.object({ cpuLimit: z.string(), memoryRequest: z.string(), memoryLimit: z.string(), - replicas: z.string() - }) + replicas: z.string(), + }), }), test: z.object({ build: z.object({ + namespace: z.string(), tz: z.string(), + sourceContextDir: z.string(), dbSetupDockerfilePath: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), memoryRequest: z.string(), - memoryLimit: z.string() + memoryLimit: z.string(), }), deploy: z.object({ + namespace: z.string(), nodeEnv: z.string(), tz: z.string(), volumeCapacity: z.string(), @@ -291,19 +309,22 @@ const PipelineConfigMapSchema = z.object({ cpuLimit: z.string(), memoryRequest: z.string(), memoryLimit: z.string(), - replicas: z.string() - }) + replicas: z.string(), + }), }), prod: z.object({ build: z.object({ + namespace: z.string(), tz: z.string(), + sourceContextDir: z.string(), dbSetupDockerfilePath: z.string(), cpuRequest: z.string(), cpuLimit: z.string(), memoryRequest: z.string(), - memoryLimit: z.string() + memoryLimit: z.string(), }), deploy: z.object({ + namespace: z.string(), nodeEnv: z.string(), tz: z.string(), volumeCapacity: z.string(), @@ -311,11 +332,28 @@ const PipelineConfigMapSchema = z.object({ cpuLimit: z.string(), memoryRequest: z.string(), memoryLimit: z.string(), - replicas: z.string() - }) - }) + replicas: z.string(), + }), + }), }), sso: z.object({ + pr: z.object({ + host: z.string(), + realm: z.string(), + clientId: z.string(), + keycloakSecret: z.string(), + serviceClient: z.object({ + serviceClientName: z.string(), + keycloakSecretServiceClientPasswordKey: z.string(), + }), + cssApi: z.object({ + cssApiTokenUrl: z.string(), + cssApiClientId: z.string(), + cssApiHost: z.string(), + keycloakSecretCssApiSecretKey: z.string(), + cssApiEnvironment: z.string(), + }), + }), dev: z.object({ host: z.string(), realm: z.string(), @@ -323,15 +361,15 @@ const PipelineConfigMapSchema = z.object({ keycloakSecret: z.string(), serviceClient: z.object({ serviceClientName: z.string(), - keycloakSecretServiceClientPasswordKey: z.string() + keycloakSecretServiceClientPasswordKey: z.string(), }), cssApi: z.object({ cssApiTokenUrl: z.string(), cssApiClientId: z.string(), cssApiHost: z.string(), keycloakSecretCssApiSecretKey: z.string(), - cssApiEnvironment: z.string() - }) + cssApiEnvironment: z.string(), + }), }), test: z.object({ host: z.string(), @@ -340,15 +378,15 @@ const PipelineConfigMapSchema = z.object({ keycloakSecret: z.string(), serviceClient: z.object({ serviceClientName: z.string(), - keycloakSecretServiceClientPasswordKey: z.string() + keycloakSecretServiceClientPasswordKey: z.string(), }), cssApi: z.object({ cssApiTokenUrl: z.string(), cssApiClientId: z.string(), cssApiHost: z.string(), keycloakSecretCssApiSecretKey: z.string(), - cssApiEnvironment: z.string() - }) + cssApiEnvironment: z.string(), + }), }), prod: z.object({ host: z.string(), @@ -357,17 +395,17 @@ const PipelineConfigMapSchema = z.object({ keycloakSecret: z.string(), serviceClient: z.object({ serviceClientName: z.string(), - keycloakSecretServiceClientPasswordKey: z.string() + keycloakSecretServiceClientPasswordKey: z.string(), }), cssApi: z.object({ cssApiTokenUrl: z.string(), cssApiClientId: z.string(), cssApiHost: z.string(), keycloakSecretCssApiSecretKey: z.string(), - cssApiEnvironment: z.string() - }) - }) - }) + cssApiEnvironment: z.string(), + }), + }), + }), }); module.exports = exports = { PipelineConfigMapSchema }; diff --git a/.pipeline/configMaps/README.md b/.pipeline/configMaps/README.md index bc0c9301df..ace5d35099 100644 --- a/.pipeline/configMaps/README.md +++ b/.pipeline/configMaps/README.md @@ -4,7 +4,7 @@ `sims.configmap.yaml` is a fully defined config map yaml which can be imported into OpenShift when first creating the config map. Edits can be made against the existing config map in OpenShift, but should also be captured here for future use and backup. -The config map is validated at build and deployment time against the `PipelineConfigMapSchema` zod schema, which should always be kept up to date. See `configMapSchema.js` in each of the api, app, and database `/.pipeline` folders. +The config map is validated at build and deployment time against the `PipelineConfigMapSchema` zod schema, which should always be kept up to date. See `configMapSchema.js`. **Note: Config maps should never contain secrets, passwords, or other sensitive values. They are not protected in OpenShift and their values may appear in logs, etc. Sensitive data should always be stored in Openshift secrets.** diff --git a/.pipeline/configMaps/sims-configmap.json b/.pipeline/configMaps/sims-configmap.json index 2498254d62..2f7c804fce 100644 --- a/.pipeline/configMaps/sims-configmap.json +++ b/.pipeline/configMaps/sims-configmap.json @@ -1,12 +1,5 @@ { "name": "sims", - "namespaceSuffix": "af2668", - "namespace": { - "tools": "tools", - "dev": "dev", - "test": "test", - "prod": "prod" - }, "version": "1.0.0", "module": { "db": "sims-db", @@ -16,6 +9,7 @@ "api": { "pr": { "build": { + "namespace": "af2668-tools", "tz": "America/Vancouver", "cpuRequest": "50m", "cpuLimit": "1000m", @@ -23,9 +17,8 @@ "memoryLimit": "3Gi" }, "deploy": { + "namespace": "af2668-dev", "nodeEnv": "development", - "staticApiUrl": "api-dev-sims.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "dev-sims.apps.silver.devops.gov.bc.ca", "tz": "America/Vancouver", "backboneApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", "backboneIntakePath": "/api/dwc/submission/queue", @@ -47,6 +40,7 @@ }, "dev": { "build": { + "namespace": "af2668-tools", "tz": "America/Vancouver", "cpuRequest": "50m", "cpuLimit": "1000m", @@ -54,6 +48,7 @@ "memoryLimit": "3Gi" }, "deploy": { + "namespace": "af2668-dev", "nodeEnv": "development", "staticApiUrl": "api-dev-sims.apps.silver.devops.gov.bc.ca", "staticAppUrl": "dev-sims.apps.silver.devops.gov.bc.ca", @@ -78,6 +73,7 @@ }, "test": { "build": { + "namespace": "af2668-tools", "tz": "America/Vancouver", "cpuRequest": "50m", "cpuLimit": "1000m", @@ -85,6 +81,7 @@ "memoryLimit": "3Gi" }, "deploy": { + "namespace": "af2668-test", "nodeEnv": "production", "staticApiUrl": "api-test-sims.apps.silver.devops.gov.bc.ca", "staticAppUrl": "test-sims.apps.silver.devops.gov.bc.ca", @@ -109,6 +106,7 @@ }, "prod": { "build": { + "namespace": "af2668-tools", "tz": "America/Vancouver", "cpuRequest": "50m", "cpuLimit": "1000m", @@ -116,6 +114,7 @@ "memoryLimit": "3Gi" }, "deploy": { + "namespace": "af2668-prod", "nodeEnv": "production", "staticApiUrl": "api-sims.apps.silver.devops.gov.bc.ca", "staticAppUrl": "sims.apps.silver.devops.gov.bc.ca", @@ -143,12 +142,14 @@ "app": { "pr": { "build": { + "namespace": "af2668-tools", "cpuRequest": "50m", "cpuLimit": "1000m", "memoryRequest": "100Mi", "memoryLimit": "5Gi" }, "deploy": { + "namespace": "af2668-dev", "nodeEnv": "development", "siteminderLogoutURL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", "maxUploadNumFiles": 10, @@ -164,12 +165,14 @@ }, "dev": { "build": { + "namespace": "af2668-tools", "cpuRequest": "50m", "cpuLimit": "1000m", "memoryRequest": "100Mi", "memoryLimit": "5Gi" }, "deploy": { + "namespace": "af2668-dev", "nodeEnv": "development", "staticApiUrl": "api-dev-sims.apps.silver.devops.gov.bc.ca", "staticAppUrl": "dev-sims.apps.silver.devops.gov.bc.ca", @@ -187,12 +190,14 @@ }, "test": { "build": { + "namespace": "af2668-tools", "cpuRequest": "50m", "cpuLimit": "1000m", "memoryRequest": "100Mi", "memoryLimit": "5Gi" }, "deploy": { + "namespace": "af2668-test", "nodeEnv": "production", "staticApiUrl": "api-test-sims.apps.silver.devops.gov.bc.ca", "staticAppUrl": "test-sims.apps.silver.devops.gov.bc.ca", @@ -210,12 +215,14 @@ }, "prod": { "build": { + "namespace": "af2668-tools", "cpuRequest": "50m", "cpuLimit": "1000m", "memoryRequest": "100Mi", "memoryLimit": "5Gi" }, "deploy": { + "namespace": "af2668-prod", "nodeEnv": "production", "staticApiUrl": "api-sims.apps.silver.devops.gov.bc.ca", "staticAppUrl": "sims.apps.silver.devops.gov.bc.ca", @@ -236,6 +243,7 @@ "database": { "pr": { "build": { + "namespace": "af2668-tools", "tz": "America/Vancouver", "sourceContextDir": "database", "dbSetupDockerfilePath": "./.docker/db/Dockerfile.setup", @@ -245,6 +253,7 @@ "memoryLimit": "1.5Gi" }, "deploy": { + "namespace": "af2668-dev", "nodeEnv": "development", "tz": "America/Vancouver", "volumeCapacity": "500Mi", @@ -257,6 +266,7 @@ }, "dev": { "build": { + "namespace": "af2668-tools", "tz": "America/Vancouver", "sourceContextDir": "database", "dbSetupDockerfilePath": "./.docker/db/Dockerfile.setup", @@ -266,6 +276,7 @@ "memoryLimit": "1.5Gi" }, "deploy": { + "namespace": "af2668-dev", "nodeEnv": "development", "tz": "America/Vancouver", "volumeCapacity": "3Gi", @@ -278,6 +289,7 @@ }, "test": { "build": { + "namespace": "af2668-tools", "tz": "America/Vancouver", "sourceContextDir": "database", "dbSetupDockerfilePath": "./.docker/db/Dockerfile.migrate", @@ -287,6 +299,7 @@ "memoryLimit": "1.5Gi" }, "deploy": { + "namespace": "af2668-test", "nodeEnv": "production", "tz": "America/Vancouver", "volumeCapacity": "3Gi", @@ -299,6 +312,7 @@ }, "prod": { "build": { + "namespace": "af2668-tools", "tz": "America/Vancouver", "sourceContextDir": "database", "dbSetupDockerfilePath": "./.docker/db/Dockerfile.migrate", @@ -308,6 +322,7 @@ "memoryLimit": "1.5Gi" }, "deploy": { + "namespace": "af2668-prod", "nodeEnv": "production", "tz": "America/Vancouver", "volumeCapacity": "5Gi", @@ -317,8 +332,7 @@ "memoryLimit": "3Gi", "replicas": "1" } - }, - "deploy": {} + } }, "sso": { "pr": { diff --git a/.pipeline/configMaps/sims.configmap.yaml b/.pipeline/configMaps/sims.configmap.yaml index 1747f3f037..13647c94fe 100644 --- a/.pipeline/configMaps/sims.configmap.yaml +++ b/.pipeline/configMaps/sims.configmap.yaml @@ -8,13 +8,6 @@ data: config: | { "name": "sims", - "namespaceSuffix": "af2668", - "namespace": { - "tools": "tools", - "dev": "dev", - "test": "test", - "prod": "prod" - }, "version": "1.0.0", "module": { "db": "sims-db", @@ -24,6 +17,7 @@ data: "api": { "pr": { "build": { + "namespace": "af2668-tools", "tz": "America/Vancouver", "cpuRequest": "50m", "cpuLimit": "1000m", @@ -31,9 +25,8 @@ data: "memoryLimit": "3Gi" }, "deploy": { + "namespace": "af2668-dev", "nodeEnv": "development", - "staticApiUrl": "api-dev-sims.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "dev-sims.apps.silver.devops.gov.bc.ca", "tz": "America/Vancouver", "backboneApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", "backboneIntakePath": "/api/dwc/submission/queue", @@ -55,6 +48,7 @@ data: }, "dev": { "build": { + "namespace": "af2668-tools", "tz": "America/Vancouver", "cpuRequest": "50m", "cpuLimit": "1000m", @@ -62,6 +56,7 @@ data: "memoryLimit": "3Gi" }, "deploy": { + "namespace": "af2668-dev", "nodeEnv": "development", "staticApiUrl": "api-dev-sims.apps.silver.devops.gov.bc.ca", "staticAppUrl": "dev-sims.apps.silver.devops.gov.bc.ca", @@ -86,6 +81,7 @@ data: }, "test": { "build": { + "namespace": "af2668-tools", "tz": "America/Vancouver", "cpuRequest": "50m", "cpuLimit": "1000m", @@ -93,6 +89,7 @@ data: "memoryLimit": "3Gi" }, "deploy": { + "namespace": "af2668-test", "nodeEnv": "production", "staticApiUrl": "api-test-sims.apps.silver.devops.gov.bc.ca", "staticAppUrl": "test-sims.apps.silver.devops.gov.bc.ca", @@ -117,6 +114,7 @@ data: }, "prod": { "build": { + "namespace": "af2668-tools", "tz": "America/Vancouver", "cpuRequest": "50m", "cpuLimit": "1000m", @@ -124,6 +122,7 @@ data: "memoryLimit": "3Gi" }, "deploy": { + "namespace": "af2668-prod", "nodeEnv": "production", "staticApiUrl": "api-sims.apps.silver.devops.gov.bc.ca", "staticAppUrl": "sims.apps.silver.devops.gov.bc.ca", @@ -151,12 +150,14 @@ data: "app": { "pr": { "build": { + "namespace": "af2668-tools", "cpuRequest": "50m", "cpuLimit": "1000m", "memoryRequest": "100Mi", "memoryLimit": "5Gi" }, "deploy": { + "namespace": "af2668-dev", "nodeEnv": "development", "siteminderLogoutURL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", "maxUploadNumFiles": 10, @@ -172,12 +173,14 @@ data: }, "dev": { "build": { + "namespace": "af2668-tools", "cpuRequest": "50m", "cpuLimit": "1000m", "memoryRequest": "100Mi", "memoryLimit": "5Gi" }, "deploy": { + "namespace": "af2668-dev", "nodeEnv": "development", "staticApiUrl": "api-dev-sims.apps.silver.devops.gov.bc.ca", "staticAppUrl": "dev-sims.apps.silver.devops.gov.bc.ca", @@ -195,12 +198,14 @@ data: }, "test": { "build": { + "namespace": "af2668-tools", "cpuRequest": "50m", "cpuLimit": "1000m", "memoryRequest": "100Mi", "memoryLimit": "5Gi" }, "deploy": { + "namespace": "af2668-test", "nodeEnv": "production", "staticApiUrl": "api-test-sims.apps.silver.devops.gov.bc.ca", "staticAppUrl": "test-sims.apps.silver.devops.gov.bc.ca", @@ -218,12 +223,14 @@ data: }, "prod": { "build": { + "namespace": "af2668-tools", "cpuRequest": "50m", "cpuLimit": "1000m", "memoryRequest": "100Mi", "memoryLimit": "5Gi" }, "deploy": { + "namespace": "af2668-prod", "nodeEnv": "production", "staticApiUrl": "api-sims.apps.silver.devops.gov.bc.ca", "staticAppUrl": "sims.apps.silver.devops.gov.bc.ca", @@ -244,6 +251,7 @@ data: "database": { "pr": { "build": { + "namespace": "af2668-tools", "tz": "America/Vancouver", "sourceContextDir": "database", "dbSetupDockerfilePath": "./.docker/db/Dockerfile.setup", @@ -253,6 +261,7 @@ data: "memoryLimit": "1.5Gi" }, "deploy": { + "namespace": "af2668-dev", "nodeEnv": "development", "tz": "America/Vancouver", "volumeCapacity": "500Mi", @@ -265,6 +274,7 @@ data: }, "dev": { "build": { + "namespace": "af2668-tools", "tz": "America/Vancouver", "sourceContextDir": "database", "dbSetupDockerfilePath": "./.docker/db/Dockerfile.setup", @@ -274,6 +284,7 @@ data: "memoryLimit": "1.5Gi" }, "deploy": { + "namespace": "af2668-dev", "nodeEnv": "development", "tz": "America/Vancouver", "volumeCapacity": "3Gi", @@ -286,6 +297,7 @@ data: }, "test": { "build": { + "namespace": "af2668-tools", "tz": "America/Vancouver", "sourceContextDir": "database", "dbSetupDockerfilePath": "./.docker/db/Dockerfile.migrate", @@ -295,6 +307,7 @@ data: "memoryLimit": "1.5Gi" }, "deploy": { + "namespace": "af2668-test", "nodeEnv": "production", "tz": "America/Vancouver", "volumeCapacity": "3Gi", @@ -307,6 +320,7 @@ data: }, "prod": { "build": { + "namespace": "af2668-tools", "tz": "America/Vancouver", "sourceContextDir": "database", "dbSetupDockerfilePath": "./.docker/db/Dockerfile.migrate", @@ -316,6 +330,7 @@ data: "memoryLimit": "1.5Gi" }, "deploy": { + "namespace": "af2668-prod", "nodeEnv": "production", "tz": "America/Vancouver", "volumeCapacity": "5Gi", @@ -325,8 +340,7 @@ data: "memoryLimit": "3Gi", "replicas": "1" } - }, - "deploy": {} + } }, "sso": { "pr": { diff --git a/api/.pipeline/config.js b/api/.pipeline/config.js index 5e137b476f..ef214780ad 100644 --- a/api/.pipeline/config.js +++ b/api/.pipeline/config.js @@ -1,7 +1,7 @@ 'use strict'; -const { PipelineConfigMapSchema } = require('./utils/configMapSchema'); const PipelineCli = require('pipeline-cli'); +const { PipelineConfigMapSchema } = require('../../.pipeline/configMaps/PipelineConfigMapSchema'); // Options passed in from the git action const rawOptions = PipelineCli.Util.parseArguments(); @@ -80,8 +80,7 @@ const options = processOptions(rawOptions); const phases = { pr: { build: { - ...pipelineConfigMap.api.pr.build, - namespace: 'af2668-tools', + ...PipelineConfigMapSchema.api.pr.build, name: pipelineConfigMap.module.api, dbName: pipelineConfigMap.module.db, changeId: changeId, @@ -93,25 +92,22 @@ const phases = { }, deploy: { ...pipelineConfigMap.api.pr.deploy, - // phase: 'pr', - namespace: 'af2668-dev', name: pipelineConfigMap.module.api, dbName: pipelineConfigMap.module.db, changeId: changeId, suffix: `-dev-${changeId}`, instance: `${pipelineConfigMap.module.api}-pr-${changeId}`, - version: `${changeId}-${changeId}`, + version: `pr-${changeId}`, tag: `dev-${pipelineConfigMap.version}-${changeId}`, host: `${pipelineConfigMap.module.api}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, appHost: `${pipelineConfigMap.module.app}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, - sso: pipelineConfigMap.sso.dev, - s3KeyPrefix: `local/${changeId}/sims` + sso: pipelineConfigMap.sso.pr, + s3KeyPrefix: `local/${changeId}/${pipelineConfigMap.name}` } }, dev: { build: { ...pipelineConfigMap.api.dev.build, - namespace: 'af2668-tools', name: pipelineConfigMap.module.api, dbName: pipelineConfigMap.module.db, changeId: changeId, @@ -123,8 +119,6 @@ const phases = { }, deploy: { ...pipelineConfigMap.api.dev.deploy, - // phase: 'dev', - namespace: 'af2668-dev', name: pipelineConfigMap.module.api, dbName: pipelineConfigMap.module.db, changeId: 'deploy', @@ -140,7 +134,6 @@ const phases = { test: { build: { ...pipelineConfigMap.api.test.build, - namespace: 'af2668-tools', name: pipelineConfigMap.module.api, dbName: pipelineConfigMap.module.db, changeId: changeId, @@ -152,8 +145,6 @@ const phases = { }, deploy: { ...pipelineConfigMap.api.test.deploy, - // phase: 'test', - namespace: 'af2668-test', name: pipelineConfigMap.module.api, dbName: pipelineConfigMap.module.db, changeId: 'deploy', @@ -169,7 +160,6 @@ const phases = { prod: { build: { ...pipelineConfigMap.api.prod.build, - namespace: 'af2668-tools', name: pipelineConfigMap.module.api, dbName: pipelineConfigMap.module.db, @@ -182,8 +172,6 @@ const phases = { }, deploy: { ...pipelineConfigMap.api.prod.deploy, - // phase: 'prod', - namespace: 'af2668-prod', name: pipelineConfigMap.module.api, dbName: pipelineConfigMap.module.db, changeId: 'deploy', diff --git a/app/.pipeline/config.js b/app/.pipeline/config.js index fe2e9d24bb..bdc04d8b98 100644 --- a/app/.pipeline/config.js +++ b/app/.pipeline/config.js @@ -1,7 +1,7 @@ 'use strict'; -const { PipelineConfigMapSchema } = require('./utils/configMapSchema'); const PipelineCli = require('pipeline-cli'); +const { PipelineConfigMapSchema } = require('../../.pipeline/configMaps/PipelineConfigMapSchema'); // Options passed in from the git action const rawOptions = PipelineCli.Util.parseArguments(); @@ -81,7 +81,6 @@ const phases = { pr: { build: { ...pipelineConfigMap.app.pr.build, - namespace: 'af2668-tools', name: pipelineConfigMap.module.app, changeId: changeId, suffix: `-build-${changeId}`, @@ -92,23 +91,20 @@ const phases = { }, deploy: { ...pipelineConfigMap.app.pr.deploy, - namespace: 'af2668-dev', name: pipelineConfigMap.module.app, - // phase: 'dev', changeId: changeId, suffix: `-dev-${changeId}`, instance: `${pipelineConfigMap.module.app}-pr-${changeId}`, - version: `${changeId}-${changeId}`, + version: `pr-${changeId}`, tag: `dev-${pipelineConfigMap.version}-${changeId}`, host: `${pipelineConfigMap.module.app}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, apiHost: `${pipelineConfigMap.module.api}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, - sso: pipelineConfigMap.sso.dev + sso: pipelineConfigMap.sso.pr } }, dev: { build: { ...pipelineConfigMap.app.dev.build, - namespace: 'af2668-tools', name: pipelineConfigMap.module.app, changeId: changeId, suffix: `-build-${changeId}`, @@ -119,9 +115,7 @@ const phases = { }, deploy: { ...pipelineConfigMap.app.dev.deploy, - namespace: 'af2668-dev', name: pipelineConfigMap.module.app, - // phase: 'dev', changeId: 'deploy', suffix: '-dev-deploy', instance: `${pipelineConfigMap.module.app}-dev-deploy`, @@ -135,7 +129,6 @@ const phases = { test: { build: { ...pipelineConfigMap.app.test.build, - namespace: 'af2668-tools', name: pipelineConfigMap.module.app, changeId: changeId, suffix: `-build-${changeId}`, @@ -146,13 +139,11 @@ const phases = { }, deploy: { ...pipelineConfigMap.app.test.deploy, - namespace: 'af2668-test', name: pipelineConfigMap.module.app, - // phase: 'test', changeId: 'deploy', suffix: `-test`, instance: `${pipelineConfigMap.module.app}-test`, - version: pipelineConfigMap.version, + version: `deploy-${changeId}`, tag: `test-${pipelineConfigMap.version}`, host: pipelineConfigMap.app.test.deploy.staticAppUrl, apiHost: pipelineConfigMap.app.test.deploy.staticApiUrl, @@ -162,7 +153,6 @@ const phases = { prod: { build: { ...pipelineConfigMap.app.prod.build, - namespace: 'af2668-tools', name: pipelineConfigMap.module.app, changeId: changeId, suffix: `-build-${changeId}`, @@ -173,13 +163,11 @@ const phases = { }, deploy: { ...pipelineConfigMap.app.prod.deploy, - namespace: 'af2668-prod', name: pipelineConfigMap.module.app, - // phase: 'prod', changeId: 'deploy', suffix: `-prod`, instance: `${pipelineConfigMap.module.app}-prod`, - version: pipelineConfigMap.version, + version: `deploy-${changeId}`, tag: `prod-${pipelineConfigMap.version}`, host: pipelineConfigMap.app.prod.deploy.staticAppUrl, apiHost: pipelineConfigMap.app.prod.deploy.staticApiUrl, diff --git a/app/.pipeline/utils/configMapSchema.js b/app/.pipeline/utils/configMapSchema.js deleted file mode 100644 index df0edf24e3..0000000000 --- a/app/.pipeline/utils/configMapSchema.js +++ /dev/null @@ -1,373 +0,0 @@ -const z = require('zod'); - -const PipelineConfigMapSchema = z.object({ - name: z.string(), - namespaceSuffix: z.string(), - namespace: z.object({ - tools: z.string(), - dev: z.string(), - test: z.string(), - prod: z.string() - }), - version: z.string(), - module: z.object({ - db: z.string(), - api: z.string(), - app: z.string() - }), - api: z.object({ - pr: z.object({ - build: z.object({ - tz: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string() - }), - deploy: z.object({ - nodeEnv: z.string(), - tz: z.string(), - backboneApiHost: z.string(), - backboneIntakePath: z.string(), - backboneArtifactIntakePath: z.string(), - backboneIntakeEnabled: z.boolean(), - bctwApiHost: z.string(), - critterbaseApiHost: z.string(), - elasticsearchURL: z.string(), - elasticsearchTaxonomyIndex: z.string(), - s3KeyPrefix: z.string(), - logLevel: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - replicasMax: z.string() - }) - }), - dev: z.object({ - build: z.object({ - tz: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string() - }), - deploy: z.object({ - nodeEnv: z.string(), - staticApiUrl: z.string(), - staticAppUrl: z.string(), - tz: z.string(), - backboneApiHost: z.string(), - backboneIntakePath: z.string(), - backboneArtifactIntakePath: z.string(), - backboneIntakeEnabled: z.boolean(), - bctwApiHost: z.string(), - critterbaseApiHost: z.string(), - elasticsearchURL: z.string(), - elasticsearchTaxonomyIndex: z.string(), - s3KeyPrefix: z.string(), - logLevel: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - replicasMax: z.string() - }) - }), - test: z.object({ - build: z.object({ - tz: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string() - }), - deploy: z.object({ - nodeEnv: z.string(), - staticApiUrl: z.string(), - staticAppUrl: z.string(), - tz: z.string(), - backboneApiHost: z.string(), - backboneIntakePath: z.string(), - backboneArtifactIntakePath: z.string(), - backboneIntakeEnabled: z.boolean(), - bctwApiHost: z.string(), - critterbaseApiHost: z.string(), - elasticsearchURL: z.string(), - elasticsearchTaxonomyIndex: z.string(), - s3KeyPrefix: z.string(), - logLevel: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - replicasMax: z.string() - }) - }), - prod: z.object({ - build: z.object({ - tz: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string() - }), - deploy: z.object({ - nodeEnv: z.string(), - staticApiUrl: z.string(), - staticAppUrl: z.string(), - staticAppVanityUrl: z.string(), - tz: z.string(), - backboneApiHost: z.string(), - backboneIntakePath: z.string(), - backboneArtifactIntakePath: z.string(), - backboneIntakeEnabled: z.boolean(), - bctwApiHost: z.string(), - critterbaseApiHost: z.string(), - elasticsearchURL: z.string(), - elasticsearchTaxonomyIndex: z.string(), - s3KeyPrefix: z.string(), - logLevel: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - replicasMax: z.string() - }) - }) - }), - app: z.object({ - pr: z.object({ - build: z.object({ - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string() - }), - deploy: z.object({ - nodeEnv: z.string(), - siteminderLogoutURL: z.string(), - maxUploadNumFiles: z.number(), - maxUploadFileSize: z.number(), - biohubFeatureFlag: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - replicasMax: z.string() - }) - }), - dev: z.object({ - build: z.object({ - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string() - }), - deploy: z.object({ - nodeEnv: z.string(), - staticApiUrl: z.string(), - staticAppUrl: z.string(), - siteminderLogoutURL: z.string(), - maxUploadNumFiles: z.number(), - maxUploadFileSize: z.number(), - biohubFeatureFlag: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - replicasMax: z.string() - }) - }), - test: z.object({ - build: z.object({ - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string() - }), - deploy: z.object({ - nodeEnv: z.string(), - staticApiUrl: z.string(), - staticAppUrl: z.string(), - siteminderLogoutURL: z.string(), - maxUploadNumFiles: z.number(), - maxUploadFileSize: z.number(), - biohubFeatureFlag: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - replicasMax: z.string() - }) - }), - prod: z.object({ - build: z.object({ - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string() - }), - deploy: z.object({ - nodeEnv: z.string(), - staticApiUrl: z.string(), - staticAppUrl: z.string(), - staticAppVanityUrl: z.string(), - siteminderLogoutURL: z.string(), - maxUploadNumFiles: z.number(), - maxUploadFileSize: z.number(), - biohubFeatureFlag: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - replicasMax: z.string() - }) - }) - }), - database: z.object({ - pr: z.object({ - build: z.object({ - tz: z.string(), - dbSetupDockerfilePath: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string() - }), - deploy: z.object({ - nodeEnv: z.string(), - tz: z.string(), - volumeCapacity: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string() - }) - }), - dev: z.object({ - build: z.object({ - tz: z.string(), - dbSetupDockerfilePath: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string() - }), - deploy: z.object({ - nodeEnv: z.string(), - tz: z.string(), - volumeCapacity: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string() - }) - }), - test: z.object({ - build: z.object({ - tz: z.string(), - dbSetupDockerfilePath: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string() - }), - deploy: z.object({ - nodeEnv: z.string(), - tz: z.string(), - volumeCapacity: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string() - }) - }), - prod: z.object({ - build: z.object({ - tz: z.string(), - dbSetupDockerfilePath: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string() - }), - deploy: z.object({ - nodeEnv: z.string(), - tz: z.string(), - volumeCapacity: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string() - }) - }) - }), - sso: z.object({ - dev: z.object({ - host: z.string(), - realm: z.string(), - clientId: z.string(), - keycloakSecret: z.string(), - serviceClient: z.object({ - serviceClientName: z.string(), - keycloakSecretServiceClientPasswordKey: z.string() - }), - cssApi: z.object({ - cssApiTokenUrl: z.string(), - cssApiClientId: z.string(), - cssApiHost: z.string(), - keycloakSecretCssApiSecretKey: z.string(), - cssApiEnvironment: z.string() - }) - }), - test: z.object({ - host: z.string(), - realm: z.string(), - clientId: z.string(), - keycloakSecret: z.string(), - serviceClient: z.object({ - serviceClientName: z.string(), - keycloakSecretServiceClientPasswordKey: z.string() - }), - cssApi: z.object({ - cssApiTokenUrl: z.string(), - cssApiClientId: z.string(), - cssApiHost: z.string(), - keycloakSecretCssApiSecretKey: z.string(), - cssApiEnvironment: z.string() - }) - }), - prod: z.object({ - host: z.string(), - realm: z.string(), - clientId: z.string(), - keycloakSecret: z.string(), - serviceClient: z.object({ - serviceClientName: z.string(), - keycloakSecretServiceClientPasswordKey: z.string() - }), - cssApi: z.object({ - cssApiTokenUrl: z.string(), - cssApiClientId: z.string(), - cssApiHost: z.string(), - keycloakSecretCssApiSecretKey: z.string(), - cssApiEnvironment: z.string() - }) - }) - }) -}); - -module.exports = exports = { PipelineConfigMapSchema }; diff --git a/database/.pipeline/config.js b/database/.pipeline/config.js index bbfacf74d2..4a7d3f83cb 100644 --- a/database/.pipeline/config.js +++ b/database/.pipeline/config.js @@ -1,7 +1,7 @@ 'use strict'; -const { PipelineConfigMapSchema } = require('./utils/configMapSchema'); const PipelineCli = require('pipeline-cli'); +const { PipelineConfigMapSchema } = require('../../.pipeline/configMaps/PipelineConfigMapSchema'); // Options passed in from the git action const rawOptions = PipelineCli.Util.parseArguments(); @@ -81,7 +81,6 @@ const phases = { pr: { build: { ...pipelineConfigMap.database.pr.build, - namespace: 'af2668-tools', name: pipelineConfigMap.module.db, changeId: changeId, suffix: `-build-${changeId}`, @@ -92,20 +91,17 @@ const phases = { }, deploy: { ...pipelineConfigMap.database.pr.deploy, - // phase: 'dev', - namespace: 'af2668-dev', name: pipelineConfigMap.module.db, changeId: changeId, suffix: `-dev-${changeId}`, instance: `${pipelineConfigMap.module.db}-pr-${changeId}`, - version: `${changeId}-${changeId}`, + version: `pr-${changeId}`, tag: `dev-${pipelineConfigMap.version}-${changeId}` } }, dev: { build: { ...pipelineConfigMap.database.dev.build, - namespace: 'af2668-tools', name: pipelineConfigMap.module.db, changeId: changeId, suffix: `-build-${changeId}`, @@ -116,8 +112,6 @@ const phases = { }, deploy: { ...pipelineConfigMap.database.dev.deploy, - // phase: 'dev', - namespace: 'af2668-dev', name: pipelineConfigMap.module.db, changeId: 'deploy', suffix: `-dev-deploy`, @@ -129,7 +123,6 @@ const phases = { test: { build: { ...pipelineConfigMap.database.test.build, - namespace: 'af2668-tools', name: pipelineConfigMap.module.db, changeId: changeId, suffix: `-build-${changeId}`, @@ -140,20 +133,17 @@ const phases = { }, deploy: { ...pipelineConfigMap.database.test.deploy, - // phase: 'test', - namespace: 'af2668-test', name: pipelineConfigMap.module.db, changeId: 'deploy', suffix: `-test`, instance: `${pipelineConfigMap.module.db}-test`, - version: pipelineConfigMap.version, + version: `deploy-${changeId}`, tag: `test-${pipelineConfigMap.version}` } }, prod: { build: { ...pipelineConfigMap.database.prod.build, - namespace: 'af2668-tools', name: pipelineConfigMap.module.db, changeId: changeId, suffix: `-build-${changeId}`, @@ -164,13 +154,11 @@ const phases = { }, deploy: { ...pipelineConfigMap.database.prod.deploy, - // phase: 'prod', - namespace: 'af2668-prod', name: pipelineConfigMap.module.db, changeId: 'deploy', suffix: `-prod`, instance: `${pipelineConfigMap.module.db}-prod`, - version: pipelineConfigMap.version, + version: `deploy-${changeId}`, tag: `prod-${pipelineConfigMap.version}` } } diff --git a/database/.pipeline/utils/configMapSchema.js b/database/.pipeline/utils/configMapSchema.js deleted file mode 100644 index df0edf24e3..0000000000 --- a/database/.pipeline/utils/configMapSchema.js +++ /dev/null @@ -1,373 +0,0 @@ -const z = require('zod'); - -const PipelineConfigMapSchema = z.object({ - name: z.string(), - namespaceSuffix: z.string(), - namespace: z.object({ - tools: z.string(), - dev: z.string(), - test: z.string(), - prod: z.string() - }), - version: z.string(), - module: z.object({ - db: z.string(), - api: z.string(), - app: z.string() - }), - api: z.object({ - pr: z.object({ - build: z.object({ - tz: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string() - }), - deploy: z.object({ - nodeEnv: z.string(), - tz: z.string(), - backboneApiHost: z.string(), - backboneIntakePath: z.string(), - backboneArtifactIntakePath: z.string(), - backboneIntakeEnabled: z.boolean(), - bctwApiHost: z.string(), - critterbaseApiHost: z.string(), - elasticsearchURL: z.string(), - elasticsearchTaxonomyIndex: z.string(), - s3KeyPrefix: z.string(), - logLevel: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - replicasMax: z.string() - }) - }), - dev: z.object({ - build: z.object({ - tz: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string() - }), - deploy: z.object({ - nodeEnv: z.string(), - staticApiUrl: z.string(), - staticAppUrl: z.string(), - tz: z.string(), - backboneApiHost: z.string(), - backboneIntakePath: z.string(), - backboneArtifactIntakePath: z.string(), - backboneIntakeEnabled: z.boolean(), - bctwApiHost: z.string(), - critterbaseApiHost: z.string(), - elasticsearchURL: z.string(), - elasticsearchTaxonomyIndex: z.string(), - s3KeyPrefix: z.string(), - logLevel: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - replicasMax: z.string() - }) - }), - test: z.object({ - build: z.object({ - tz: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string() - }), - deploy: z.object({ - nodeEnv: z.string(), - staticApiUrl: z.string(), - staticAppUrl: z.string(), - tz: z.string(), - backboneApiHost: z.string(), - backboneIntakePath: z.string(), - backboneArtifactIntakePath: z.string(), - backboneIntakeEnabled: z.boolean(), - bctwApiHost: z.string(), - critterbaseApiHost: z.string(), - elasticsearchURL: z.string(), - elasticsearchTaxonomyIndex: z.string(), - s3KeyPrefix: z.string(), - logLevel: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - replicasMax: z.string() - }) - }), - prod: z.object({ - build: z.object({ - tz: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string() - }), - deploy: z.object({ - nodeEnv: z.string(), - staticApiUrl: z.string(), - staticAppUrl: z.string(), - staticAppVanityUrl: z.string(), - tz: z.string(), - backboneApiHost: z.string(), - backboneIntakePath: z.string(), - backboneArtifactIntakePath: z.string(), - backboneIntakeEnabled: z.boolean(), - bctwApiHost: z.string(), - critterbaseApiHost: z.string(), - elasticsearchURL: z.string(), - elasticsearchTaxonomyIndex: z.string(), - s3KeyPrefix: z.string(), - logLevel: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - replicasMax: z.string() - }) - }) - }), - app: z.object({ - pr: z.object({ - build: z.object({ - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string() - }), - deploy: z.object({ - nodeEnv: z.string(), - siteminderLogoutURL: z.string(), - maxUploadNumFiles: z.number(), - maxUploadFileSize: z.number(), - biohubFeatureFlag: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - replicasMax: z.string() - }) - }), - dev: z.object({ - build: z.object({ - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string() - }), - deploy: z.object({ - nodeEnv: z.string(), - staticApiUrl: z.string(), - staticAppUrl: z.string(), - siteminderLogoutURL: z.string(), - maxUploadNumFiles: z.number(), - maxUploadFileSize: z.number(), - biohubFeatureFlag: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - replicasMax: z.string() - }) - }), - test: z.object({ - build: z.object({ - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string() - }), - deploy: z.object({ - nodeEnv: z.string(), - staticApiUrl: z.string(), - staticAppUrl: z.string(), - siteminderLogoutURL: z.string(), - maxUploadNumFiles: z.number(), - maxUploadFileSize: z.number(), - biohubFeatureFlag: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - replicasMax: z.string() - }) - }), - prod: z.object({ - build: z.object({ - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string() - }), - deploy: z.object({ - nodeEnv: z.string(), - staticApiUrl: z.string(), - staticAppUrl: z.string(), - staticAppVanityUrl: z.string(), - siteminderLogoutURL: z.string(), - maxUploadNumFiles: z.number(), - maxUploadFileSize: z.number(), - biohubFeatureFlag: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - replicasMax: z.string() - }) - }) - }), - database: z.object({ - pr: z.object({ - build: z.object({ - tz: z.string(), - dbSetupDockerfilePath: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string() - }), - deploy: z.object({ - nodeEnv: z.string(), - tz: z.string(), - volumeCapacity: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string() - }) - }), - dev: z.object({ - build: z.object({ - tz: z.string(), - dbSetupDockerfilePath: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string() - }), - deploy: z.object({ - nodeEnv: z.string(), - tz: z.string(), - volumeCapacity: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string() - }) - }), - test: z.object({ - build: z.object({ - tz: z.string(), - dbSetupDockerfilePath: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string() - }), - deploy: z.object({ - nodeEnv: z.string(), - tz: z.string(), - volumeCapacity: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string() - }) - }), - prod: z.object({ - build: z.object({ - tz: z.string(), - dbSetupDockerfilePath: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string() - }), - deploy: z.object({ - nodeEnv: z.string(), - tz: z.string(), - volumeCapacity: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string() - }) - }) - }), - sso: z.object({ - dev: z.object({ - host: z.string(), - realm: z.string(), - clientId: z.string(), - keycloakSecret: z.string(), - serviceClient: z.object({ - serviceClientName: z.string(), - keycloakSecretServiceClientPasswordKey: z.string() - }), - cssApi: z.object({ - cssApiTokenUrl: z.string(), - cssApiClientId: z.string(), - cssApiHost: z.string(), - keycloakSecretCssApiSecretKey: z.string(), - cssApiEnvironment: z.string() - }) - }), - test: z.object({ - host: z.string(), - realm: z.string(), - clientId: z.string(), - keycloakSecret: z.string(), - serviceClient: z.object({ - serviceClientName: z.string(), - keycloakSecretServiceClientPasswordKey: z.string() - }), - cssApi: z.object({ - cssApiTokenUrl: z.string(), - cssApiClientId: z.string(), - cssApiHost: z.string(), - keycloakSecretCssApiSecretKey: z.string(), - cssApiEnvironment: z.string() - }) - }), - prod: z.object({ - host: z.string(), - realm: z.string(), - clientId: z.string(), - keycloakSecret: z.string(), - serviceClient: z.object({ - serviceClientName: z.string(), - keycloakSecretServiceClientPasswordKey: z.string() - }), - cssApi: z.object({ - cssApiTokenUrl: z.string(), - cssApiClientId: z.string(), - cssApiHost: z.string(), - keycloakSecretCssApiSecretKey: z.string(), - cssApiEnvironment: z.string() - }) - }) - }) -}); - -module.exports = exports = { PipelineConfigMapSchema }; From b708afb3c32d995dde6b4bc957663bc28c48ce6b Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Mon, 5 Feb 2024 09:55:29 -0800 Subject: [PATCH 25/62] Remove old pipelien files --- api/.pipeline2/templates/api.bc.yaml | 114 ----- api/.pipeline2/templates/api.dc.yaml | 483 ------------------ api/.pipeline2/templates/db.secret.yaml | 13 - .../templates/object-store.secret.yaml | 10 - app/.pipeline2/templates/app.bc.yaml | 119 ----- app/.pipeline2/templates/app.dc.yaml | 263 ---------- .../templates/github-webhook.secret.yaml | 8 - database/.pipeline2/templates/db.bc.yaml | 37 -- database/.pipeline2/templates/db.dc.yaml | 251 --------- .../.pipeline2/templates/db.setup.bc.yaml | 120 ----- .../.pipeline2/templates/db.setup.dc.yaml | 104 ---- .../.pipeline2/templates/db.setup.is.yaml | 18 - 12 files changed, 1540 deletions(-) delete mode 100644 api/.pipeline2/templates/api.bc.yaml delete mode 100644 api/.pipeline2/templates/api.dc.yaml delete mode 100644 api/.pipeline2/templates/db.secret.yaml delete mode 100644 api/.pipeline2/templates/object-store.secret.yaml delete mode 100644 app/.pipeline2/templates/app.bc.yaml delete mode 100644 app/.pipeline2/templates/app.dc.yaml delete mode 100644 app/.pipeline2/templates/github-webhook.secret.yaml delete mode 100644 database/.pipeline2/templates/db.bc.yaml delete mode 100644 database/.pipeline2/templates/db.dc.yaml delete mode 100644 database/.pipeline2/templates/db.setup.bc.yaml delete mode 100644 database/.pipeline2/templates/db.setup.dc.yaml delete mode 100644 database/.pipeline2/templates/db.setup.is.yaml diff --git a/api/.pipeline2/templates/api.bc.yaml b/api/.pipeline2/templates/api.bc.yaml deleted file mode 100644 index b23547271c..0000000000 --- a/api/.pipeline2/templates/api.bc.yaml +++ /dev/null @@ -1,114 +0,0 @@ -apiVersion: template.openshift.io/v1 -kind: Template -metadata: - name: sims-api-bc - labels: - build: sims-api -parameters: - - name: NAME - description: Image name - required: true - value: sims-api - - name: SUFFIX - description: A suffix appended to all objects - required: true - value: '-dev' - - name: VERSION - required: true - value: '1.0' - - name: SOURCE_CONTEXT_DIR - required: true - value: api - - name: SOURCE_REPOSITORY_URL - required: true - value: https://github.com/bcgov/biohubbc - - name: SOURCE_REPOSITORY_REF - required: false - value: dev - - name: BASE_IMAGE_URL - required: true - value: image-registry.openshift-image-registry.svc:5000/openshift/nodejs:14-ubi8 - - name: SOURCE_IMAGE_NAME - required: true - value: nodejs - - name: SOURCE_IMAGE_TAG - required: true - value: 14-ubi8 - - name: CPU_REQUEST - value: '50m' - - name: CPU_LIMIT - value: '1000m' - - name: MEMORY_REQUEST - value: '100Mi' - - name: MEMORY_LIMIT - value: '3Gi' -objects: - - kind: ImageStream - apiVersion: image.openshift.io/v1 - metadata: - name: ${SOURCE_IMAGE_NAME} - annotations: - description: Nodejs Base Image - labels: - shared: 'true' - spec: - lookupPolicy: - local: false - tags: - - name: ${SOURCE_IMAGE_TAG} - annotations: null - from: - kind: DockerImage - name: ${BASE_IMAGE_URL} - importPolicy: {} - referencePolicy: - type: Local - - kind: ImageStream - apiVersion: image.openshift.io/v1 - metadata: - name: '${NAME}' - annotations: - description: Nodejs Runtime Image - labels: - shared: 'true' - spec: - lookupPolicy: - local: false - - apiVersion: v1 - kind: BuildConfig - metadata: - name: '${NAME}${SUFFIX}' - labels: {} - annotations: {} - spec: - failedBuildsHistoryLimit: 5 - nodeSelector: - output: - to: - kind: ImageStreamTag - name: '${NAME}:${VERSION}' - postCommit: {} - resources: - requests: - cpu: ${CPU_REQUEST} - memory: ${MEMORY_REQUEST} - limits: - cpu: ${CPU_LIMIT} - memory: ${MEMORY_LIMIT} - runPolicy: SerialLatestOnly - source: - contextDir: '${SOURCE_CONTEXT_DIR}' - git: - uri: '${SOURCE_REPOSITORY_URL}' - ref: '${SOURCE_REPOSITORY_REF}' - type: Git - strategy: - dockerStrategy: - from: - kind: ImageStreamTag - name: ${SOURCE_IMAGE_NAME}:${SOURCE_IMAGE_TAG} - type: Docker - successfulBuildsHistoryLimit: 5 - triggers: - - type: ConfigChange - - type: ImageChange diff --git a/api/.pipeline2/templates/api.dc.yaml b/api/.pipeline2/templates/api.dc.yaml deleted file mode 100644 index 07444b78e1..0000000000 --- a/api/.pipeline2/templates/api.dc.yaml +++ /dev/null @@ -1,483 +0,0 @@ -apiVersion: template.openshift.io/v1 -kind: Template -metadata: - name: sims-api-dc - labels: - build: sims-api -parameters: - - name: NAME - value: sims-api - - name: SUFFIX - value: '-dev' - - name: VERSION - description: Version of the application - value: '1.0.0' - - name: HOST - description: Host name of the application - required: true - - name: APP_HOST - description: APP host for application frontend - value: '' - - name: CHANGE_ID - description: Change id of the project. This will help to pull image stream - required: true - value: '0' - - name: NODE_ENV - description: Application Environment type variable - required: true - value: 'dev' - - name: API_PORT_DEFAULT - value: '6100' - - name: API_PORT_DEFAULT_NAME - description: Api default port name - value: '6100-tcp' - # Clamav - - name: ENABLE_FILE_VIRUS_SCAN - value: 'true' - - name: CLAMAV_HOST - value: 'clamav' - - name: CLAMAV_PORT - value: '3310' - # BioHub Platform (aka: Backbone) - - name: BACKBONE_API_HOST - required: true - description: API host for BioHub Platform Backbone. Example "https://platform.com". - - name: BACKBONE_INTAKE_PATH - required: true - description: API path for BioHub Platform Backbone DwCA submission intake endpoint. Example "/api/path/to/intake". - - name: BACKBONE_ARTIFACT_INTAKE_PATH - required: true - description: API path for BioHub Platform Backbone artifact submission intake endpoint. Example "/api/path/to/artifact/intake". - - name: BACKBONE_INTAKE_ENABLED - required: true - description: Controls whether or not SIMS will submit DwCA datasets to the BioHub Platform Backbone. Set to "true" to enable it, will be disabled by default otherwise. - # BCTW / Critterbase - - name: CB_API_HOST - description: API host for the Critterbase service, SIMS API will hit this to retrieve critter metadata. Example "https://critterbase.com". - required: true - - name: BCTW_API_HOST - description: API host for the BC Telemetry Warehouse service. SIMS API will hit this for device deployments and other telemetry operations. Example "https://bctw.com". - required: true - # Elastic Search - - name: ELASTICSEARCH_URL - description: Platform Elasticsearch URL - required: true - value: 'http://es01:9200' - - name: ELASTICSEARCH_TAXONOMY_INDEX - description: Platform Elasticsearch Taxonomy Index - required: true - value: 'taxonomy_3.0.0' - # Database - - name: TZ - description: Application timezone - required: false - value: 'America/Vancouver' - - name: DB_SERVICE_NAME - description: 'Database service name associated with deployment' - required: true - # Keycloak - - name: KEYCLOAK_HOST - description: Key clock login url - required: true - - name: KEYCLOAK_REALM - description: Realm identifier or name - required: true - - name: KEYCLOAK_CLIENT_ID - description: Client Id for application - required: true - # Keycloak secret - - name: KEYCLOAK_SECRET - description: The name of the keycloak secret - required: true - # Keycloak Service Client - - name: KEYCLOAK_ADMIN_USERNAME - description: keycloak host admin username - required: true - - name: KEYCLOAK_SECRET_ADMIN_PASSWORD_KEY - description: The key of the admin password in the keycloak secret - required: true - # Keycloak CSS API - - name: KEYCLOAK_API_TOKEN_URL - description: The url to fetch a css api access token, which is needed to call the css rest api - required: true - - name: KEYCLOAK_API_CLIENT_ID - description: The css api client id - required: true - - name: KEYCLOAK_API_CLIENT_SECRET_KEY - description: The css api client secret - required: true - - name: KEYCLOAK_API_HOST - description: The url of the css rest api - required: true - - name: KEYCLOAK_API_ENVIRONMENT - description: The css api environment to query (dev, test, prod) - required: true - # Object Store (S3) - - name: OBJECT_STORE_SECRETS - description: Secrets used to read and write to the S3 storage - value: 'sims-object-store' - - name: S3_KEY_PREFIX - description: S3 key optional prefix - required: false - value: 'sims' - # Log level - - name: LOG_LEVEL - value: 'info' - # GCNotify - - name: GCNOTIFY_API_SECRET - description: Secret for gcnotify api key - value: 'gcnotify-api-key' - - name: GCNOTIFY_ADMIN_EMAIL - description: admin email for gcnotify api - value: biohub@gov.bc.ca - - name: GCNOTIFY_ONBOARDING_REQUEST_EMAIL_TEMPLATE - description: gcnotify email template id - value: 7779a104-b863-40ac-902f-1aa607d2071a - - name: GCNOTIFY_ONBOARDING_REQUEST_SMS_TEMPLATE - description: gcnotify sms template id - value: af2f1e40-bd72-4612-9c5a-567ee5b26ca5 - - name: GCNOTIFY_REQUEST_RESUBMIT_TEMPLATE - description: gcnotify request resubmit email template - value: c973da33-1f2b-435a-9429-d8ab4fd273c5 - - name: GCNOTIFY_EMAIL_URL - value: https://api.notification.canada.ca/v2/notifications/email - - name: GCNOTIFY_SMS_URL - value: https://api.notification.canada.ca/v2/notifications/sms - # Openshift Resources - - name: CPU_REQUEST - value: '50m' - - name: CPU_LIMIT - value: '500m' - - name: MEMORY_REQUEST - value: '100Mi' - - name: MEMORY_LIMIT - value: '2Gi' - - name: REPLICAS - value: '1' - - name: REPLICAS_MAX - value: '1' -objects: - - apiVersion: image.openshift.io/v1 - kind: ImageStream - metadata: - annotations: - description: Nodejs Runtime Image - labels: - shared: 'true' - generation: 0 - name: ${NAME} - spec: - lookupPolicy: - local: false - status: - dockerImageRepository: null - - - kind: DeploymentConfig - apiVersion: apps.openshift.io/v1 - metadata: - annotations: - openshift.io/generated-by: OpenShiftWebConsole - generation: 0 - labels: - role: api - name: ${NAME}${SUFFIX} - spec: - replicas: ${{REPLICAS}} - revisionHistoryLimit: 10 - selector: - deploymentConfig: ${NAME}${SUFFIX} - strategy: - activeDeadlineSeconds: 21600 - recreateParams: - timeoutSeconds: 600 - resources: - requests: - cpu: ${CPU_REQUEST} - memory: ${MEMORY_REQUEST} - limits: - cpu: ${CPU_LIMIT} - memory: ${MEMORY_LIMIT} - type: Rolling - template: - metadata: - annotations: null - labels: - deploymentConfig: ${NAME}${SUFFIX} - role: api - spec: - containers: - - env: - - name: API_HOST - value: ${HOST} - - name: API_PORT - value: ${API_PORT_DEFAULT} - - name: APP_HOST - value: ${APP_HOST} - - name: VERSION - value: ${VERSION} - - name: CHANGE_VERSION - value: ${CHANGE_ID} - - name: NODE_ENV - value: ${NODE_ENV} - # BioHub Platform (aka: Backbone) - - name: BACKBONE_API_HOST - value: ${BACKBONE_API_HOST} - - name: BACKBONE_INTAKE_PATH - value: ${BACKBONE_INTAKE_PATH} - - name: BACKBONE_ARTIFACT_INTAKE_PATH - value: ${BACKBONE_ARTIFACT_INTAKE_PATH} - - name: BACKBONE_INTAKE_ENABLED - value: ${BACKBONE_INTAKE_ENABLED} - # BCTW / Critterbase - - name: CB_API_HOST - value: ${CB_API_HOST} - - name: BCTW_API_HOST - value: ${BCTW_API_HOST} - # Clamav - - name: ENABLE_FILE_VIRUS_SCAN - value: ${ENABLE_FILE_VIRUS_SCAN} - - name: CLAMAV_HOST - value: ${CLAMAV_HOST} - - name: CLAMAV_PORT - value: ${CLAMAV_PORT} - # Database - - name: TZ - value: ${TZ} - - name: DB_HOST - value: ${DB_SERVICE_NAME} - - name: DB_USER_API - valueFrom: - secretKeyRef: - key: database-user-api - name: ${DB_SERVICE_NAME} - - name: DB_USER_API_PASS - valueFrom: - secretKeyRef: - key: database-user-api-password - name: ${DB_SERVICE_NAME} - - name: DB_DATABASE - valueFrom: - secretKeyRef: - key: database-name - name: ${DB_SERVICE_NAME} - - name: DB_PORT - value: '5432' - - name: PROJECT_SEEDER_USER_IDENTIFIER - value: ${PROJECT_SEEDER_USER_IDENTIFIER} - # Keycloak - - name: KEYCLOAK_HOST - value: ${KEYCLOAK_HOST} - - name: KEYCLOAK_REALM - value: ${KEYCLOAK_REALM} - - name: KEYCLOAK_CLIENT_ID - value: ${KEYCLOAK_CLIENT_ID} - # Keycloak Service Client - - name: KEYCLOAK_ADMIN_USERNAME - value: ${KEYCLOAK_ADMIN_USERNAME} - - name: KEYCLOAK_ADMIN_PASSWORD - valueFrom: - secretKeyRef: - name: ${KEYCLOAK_SECRET} - key: ${KEYCLOAK_SECRET_ADMIN_PASSWORD_KEY} - # Keycloak CSS API - - name: KEYCLOAK_API_TOKEN_URL - value: ${KEYCLOAK_API_TOKEN_URL} - - name: KEYCLOAK_API_CLIENT_ID - value: ${KEYCLOAK_API_CLIENT_ID} - - name: KEYCLOAK_API_CLIENT_SECRET - valueFrom: - secretKeyRef: - name: ${KEYCLOAK_SECRET} - key: ${KEYCLOAK_API_CLIENT_SECRET_KEY} - - name: KEYCLOAK_API_HOST - value: ${KEYCLOAK_API_HOST} - - name: KEYCLOAK_API_ENVIRONMENT - value: ${KEYCLOAK_API_ENVIRONMENT} - # Elastic Search - - name: ELASTICSEARCH_URL - value: ${ELASTICSEARCH_URL} - - name: ELASTICSEARCH_TAXONOMY_INDEX - value: ${ELASTICSEARCH_TAXONOMY_INDEX} - - name: S3_KEY_PREFIX - value: ${S3_KEY_PREFIX} - # Object Store (S3) - - name: OBJECT_STORE_URL - valueFrom: - secretKeyRef: - key: object_store_url - name: ${OBJECT_STORE_SECRETS} - - name: OBJECT_STORE_ACCESS_KEY_ID - valueFrom: - secretKeyRef: - key: object_store_access_key_id - name: ${OBJECT_STORE_SECRETS} - - name: OBJECT_STORE_SECRET_KEY_ID - valueFrom: - secretKeyRef: - key: object_store_secret_key_id - name: ${OBJECT_STORE_SECRETS} - - name: OBJECT_STORE_BUCKET_NAME - valueFrom: - secretKeyRef: - key: object_store_bucket_name - name: ${OBJECT_STORE_SECRETS} - # Log level - - name: LOG_LEVEL - value: ${LOG_LEVEL} - # GCNotify - - name: GCNOTIFY_SECRET_API_KEY - valueFrom: - secretKeyRef: - key: key - name: ${GCNOTIFY_API_SECRET} - - name: GCNOTIFY_ADMIN_EMAIL - value: ${GCNOTIFY_ADMIN_EMAIL} - - name: GCNOTIFY_ONBOARDING_REQUEST_EMAIL_TEMPLATE - value: ${GCNOTIFY_ONBOARDING_REQUEST_EMAIL_TEMPLATE} - - name: GCNOTIFY_ONBOARDING_REQUEST_SMS_TEMPLATE - value: ${GCNOTIFY_ONBOARDING_REQUEST_SMS_TEMPLATE} - - name: GCNOTIFY_EMAIL_URL - value: ${GCNOTIFY_EMAIL_URL} - - name: GCNOTIFY_SMS_URL - value: ${GCNOTIFY_SMS_URL} - image: ' ' - imagePullPolicy: Always - name: api - ports: - - containerPort: ${{API_PORT_DEFAULT}} - protocol: TCP - resources: - requests: - cpu: ${CPU_REQUEST} - memory: ${MEMORY_REQUEST} - limits: - cpu: ${CPU_LIMIT} - memory: ${MEMORY_LIMIT} - readinessProbe: - httpGet: - path: /api/version - port: ${{API_PORT_DEFAULT}} - scheme: HTTP - initialDelaySeconds: 60 - periodSeconds: 30 - timeoutSeconds: 15 - successThreshold: 1 - failureThreshold: 20 - livenessProbe: - httpGet: - path: /api/version - port: ${{API_PORT_DEFAULT}} - scheme: HTTP - initialDelaySeconds: 60 - periodSeconds: 30 - timeoutSeconds: 15 - successThreshold: 1 - failureThreshold: 20 - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File - volumeMounts: - - mountPath: /opt/app-root/app - name: ${NAME}${SUFFIX} - dnsPolicy: ClusterFirst - restartPolicy: Always - schedulerName: default-scheduler - securityContext: {} - terminationGracePeriodSeconds: 30 - volumes: - - emptyDir: {} - name: ${NAME}${SUFFIX} - test: false - triggers: - - imageChangeParams: - automatic: true - containerNames: - - api - from: - kind: ImageStreamTag - name: ${NAME}:${VERSION} - type: ImageChange - - type: ConfigChange - status: - availableReplicas: 0 - latestVersion: 0 - observedGeneration: 0 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 - - - kind: Secret - apiVersion: v1 - stringData: - database-name: '' - database-user-api-password: '' - database-user-api: '' - metadata: - annotations: - as-copy-of: ${DB_SERVICE_NAME} - name: ${NAME}${SUFFIX} - type: Opaque - - - apiVersion: v1 - kind: Service - metadata: - annotations: null - labels: {} - name: ${NAME}${SUFFIX} - spec: - ports: - - name: ${NAME}-${API_PORT_DEFAULT_NAME} - port: ${{API_PORT_DEFAULT}} - protocol: TCP - targetPort: ${{API_PORT_DEFAULT}} - selector: - deploymentconfig: ${NAME}${SUFFIX} - sessionAffinity: None - type: ClusterIP - status: - loadBalancer: {} - - - kind: Route - apiVersion: route.openshift.io/v1 - metadata: - annotations: - # These 2 annotations (haproxy.router.openshift.io/balance and haproxy.router.openshift.io/disable_cookies) are set in order to prevent 'sticky sessions' - # 'sticky sessions': If an API pod is busy fullfilling a request, subsequent requests will go to other API pods rather than wait for the same pod (when pod replicas is > 1) - haproxy.router.openshift.io/balance: 'leastconn' - haproxy.router.openshift.io/disable_cookies: 'true' - labels: {} - name: ${NAME}${SUFFIX} - spec: - host: ${HOST} - tls: - insecureEdgeTerminationPolicy: Redirect - termination: edge - port: - targetPort: ${NAME}-${API_PORT_DEFAULT_NAME} - to: - kind: Service - name: ${NAME}${SUFFIX} - weight: 100 - wildcardPolicy: None - status: - ingress: null - - - kind: HorizontalPodAutoscaler - apiVersion: autoscaling/v2 - metadata: - annotations: {} - labels: {} - name: ${NAME}${SUFFIX} - spec: - minReplicas: ${{REPLICAS}} - maxReplicas: ${{REPLICAS_MAX}} - scaleTargetRef: - apiVersion: apps.openshift.io/v1 - kind: DeploymentConfig - name: ${NAME}${SUFFIX} - metrics: - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: 80 diff --git a/api/.pipeline2/templates/db.secret.yaml b/api/.pipeline2/templates/db.secret.yaml deleted file mode 100644 index b60dfe7412..0000000000 --- a/api/.pipeline2/templates/db.secret.yaml +++ /dev/null @@ -1,13 +0,0 @@ -kind: Secret -apiVersion: v1 -metadata: - name: sims-database -data: - database-admin: - database-admin-password: - database-name: - database-user: - database-user-api: - database-user-api-password: - database-user-password: -type: Opaque diff --git a/api/.pipeline2/templates/object-store.secret.yaml b/api/.pipeline2/templates/object-store.secret.yaml deleted file mode 100644 index 00a4e2fcac..0000000000 --- a/api/.pipeline2/templates/object-store.secret.yaml +++ /dev/null @@ -1,10 +0,0 @@ -kind: Secret -apiVersion: v1 -metadata: - name: sims-object-store -data: - object_store_access_key_id: - object_store_bucket_name: - object_store_secret_key_id: - object_store_url: -type: Opaque diff --git a/app/.pipeline2/templates/app.bc.yaml b/app/.pipeline2/templates/app.bc.yaml deleted file mode 100644 index db2e0bcd3b..0000000000 --- a/app/.pipeline2/templates/app.bc.yaml +++ /dev/null @@ -1,119 +0,0 @@ -apiVersion: template.openshift.io/v1 -kind: Template -metadata: - name: sims-app-bc-2 - labels: - build: sims-app -parameters: - - name: NAME - required: true - value: 'sims-app-2' - - name: VERSION - required: true - value: '1.0' - - name: SOURCE_CONTEXT_DIR - required: true - value: app - - name: SOURCE_REPOSITORY_URL - required: true - value: https://github.com/bcgov/biohubbc - - name: SOURCE_REPOSITORY_REF - required: true - value: dev - - name: BASE_IMAGE_URL - required: true - value: image-registry.openshift-image-registry.svc:5000/openshift/nodejs:14-ubi8 - - name: SOURCE_IMAGE_NAME - required: true - value: nodejs - - name: SOURCE_IMAGE_TAG - required: true - value: 14-ubi8 - - name: CPU_REQUEST - required: true - value: '50m' - - name: CPU_LIMIT - required: true - value: '1000m' - - name: MEMORY_REQUEST - required: true - value: '100Mi' - - name: MEMORY_LIMIT - required: true - value: '5Gi' -objects: - - kind: ImageStream - apiVersion: image.openshift.io/v1 - metadata: - name: ${SOURCE_IMAGE_NAME} - annotations: - description: Nodejs Base Image - labels: - shared: 'true' - spec: - lookupPolicy: - local: false - tags: - - name: ${SOURCE_IMAGE_TAG} - annotations: null - from: - kind: DockerImage - name: ${BASE_IMAGE_URL} - importPolicy: {} - referencePolicy: - type: Local - - - kind: ImageStream - apiVersion: image.openshift.io/v1 - metadata: - name: '${NAME}' - annotations: - description: Nodejs Runtime Image - labels: - shared: 'true' - spec: - lookupPolicy: - local: false - - - kind: BuildConfig - apiVersion: build.openshift.io/v1 - metadata: - name: '${NAME}' - labels: {} - annotations: {} - spec: - failedBuildsHistoryLimit: 5 - nodeSelector: - output: - to: - kind: ImageStreamTag - name: '${NAME}:${VERSION}' - postCommit: {} - resources: - requests: - cpu: ${CPU_REQUEST} - memory: ${MEMORY_REQUEST} - limits: - cpu: ${CPU_LIMIT} - memory: ${MEMORY_LIMIT} - runPolicy: Serial - source: - contextDir: '${SOURCE_CONTEXT_DIR}' - git: - uri: '${SOURCE_REPOSITORY_URL}' - ref: '${SOURCE_REPOSITORY_REF}' - type: Git - strategy: - dockerStrategy: - from: - kind: ImageStreamTag - name: ${SOURCE_IMAGE_NAME}:${SOURCE_IMAGE_TAG} - type: Docker - successfulBuildsHistoryLimit: 5 - triggers: - - type: ConfigChange - - type: ImageChange - - type: GitHub - github: - secretReference: - name: sims-github-webhook-secret \ No newline at end of file diff --git a/app/.pipeline2/templates/app.dc.yaml b/app/.pipeline2/templates/app.dc.yaml deleted file mode 100644 index 5593575582..0000000000 --- a/app/.pipeline2/templates/app.dc.yaml +++ /dev/null @@ -1,263 +0,0 @@ -apiVersion: template.openshift.io/v1 -kind: Template -metadata: - name: sims-app-dc-2 - labels: - build: sims-app -parameters: - - name: NAME - required: true - value: 'sims-app-2' - - name: VERSION - required: true - value: 'latest' - - name: HOST - required: true - value: 'dev-sims.apps.silver.devops.gov.bc.ca' - - name: CHANGE_ID - - name: REACT_APP_API_HOST - required: true - description: API host for application backend - value: '' - - name: REACT_APP_SITEMINDER_LOGOUT_URL - required: true - description: Siteminder URL to log out and clear the session for the logged in user - value: '' - - name: REACT_APP_MAX_UPLOAD_NUM_FILES - required: true - description: Default maximum number of files that can be uploaded at a time vai the upload component UI. - value: '10' - - name: REACT_APP_MAX_UPLOAD_FILE_SIZE - required: true - description: Default maximum size of a single file that can be uploaded by the upload component UI. - value: '52428800' - - name: NODE_ENV - required: true - description: NODE_ENV specification variable - value: 'dev' - - name: REACT_APP_NODE_ENV - required: true - description: NODE_ENV specification variable for React app - value: 'dev' - - name: OBJECT_STORE_SECRETS - required: true - description: Secrets used to read and write to the S3 storage - value: 'sims-object-store' - - name: APP_PORT_DEFAULT - description: Application default port - required: true - value: '7100' - - name: APP_PORT_DEFAULT_NAME - description: Default port resource name - required: true - value: '7100-tcp' - - name: REACT_APP_KEYCLOAK_HOST - description: Key clock login url - required: true - - name: REACT_APP_KEYCLOAK_REALM - description: Realm identifier or name - required: true - - name: REACT_APP_KEYCLOAK_CLIENT_ID - description: Client Id for application - required: true - - name: CONFIG_MAP_NAME - required: true - value: 'sims-pipeline-config' - - name: CPU_REQUEST - required: true - value: '50m' - - name: CPU_LIMIT - required: true - value: '200m' - - name: MEMORY_REQUEST - required: true - value: '50Mi' - - name: MEMORY_LIMIT - required: true - value: '200Mi' - - name: REPLICAS - required: true - value: '1' - - name: REPLICAS_MAX - required: true - value: '1' -objects: - - kind: DeploymentConfig - apiVersion: apps.openshift.io/v1 - metadata: - annotations: - openshift.io/generated-by: OpenShiftWebConsole - generation: 0 - labels: - role: app - name: ${NAME} - spec: - replicas: ${{REPLICAS}} - revisionHistoryLimit: 10 - selector: - deploymentConfig: ${NAME} - strategy: - activeDeadlineSeconds: 21600 - recreateParams: - timeoutSeconds: 600 - resources: - requests: - cpu: ${CPU_REQUEST} - memory: ${MEMORY_REQUEST} - limits: - cpu: ${CPU_LIMIT} - memory: ${MEMORY_LIMIT} - type: Rolling - template: - metadata: - annotations: null - labels: - deploymentConfig: ${NAME} - role: app - spec: - containers: - - env: - - name: CHANGE_VERSION - value: ${CHANGE_ID} - - name: REACT_APP_API_HOST - value: ${REACT_APP_API_HOST} - - name: REACT_APP_SITEMINDER_LOGOUT_URL - value: ${REACT_APP_SITEMINDER_LOGOUT_URL} - - name: REACT_APP_MAX_UPLOAD_NUM_FILES - value: ${REACT_APP_MAX_UPLOAD_NUM_FILES} - - name: REACT_APP_MAX_UPLOAD_FILE_SIZE - value: ${REACT_APP_MAX_UPLOAD_FILE_SIZE} - - name: OBJECT_STORE_URL - valueFrom: - secretKeyRef: - key: object_store_url - name: ${OBJECT_STORE_SECRETS} - - name: OBJECT_STORE_BUCKET_NAME - valueFrom: - secretKeyRef: - key: object_store_bucket_name - name: ${OBJECT_STORE_SECRETS} - - name: NODE_ENV - value: ${NODE_ENV} - - name: REACT_APP_NODE_ENV - value: ${REACT_APP_NODE_ENV} - - name: VERSION - value: ${VERSION} - - name: REACT_APP_KEYCLOAK_HOST - value: ${REACT_APP_KEYCLOAK_HOST} - - name: REACT_APP_KEYCLOAK_REALM - value: ${REACT_APP_KEYCLOAK_REALM} - - name: REACT_APP_KEYCLOAK_CLIENT_ID - value: ${REACT_APP_KEYCLOAK_CLIENT_ID} - image: ' ' - imagePullPolicy: Always - name: app - ports: - - containerPort: ${{APP_PORT_DEFAULT}} - protocol: TCP - resources: - requests: - cpu: ${CPU_REQUEST} - memory: ${MEMORY_REQUEST} - limits: - cpu: ${CPU_LIMIT} - memory: ${MEMORY_LIMIT} - readinessProbe: - httpGet: - path: / - port: ${{APP_PORT_DEFAULT}} - scheme: HTTP - initialDelaySeconds: 60 - periodSeconds: 30 - timeoutSeconds: 15 - successThreshold: 1 - failureThreshold: 20 - livenessProbe: - httpGet: - path: / - port: ${{APP_PORT_DEFAULT}} - scheme: HTTP - initialDelaySeconds: 60 - periodSeconds: 30 - timeoutSeconds: 15 - successThreshold: 1 - failureThreshold: 20 - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File - dnsPolicy: ClusterFirst - restartPolicy: Always - schedulerName: default-scheduler - securityContext: {} - terminationGracePeriodSeconds: 30 - volumes: - - name: config-volume - configMap: - name: ${CONFIG_MAP_NAME} - test: false - triggers: - - imageChangeParams: - automatic: true - containerNames: - - app - from: - kind: ImageStreamTag - name: ${NAME}:${VERSION} - type: ImageChange - - type: ConfigChange - - - kind: Service - apiVersion: v1 - metadata: - annotations: null - labels: {} - name: ${NAME} - spec: - ports: - - name: ${NAME}-${APP_PORT_DEFAULT_NAME} - port: ${{APP_PORT_DEFAULT}} - protocol: TCP - targetPort: ${{APP_PORT_DEFAULT}} - selector: - deploymentconfig: ${NAME} - sessionAffinity: None - type: ClusterIP - - - kind: Route - apiVersion: route.openshift.io/v1 - metadata: - annotations: {} - labels: {} - name: ${NAME} - spec: - host: ${HOST} - tls: - insecureEdgeTerminationPolicy: Redirect - termination: edge - port: - targetPort: ${NAME}-${APP_PORT_DEFAULT_NAME} - to: - kind: Service - name: ${NAME} - weight: 100 - wildcardPolicy: None - - - kind: HorizontalPodAutoscaler - apiVersion: autoscaling/v2 - metadata: - annotations: {} - labels: {} - name: ${NAME} - spec: - minReplicas: ${{REPLICAS}} - maxReplicas: ${{REPLICAS_MAX}} - scaleTargetRef: - apiVersion: apps.openshift.io/v1 - kind: DeploymentConfig - name: ${NAME} - metrics: - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: 80 diff --git a/app/.pipeline2/templates/github-webhook.secret.yaml b/app/.pipeline2/templates/github-webhook.secret.yaml deleted file mode 100644 index 94eb871bbe..0000000000 --- a/app/.pipeline2/templates/github-webhook.secret.yaml +++ /dev/null @@ -1,8 +0,0 @@ -kind: Secret -apiVersion: v1 -metadata: - name: sims-github-webhook-secret - namespace: af2668-tools -data: - WebHookSecretKey: -type: Opaque diff --git a/database/.pipeline2/templates/db.bc.yaml b/database/.pipeline2/templates/db.bc.yaml deleted file mode 100644 index 15bf4cbf7d..0000000000 --- a/database/.pipeline2/templates/db.bc.yaml +++ /dev/null @@ -1,37 +0,0 @@ -kind: Template -apiVersion: template.openshift.io/v1 -metadata: - name: postgresql null -parameters: - - name: NAME - displayName: Name - description: A name used for all objects - required: true - - name: SUFFIX - displayName: Name Suffix - description: A suffix appended to all objects - required: true - - name: TAG_NAME - required: true -objects: - - kind: ImageStream - apiVersion: image.openshift.io/v1 - metadata: - name: '${NAME}' - labels: - shared: 'true' - annotations: {} - spec: - lookupPolicy: - local: false - tags: - - name: '${TAG_NAME}' - annotations: - from: - kind: ImageStreamTag - name: postgis-postgres:12-31 - namespace: af2668-tools - generation: 1 - importPolicy: {} - referencePolicy: - type: Source diff --git a/database/.pipeline2/templates/db.dc.yaml b/database/.pipeline2/templates/db.dc.yaml deleted file mode 100644 index 9ce00a054e..0000000000 --- a/database/.pipeline2/templates/db.dc.yaml +++ /dev/null @@ -1,251 +0,0 @@ -kind: Template -apiVersion: template.openshift.io/v1 -labels: - template: postgresql-persistent-template -metadata: - name: sims-db-dc - labels: - build: sims-db -parameters: - - description: The name of the OpenShift Service exposed for the database. - displayName: Database Service Name - name: NAME - required: true - value: 'postgresql' - - description: The OpenShift ImageStream name. - displayName: IMAGE_STREAM_NAME - name: IMAGE_STREAM_NAME - value: 'postgis-postgres' - - description: The OpenShift Namespace where the ImageStream resides. - displayName: Namespace - name: IMAGE_STREAM_NAMESPACE - value: 'af2668-tools' - - description: The name of the OpenShift Service exposed for the database. - displayName: Database Service Name - name: DATABASE_SERVICE_NAME - required: true - value: 'postgresql' - - description: Username for PostgreSQL user that will be used for accessing the database. - displayName: PostgreSQL Connection Username - name: POSTGRESQL_USER - required: true - value: 'postgres' - - description: Admin Username for PostgreSQL user that will be used for accessing the database. - displayName: PostgreSQL Admin Connection Username - name: POSTGRESQL_ADMIN_USER - required: true - value: 'postgres' - - description: Password for the PostgreSQL connection user. - displayName: PostgreSQL Connection Password - from: '[a-zA-Z0-9]{16}' - generate: expression - name: POSTGRESQL_PASSWORD - required: true - - description: Password for the PostgreSQL admin user. - displayName: PostgreSQL Admin Connection Password - from: '[a-zA-Z0-9]{16}' - generate: expression - name: POSTGRESQL_ADMIN_PASSWORD - required: true - - description: Name of the PostgreSQL database accessed. - displayName: PostgreSQL Database Name - name: POSTGRESQL_DATABASE - required: true - value: 'biohubbc' - - name: TZ - description: Database timezone - required: false - value: 'America/Vancouver' - - description: Volume space available for data, e.g. 512Mi, 2Gi. - displayName: Volume Capacity - name: VOLUME_CAPACITY - required: true - value: '500Mi' - - description: Version of PostgreSQL image to be used (9.2, 9.4, 9.5 or latest). - displayName: Version of PostgreSQL Image - name: IMAGE_STREAM_VERSION - required: true - value: '12-31' - - description: Indicator to enable pgcrypto extension (provided out-of-the-box with PostgreSQL). - displayName: Flag to enable pgcrypto PostgreSQL extension. - name: PGCRYPTO_EXTENSION - value: 'Y' - - description: Indicator to enable postgis extension (from official PostgeSQL YUM repo). - displayName: Flag to enable postgis PostgreSQL extension. - name: POSTGIS_EXTENSION - value: 'Y' - - name: CPU_REQUEST - value: '50m' - - name: CPU_LIMIT - value: '200m' - - name: MEMORY_REQUEST - value: '100Mi' - - name: MEMORY_LIMIT - value: '2Gi' - - name: REPLICAS - value: '1' -objects: - - kind: Secret - apiVersion: v1 - metadata: - annotations: - template.openshift.io/expose-database_name: "{.data['database-name']}" - template.openshift.io/expose-password: "{.data['database-user-password']}" - template.openshift.io/expose-admin-password: "{.data['database-admin-password']}" - template.openshift.io/expose-admin-username: "{.data['database-user']}" - as-copy-of: sims-database - name: '${DATABASE_SERVICE_NAME}' - stringData: - database-name: '${POSTGRESQL_DATABASE}' - database-user-password: '${POSTGRESQL_PASSWORD}' - database-admin-password: '${POSTGRESQL_ADMIN_PASSWORD}' - database-user: '${POSTGRESQL_USER}' - - - kind: Service - apiVersion: v1 - metadata: - annotations: - template.openshift.io/expose-uri: postgres://{.spec.clusterIP}:{.spec.ports[?(.name=="postgresql")].port} - name: '${DATABASE_SERVICE_NAME}' - spec: - ports: - - name: postgresql - nodePort: 0 - port: 5432 - protocol: TCP - targetPort: 5432 - selector: - name: '${DATABASE_SERVICE_NAME}' - sessionAffinity: None - type: ClusterIP - status: - loadBalancer: {} - - - kind: PersistentVolumeClaim - apiVersion: v1 - metadata: - name: '${DATABASE_SERVICE_NAME}' - spec: - accessModes: - - ReadWriteMany - resources: - requests: - storage: '${VOLUME_CAPACITY}' - - kind: ImageStream - apiVersion: image.openshift.io/v1 - metadata: - name: '${IMAGE_STREAM_NAME}' - labels: - shared: 'true' - annotations: {} - spec: - lookupPolicy: - local: false - - - kind: DeploymentConfig - apiVersion: apps.openshift.io/v1 - metadata: - annotations: - template.alpha.openshift.io/wait-for-ready: 'true' - name: '${DATABASE_SERVICE_NAME}' - spec: - replicas: ${{REPLICAS}} - selector: - name: '${DATABASE_SERVICE_NAME}' - strategy: - type: Recreate - maxSurge: 50% - maxUnavailable: 0 - template: - metadata: - labels: - name: '${DATABASE_SERVICE_NAME}' - role: db - spec: - containers: - - capabilities: {} - env: - - name: POSTGRESQL_USER - valueFrom: - secretKeyRef: - key: database-user - name: '${DATABASE_SERVICE_NAME}' - - name: POSTGRESQL_PASSWORD - valueFrom: - secretKeyRef: - key: database-user-password - name: '${DATABASE_SERVICE_NAME}' - - name: POSTGRESQL_ADMIN_PASSWORD - valueFrom: - secretKeyRef: - key: database-admin-password - name: '${DATABASE_SERVICE_NAME}' - - name: POSTGRESQL_DATABASE - valueFrom: - secretKeyRef: - key: database-name - name: '${DATABASE_SERVICE_NAME}' - - name: PGCRYPTO_EXTENSION - value: 'N' - - name: POSTGIS_EXTENSION - value: 'N' - - name: PGOPTIONS - value: '-c maintenance_work_mem=128MB' - - name: PGTZ - value: '${TZ}' - image: ' ' - imagePullPolicy: IfNotPresent - livenessProbe: - initialDelaySeconds: 30 - tcpSocket: - port: 5432 - timeoutSeconds: 1 - name: postgresql - ports: - - containerPort: 5432 - protocol: TCP - readinessProbe: - exec: - command: - - '/bin/sh' - - '-i' - - '-c' - - psql -h 127.0.0.1 -U $POSTGRESQL_USER -q -d $POSTGRESQL_DATABASE -c 'SELECT 1' - initialDelaySeconds: 5 - timeoutSeconds: 1 - resources: - requests: - cpu: ${CPU_REQUEST} - memory: ${MEMORY_REQUEST} - limits: - cpu: ${CPU_LIMIT} - memory: ${MEMORY_LIMIT} - securityContext: - capabilities: {} - privileged: false - terminationMessagePath: '/dev/termination-log' - volumeMounts: - - mountPath: '/var/lib/pgsql/data' - name: '${DATABASE_SERVICE_NAME}-data' - - mountPath: '/var/run/postgresql' - name: '${DATABASE_SERVICE_NAME}-run' - dnsPolicy: ClusterFirst - restartPolicy: Always - volumes: - - name: '${DATABASE_SERVICE_NAME}-data' - persistentVolumeClaim: - claimName: '${DATABASE_SERVICE_NAME}' - - name: '${DATABASE_SERVICE_NAME}-run' - emptyDir: {} - triggers: - - imageChangeParams: - automatic: true - containerNames: - - postgresql - from: - kind: ImageStreamTag - name: '${IMAGE_STREAM_NAME}:${IMAGE_STREAM_VERSION}' - namespace: '${IMAGE_STREAM_NAMESPACE}' - lastTriggeredImage: '' - type: ImageChange - - type: ConfigChange diff --git a/database/.pipeline2/templates/db.setup.bc.yaml b/database/.pipeline2/templates/db.setup.bc.yaml deleted file mode 100644 index 73cabb44ea..0000000000 --- a/database/.pipeline2/templates/db.setup.bc.yaml +++ /dev/null @@ -1,120 +0,0 @@ -apiVersion: template.openshift.io/v1 -kind: Template -metadata: - name: sims-db-setup-bc - labels: - build: sims-db-setup -parameters: - - name: NAME - displayName: Name - description: Image name - required: true - value: sims-db-setup - - name: SUFFIX - displayName: Name Suffix - description: A suffix appended to all objects - required: true - value: '-dev' - - name: VERSION - required: true - value: '1.0' - - name: SOURCE_CONTEXT_DIR - required: true - value: database - - name: DB_SETUP_DOCKERFILE_PATH - required: true - value: './.docker/db/Dockerfile.migrate' - - name: SOURCE_REPOSITORY_URL - required: true - value: https://github.com/bcgov/biohubbc - - name: SOURCE_REPOSITORY_REF - required: false - value: dev - - name: BASE_IMAGE_URL - required: true - value: image-registry.openshift-image-registry.svc:5000/openshift/nodejs:14-ubi8 - - name: SOURCE_IMAGE_NAME - required: true - value: nodejs - - name: SOURCE_IMAGE_TAG - required: true - value: 14-ubi8 - - name: CPU_REQUEST - value: '50m' - - name: CPU_LIMIT - value: '1000m' - - name: MEMORY_REQUEST - value: '100Mi' - - name: MEMORY_LIMIT - value: '1.5Gi' -objects: - - kind: ImageStream - apiVersion: image.openshift.io/v1 - metadata: - name: ${SOURCE_IMAGE_NAME} - annotations: - description: Nodejs Base Image - labels: - shared: 'true' - spec: - lookupPolicy: - local: false - tags: - - name: ${SOURCE_IMAGE_TAG} - annotations: null - from: - kind: DockerImage - name: ${BASE_IMAGE_URL} - importPolicy: {} - referencePolicy: - type: Local - - kind: ImageStream - apiVersion: image.openshift.io/v1 - metadata: - name: '${NAME}' - annotations: - description: Nodejs Runtime Image - labels: - shared: 'true' - spec: - lookupPolicy: - local: false - - apiVersion: build.openshift.io/v1 - kind: BuildConfig - metadata: - name: '${NAME}${SUFFIX}' - labels: {} - annotations: {} - spec: - failedBuildsHistoryLimit: 5 - nodeSelector: - output: - to: - kind: ImageStreamTag - name: '${NAME}:${VERSION}' - postCommit: {} - resources: - requests: - cpu: ${CPU_REQUEST} - memory: ${MEMORY_REQUEST} - limits: - cpu: ${CPU_LIMIT} - memory: ${MEMORY_LIMIT} - runPolicy: SerialLatestOnly - source: - contextDir: '${SOURCE_CONTEXT_DIR}' - git: - uri: '${SOURCE_REPOSITORY_URL}' - ref: '${SOURCE_REPOSITORY_REF}' - type: Git - strategy: - dockerStrategy: - dockerfilePath: '${DB_SETUP_DOCKERFILE_PATH}' - from: - kind: ImageStreamTag - name: ${SOURCE_IMAGE_NAME}:${SOURCE_IMAGE_TAG} - type: Docker - successfulBuildsHistoryLimit: 5 - triggers: - - type: ConfigChange - - type: ImageChange diff --git a/database/.pipeline2/templates/db.setup.dc.yaml b/database/.pipeline2/templates/db.setup.dc.yaml deleted file mode 100644 index 2e46bda6a0..0000000000 --- a/database/.pipeline2/templates/db.setup.dc.yaml +++ /dev/null @@ -1,104 +0,0 @@ -kind: Template -apiVersion: template.openshift.io/v1 -metadata: - name: sims-db-setup-dc - labels: - build: sims-db-setup -parameters: - - name: IMAGE - description: 'Image for pod' - required: true - - name: NAME - value: sims-db-setup - - name: SUFFIX - value: '-dev' - - name: VERSION - description: Version of the application - value: '1.0.0' - - name: CHANGE_ID - description: Change id of the project. This will help to pull image stream - required: true - value: '0' - - name: DB_SERVICE_NAME - description: 'Database service name associated with deployment' - required: true - - name: DB_SCHEMA - description: 'Database schema' - required: true - - name: DB_SCHEMA_DAPI_V1 - description: 'Database api v1 schema' - required: true - - name: NODE_ENV - description: Application Environment type variable - required: true - value: 'dev' - - name: CPU_REQUEST - value: '50m' - - name: CPU_LIMIT - value: '1000m' - - name: MEMORY_REQUEST - value: '100Mi' - - name: MEMORY_LIMIT - value: '1.5Gi' -objects: - - kind: Pod - apiVersion: v1 - metadata: - name: '${NAME}' - labels: - role: setup - spec: - containers: - - name: test - image: '${IMAGE}' - resources: - requests: - cpu: ${CPU_REQUEST} - memory: ${MEMORY_REQUEST} - limits: - cpu: ${CPU_LIMIT} - memory: ${MEMORY_LIMIT} - env: - - name: DB_HOST - value: ${DB_SERVICE_NAME} - - name: DB_ADMIN - valueFrom: - secretKeyRef: - key: database-admin - name: ${DB_SERVICE_NAME} - - name: DB_ADMIN_PASS - valueFrom: - secretKeyRef: - key: database-admin-password - name: ${DB_SERVICE_NAME} - - name: DB_USER_API - valueFrom: - secretKeyRef: - key: database-user-api - name: ${DB_SERVICE_NAME} - - name: DB_USER_API_PASS - valueFrom: - secretKeyRef: - key: database-user-api-password - name: ${DB_SERVICE_NAME} - - name: DB_DATABASE - valueFrom: - secretKeyRef: - key: database-name - name: ${DB_SERVICE_NAME} - - name: DB_PORT - value: '5432' - - name: CHANGE_VERSION - value: ${CHANGE_ID} - - name: NODE_ENV - value: ${NODE_ENV} - - name: VERSION - value: ${VERSION} - - name: DB_SCHEMA - value: ${DB_SCHEMA} - - name: DB_SCHEMA_DAPI_V1 - value: ${DB_SCHEMA_DAPI_V1} - imagePullPolicy: Always - restartPolicy: Never - activeDeadlineSeconds: 900 - dnsPolicy: ClusterFirst diff --git a/database/.pipeline2/templates/db.setup.is.yaml b/database/.pipeline2/templates/db.setup.is.yaml deleted file mode 100644 index 2482ba52dd..0000000000 --- a/database/.pipeline2/templates/db.setup.is.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: template.openshift.io/v1 -kind: Template -parameters: - - name: NAME - value: sims-db-setup -objects: - - apiVersion: image.openshift.io/v1 - kind: ImageStream - metadata: - annotations: - description: Database setup image stream - labels: - shared: 'true' - generation: 0 - name: ${NAME} - spec: - lookupPolicy: - local: false From 8502e7d6472abf5997668f6c4e9666de82278948 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Mon, 5 Feb 2024 09:55:44 -0800 Subject: [PATCH 26/62] Test lazy require. ignore-skip --- .../configMaps/PipelineConfigMapSchema.js | 809 +++++++++--------- api/.pipeline/config.js | 4 +- app/.pipeline/config.js | 4 +- database/.pipeline/config.js | 4 +- 4 files changed, 418 insertions(+), 403 deletions(-) diff --git a/.pipeline/configMaps/PipelineConfigMapSchema.js b/.pipeline/configMaps/PipelineConfigMapSchema.js index c3d608005d..666c9c7148 100644 --- a/.pipeline/configMaps/PipelineConfigMapSchema.js +++ b/.pipeline/configMaps/PipelineConfigMapSchema.js @@ -1,411 +1,420 @@ -const z = require("zod"); +/** + * Returns the schema for the pipeline config map. + * + * Lazy loading `zod` as it is not defined outside of the app/api/database folders. + * + * @return {*} + */ +const getPipelineConfigMapSchema = () => { + const z = require("zod"); -const PipelineConfigMapSchema = z.object({ - name: z.string(), - version: z.string(), - module: z.object({ - db: z.string(), - api: z.string(), - app: z.string(), - }), - api: z.object({ - pr: z.object({ - build: z.object({ - namespace: z.string(), - tz: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - }), - deploy: z.object({ - namespace: z.string(), - nodeEnv: z.string(), - tz: z.string(), - backboneApiHost: z.string(), - backboneIntakePath: z.string(), - backboneArtifactIntakePath: z.string(), - backboneIntakeEnabled: z.boolean(), - bctwApiHost: z.string(), - critterbaseApiHost: z.string(), - elasticsearchURL: z.string(), - elasticsearchTaxonomyIndex: z.string(), - s3KeyPrefix: z.string(), - logLevel: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - replicasMax: z.string(), - }), - }), - dev: z.object({ - build: z.object({ - namespace: z.string(), - tz: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - }), - deploy: z.object({ - namespace: z.string(), - nodeEnv: z.string(), - staticApiUrl: z.string(), - staticAppUrl: z.string(), - tz: z.string(), - backboneApiHost: z.string(), - backboneIntakePath: z.string(), - backboneArtifactIntakePath: z.string(), - backboneIntakeEnabled: z.boolean(), - bctwApiHost: z.string(), - critterbaseApiHost: z.string(), - elasticsearchURL: z.string(), - elasticsearchTaxonomyIndex: z.string(), - s3KeyPrefix: z.string(), - logLevel: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - replicasMax: z.string(), - }), - }), - test: z.object({ - build: z.object({ - namespace: z.string(), - tz: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - }), - deploy: z.object({ - namespace: z.string(), - nodeEnv: z.string(), - staticApiUrl: z.string(), - staticAppUrl: z.string(), - tz: z.string(), - backboneApiHost: z.string(), - backboneIntakePath: z.string(), - backboneArtifactIntakePath: z.string(), - backboneIntakeEnabled: z.boolean(), - bctwApiHost: z.string(), - critterbaseApiHost: z.string(), - elasticsearchURL: z.string(), - elasticsearchTaxonomyIndex: z.string(), - s3KeyPrefix: z.string(), - logLevel: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - replicasMax: z.string(), - }), - }), - prod: z.object({ - build: z.object({ - namespace: z.string(), - tz: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - }), - deploy: z.object({ - namespace: z.string(), - nodeEnv: z.string(), - staticApiUrl: z.string(), - staticAppUrl: z.string(), - staticAppVanityUrl: z.string(), - tz: z.string(), - backboneApiHost: z.string(), - backboneIntakePath: z.string(), - backboneArtifactIntakePath: z.string(), - backboneIntakeEnabled: z.boolean(), - bctwApiHost: z.string(), - critterbaseApiHost: z.string(), - elasticsearchURL: z.string(), - elasticsearchTaxonomyIndex: z.string(), - s3KeyPrefix: z.string(), - logLevel: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - replicasMax: z.string(), - }), - }), - }), - app: z.object({ - pr: z.object({ - build: z.object({ - namespace: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - }), - deploy: z.object({ - namespace: z.string(), - nodeEnv: z.string(), - siteminderLogoutURL: z.string(), - maxUploadNumFiles: z.number(), - maxUploadFileSize: z.number(), - biohubFeatureFlag: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - replicasMax: z.string(), - }), - }), - dev: z.object({ - build: z.object({ - namespace: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - }), - deploy: z.object({ - namespace: z.string(), - nodeEnv: z.string(), - staticApiUrl: z.string(), - staticAppUrl: z.string(), - siteminderLogoutURL: z.string(), - maxUploadNumFiles: z.number(), - maxUploadFileSize: z.number(), - biohubFeatureFlag: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - replicasMax: z.string(), - }), + return z.object({ + name: z.string(), + version: z.string(), + module: z.object({ + db: z.string(), + api: z.string(), + app: z.string(), }), - test: z.object({ - build: z.object({ - namespace: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - }), - deploy: z.object({ - namespace: z.string(), - nodeEnv: z.string(), - staticApiUrl: z.string(), - staticAppUrl: z.string(), - siteminderLogoutURL: z.string(), - maxUploadNumFiles: z.number(), - maxUploadFileSize: z.number(), - biohubFeatureFlag: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - replicasMax: z.string(), + api: z.object({ + pr: z.object({ + build: z.object({ + namespace: z.string(), + tz: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + }), + deploy: z.object({ + namespace: z.string(), + nodeEnv: z.string(), + tz: z.string(), + backboneApiHost: z.string(), + backboneIntakePath: z.string(), + backboneArtifactIntakePath: z.string(), + backboneIntakeEnabled: z.boolean(), + bctwApiHost: z.string(), + critterbaseApiHost: z.string(), + elasticsearchURL: z.string(), + elasticsearchTaxonomyIndex: z.string(), + s3KeyPrefix: z.string(), + logLevel: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + replicasMax: z.string(), + }), + }), + dev: z.object({ + build: z.object({ + namespace: z.string(), + tz: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + }), + deploy: z.object({ + namespace: z.string(), + nodeEnv: z.string(), + staticApiUrl: z.string(), + staticAppUrl: z.string(), + tz: z.string(), + backboneApiHost: z.string(), + backboneIntakePath: z.string(), + backboneArtifactIntakePath: z.string(), + backboneIntakeEnabled: z.boolean(), + bctwApiHost: z.string(), + critterbaseApiHost: z.string(), + elasticsearchURL: z.string(), + elasticsearchTaxonomyIndex: z.string(), + s3KeyPrefix: z.string(), + logLevel: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + replicasMax: z.string(), + }), + }), + test: z.object({ + build: z.object({ + namespace: z.string(), + tz: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + }), + deploy: z.object({ + namespace: z.string(), + nodeEnv: z.string(), + staticApiUrl: z.string(), + staticAppUrl: z.string(), + tz: z.string(), + backboneApiHost: z.string(), + backboneIntakePath: z.string(), + backboneArtifactIntakePath: z.string(), + backboneIntakeEnabled: z.boolean(), + bctwApiHost: z.string(), + critterbaseApiHost: z.string(), + elasticsearchURL: z.string(), + elasticsearchTaxonomyIndex: z.string(), + s3KeyPrefix: z.string(), + logLevel: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + replicasMax: z.string(), + }), + }), + prod: z.object({ + build: z.object({ + namespace: z.string(), + tz: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + }), + deploy: z.object({ + namespace: z.string(), + nodeEnv: z.string(), + staticApiUrl: z.string(), + staticAppUrl: z.string(), + staticAppVanityUrl: z.string(), + tz: z.string(), + backboneApiHost: z.string(), + backboneIntakePath: z.string(), + backboneArtifactIntakePath: z.string(), + backboneIntakeEnabled: z.boolean(), + bctwApiHost: z.string(), + critterbaseApiHost: z.string(), + elasticsearchURL: z.string(), + elasticsearchTaxonomyIndex: z.string(), + s3KeyPrefix: z.string(), + logLevel: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + replicasMax: z.string(), + }), }), }), - prod: z.object({ - build: z.object({ - namespace: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - }), - deploy: z.object({ - namespace: z.string(), - nodeEnv: z.string(), - staticApiUrl: z.string(), - staticAppUrl: z.string(), - staticAppVanityUrl: z.string(), - siteminderLogoutURL: z.string(), - maxUploadNumFiles: z.number(), - maxUploadFileSize: z.number(), - biohubFeatureFlag: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - replicasMax: z.string(), + app: z.object({ + pr: z.object({ + build: z.object({ + namespace: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + }), + deploy: z.object({ + namespace: z.string(), + nodeEnv: z.string(), + siteminderLogoutURL: z.string(), + maxUploadNumFiles: z.number(), + maxUploadFileSize: z.number(), + biohubFeatureFlag: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + replicasMax: z.string(), + }), + }), + dev: z.object({ + build: z.object({ + namespace: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + }), + deploy: z.object({ + namespace: z.string(), + nodeEnv: z.string(), + staticApiUrl: z.string(), + staticAppUrl: z.string(), + siteminderLogoutURL: z.string(), + maxUploadNumFiles: z.number(), + maxUploadFileSize: z.number(), + biohubFeatureFlag: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + replicasMax: z.string(), + }), + }), + test: z.object({ + build: z.object({ + namespace: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + }), + deploy: z.object({ + namespace: z.string(), + nodeEnv: z.string(), + staticApiUrl: z.string(), + staticAppUrl: z.string(), + siteminderLogoutURL: z.string(), + maxUploadNumFiles: z.number(), + maxUploadFileSize: z.number(), + biohubFeatureFlag: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + replicasMax: z.string(), + }), + }), + prod: z.object({ + build: z.object({ + namespace: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + }), + deploy: z.object({ + namespace: z.string(), + nodeEnv: z.string(), + staticApiUrl: z.string(), + staticAppUrl: z.string(), + staticAppVanityUrl: z.string(), + siteminderLogoutURL: z.string(), + maxUploadNumFiles: z.number(), + maxUploadFileSize: z.number(), + biohubFeatureFlag: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + replicasMax: z.string(), + }), }), }), - }), - database: z.object({ - pr: z.object({ - build: z.object({ - namespace: z.string(), - tz: z.string(), - sourceContextDir: z.string(), - dbSetupDockerfilePath: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - }), - deploy: z.object({ - namespace: z.string(), - nodeEnv: z.string(), - tz: z.string(), - volumeCapacity: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), + database: z.object({ + pr: z.object({ + build: z.object({ + namespace: z.string(), + tz: z.string(), + sourceContextDir: z.string(), + dbSetupDockerfilePath: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + }), + deploy: z.object({ + namespace: z.string(), + nodeEnv: z.string(), + tz: z.string(), + volumeCapacity: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + }), + }), + dev: z.object({ + build: z.object({ + namespace: z.string(), + tz: z.string(), + sourceContextDir: z.string(), + dbSetupDockerfilePath: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + }), + deploy: z.object({ + namespace: z.string(), + nodeEnv: z.string(), + tz: z.string(), + volumeCapacity: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + }), + }), + test: z.object({ + build: z.object({ + namespace: z.string(), + tz: z.string(), + sourceContextDir: z.string(), + dbSetupDockerfilePath: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + }), + deploy: z.object({ + namespace: z.string(), + nodeEnv: z.string(), + tz: z.string(), + volumeCapacity: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + }), + }), + prod: z.object({ + build: z.object({ + namespace: z.string(), + tz: z.string(), + sourceContextDir: z.string(), + dbSetupDockerfilePath: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + }), + deploy: z.object({ + namespace: z.string(), + nodeEnv: z.string(), + tz: z.string(), + volumeCapacity: z.string(), + cpuRequest: z.string(), + cpuLimit: z.string(), + memoryRequest: z.string(), + memoryLimit: z.string(), + replicas: z.string(), + }), }), }), - dev: z.object({ - build: z.object({ - namespace: z.string(), - tz: z.string(), - sourceContextDir: z.string(), - dbSetupDockerfilePath: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - }), - deploy: z.object({ - namespace: z.string(), - nodeEnv: z.string(), - tz: z.string(), - volumeCapacity: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - }), - }), - test: z.object({ - build: z.object({ - namespace: z.string(), - tz: z.string(), - sourceContextDir: z.string(), - dbSetupDockerfilePath: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - }), - deploy: z.object({ - namespace: z.string(), - nodeEnv: z.string(), - tz: z.string(), - volumeCapacity: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - }), - }), - prod: z.object({ - build: z.object({ - namespace: z.string(), - tz: z.string(), - sourceContextDir: z.string(), - dbSetupDockerfilePath: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - }), - deploy: z.object({ - namespace: z.string(), - nodeEnv: z.string(), - tz: z.string(), - volumeCapacity: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - }), - }), - }), - sso: z.object({ - pr: z.object({ - host: z.string(), - realm: z.string(), - clientId: z.string(), - keycloakSecret: z.string(), - serviceClient: z.object({ - serviceClientName: z.string(), - keycloakSecretServiceClientPasswordKey: z.string(), - }), - cssApi: z.object({ - cssApiTokenUrl: z.string(), - cssApiClientId: z.string(), - cssApiHost: z.string(), - keycloakSecretCssApiSecretKey: z.string(), - cssApiEnvironment: z.string(), - }), - }), - dev: z.object({ - host: z.string(), - realm: z.string(), - clientId: z.string(), - keycloakSecret: z.string(), - serviceClient: z.object({ - serviceClientName: z.string(), - keycloakSecretServiceClientPasswordKey: z.string(), - }), - cssApi: z.object({ - cssApiTokenUrl: z.string(), - cssApiClientId: z.string(), - cssApiHost: z.string(), - keycloakSecretCssApiSecretKey: z.string(), - cssApiEnvironment: z.string(), - }), - }), - test: z.object({ - host: z.string(), - realm: z.string(), - clientId: z.string(), - keycloakSecret: z.string(), - serviceClient: z.object({ - serviceClientName: z.string(), - keycloakSecretServiceClientPasswordKey: z.string(), - }), - cssApi: z.object({ - cssApiTokenUrl: z.string(), - cssApiClientId: z.string(), - cssApiHost: z.string(), - keycloakSecretCssApiSecretKey: z.string(), - cssApiEnvironment: z.string(), - }), - }), - prod: z.object({ - host: z.string(), - realm: z.string(), - clientId: z.string(), - keycloakSecret: z.string(), - serviceClient: z.object({ - serviceClientName: z.string(), - keycloakSecretServiceClientPasswordKey: z.string(), - }), - cssApi: z.object({ - cssApiTokenUrl: z.string(), - cssApiClientId: z.string(), - cssApiHost: z.string(), - keycloakSecretCssApiSecretKey: z.string(), - cssApiEnvironment: z.string(), + sso: z.object({ + pr: z.object({ + host: z.string(), + realm: z.string(), + clientId: z.string(), + keycloakSecret: z.string(), + serviceClient: z.object({ + serviceClientName: z.string(), + keycloakSecretServiceClientPasswordKey: z.string(), + }), + cssApi: z.object({ + cssApiTokenUrl: z.string(), + cssApiClientId: z.string(), + cssApiHost: z.string(), + keycloakSecretCssApiSecretKey: z.string(), + cssApiEnvironment: z.string(), + }), + }), + dev: z.object({ + host: z.string(), + realm: z.string(), + clientId: z.string(), + keycloakSecret: z.string(), + serviceClient: z.object({ + serviceClientName: z.string(), + keycloakSecretServiceClientPasswordKey: z.string(), + }), + cssApi: z.object({ + cssApiTokenUrl: z.string(), + cssApiClientId: z.string(), + cssApiHost: z.string(), + keycloakSecretCssApiSecretKey: z.string(), + cssApiEnvironment: z.string(), + }), + }), + test: z.object({ + host: z.string(), + realm: z.string(), + clientId: z.string(), + keycloakSecret: z.string(), + serviceClient: z.object({ + serviceClientName: z.string(), + keycloakSecretServiceClientPasswordKey: z.string(), + }), + cssApi: z.object({ + cssApiTokenUrl: z.string(), + cssApiClientId: z.string(), + cssApiHost: z.string(), + keycloakSecretCssApiSecretKey: z.string(), + cssApiEnvironment: z.string(), + }), + }), + prod: z.object({ + host: z.string(), + realm: z.string(), + clientId: z.string(), + keycloakSecret: z.string(), + serviceClient: z.object({ + serviceClientName: z.string(), + keycloakSecretServiceClientPasswordKey: z.string(), + }), + cssApi: z.object({ + cssApiTokenUrl: z.string(), + cssApiClientId: z.string(), + cssApiHost: z.string(), + keycloakSecretCssApiSecretKey: z.string(), + cssApiEnvironment: z.string(), + }), }), }), - }), -}); + }); +}; -module.exports = exports = { PipelineConfigMapSchema }; +module.exports = exports = { getPipelineConfigMapSchema }; diff --git a/api/.pipeline/config.js b/api/.pipeline/config.js index ef214780ad..c98edc7582 100644 --- a/api/.pipeline/config.js +++ b/api/.pipeline/config.js @@ -1,7 +1,9 @@ 'use strict'; const PipelineCli = require('pipeline-cli'); -const { PipelineConfigMapSchema } = require('../../.pipeline/configMaps/PipelineConfigMapSchema'); +const { getPipelineConfigMapSchema } = require('../../.pipeline/configMaps/PipelineConfigMapSchema'); + +const PipelineConfigMapSchema = getPipelineConfigMapSchema(); // Options passed in from the git action const rawOptions = PipelineCli.Util.parseArguments(); diff --git a/app/.pipeline/config.js b/app/.pipeline/config.js index bdc04d8b98..69a5563566 100644 --- a/app/.pipeline/config.js +++ b/app/.pipeline/config.js @@ -1,7 +1,9 @@ 'use strict'; const PipelineCli = require('pipeline-cli'); -const { PipelineConfigMapSchema } = require('../../.pipeline/configMaps/PipelineConfigMapSchema'); +const { getPipelineConfigMapSchema } = require('../../.pipeline/configMaps/PipelineConfigMapSchema'); + +const PipelineConfigMapSchema = getPipelineConfigMapSchema(); // Options passed in from the git action const rawOptions = PipelineCli.Util.parseArguments(); diff --git a/database/.pipeline/config.js b/database/.pipeline/config.js index 4a7d3f83cb..9c628c2155 100644 --- a/database/.pipeline/config.js +++ b/database/.pipeline/config.js @@ -1,7 +1,9 @@ 'use strict'; const PipelineCli = require('pipeline-cli'); -const { PipelineConfigMapSchema } = require('../../.pipeline/configMaps/PipelineConfigMapSchema'); +const { getPipelineConfigMapSchema } = require('../../.pipeline/configMaps/PipelineConfigMapSchema'); + +const PipelineConfigMapSchema = getPipelineConfigMapSchema(); // Options passed in from the git action const rawOptions = PipelineCli.Util.parseArguments(); From 57546f28ecbfe36f219f235d2dad2a7efd8aadaa Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Mon, 5 Feb 2024 10:26:23 -0800 Subject: [PATCH 27/62] Remove zod schema --- .../configMaps/PipelineConfigMapSchema.js | 420 ------------------ .pipeline/configMaps/README.md | 6 +- .pipeline/configMaps/sims-configmap.json | 407 ----------------- api/.pipeline/config.js | 5 +- app/.pipeline/config.js | 5 +- database/.pipeline/config.js | 5 +- 6 files changed, 5 insertions(+), 843 deletions(-) delete mode 100644 .pipeline/configMaps/PipelineConfigMapSchema.js delete mode 100644 .pipeline/configMaps/sims-configmap.json diff --git a/.pipeline/configMaps/PipelineConfigMapSchema.js b/.pipeline/configMaps/PipelineConfigMapSchema.js deleted file mode 100644 index 666c9c7148..0000000000 --- a/.pipeline/configMaps/PipelineConfigMapSchema.js +++ /dev/null @@ -1,420 +0,0 @@ -/** - * Returns the schema for the pipeline config map. - * - * Lazy loading `zod` as it is not defined outside of the app/api/database folders. - * - * @return {*} - */ -const getPipelineConfigMapSchema = () => { - const z = require("zod"); - - return z.object({ - name: z.string(), - version: z.string(), - module: z.object({ - db: z.string(), - api: z.string(), - app: z.string(), - }), - api: z.object({ - pr: z.object({ - build: z.object({ - namespace: z.string(), - tz: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - }), - deploy: z.object({ - namespace: z.string(), - nodeEnv: z.string(), - tz: z.string(), - backboneApiHost: z.string(), - backboneIntakePath: z.string(), - backboneArtifactIntakePath: z.string(), - backboneIntakeEnabled: z.boolean(), - bctwApiHost: z.string(), - critterbaseApiHost: z.string(), - elasticsearchURL: z.string(), - elasticsearchTaxonomyIndex: z.string(), - s3KeyPrefix: z.string(), - logLevel: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - replicasMax: z.string(), - }), - }), - dev: z.object({ - build: z.object({ - namespace: z.string(), - tz: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - }), - deploy: z.object({ - namespace: z.string(), - nodeEnv: z.string(), - staticApiUrl: z.string(), - staticAppUrl: z.string(), - tz: z.string(), - backboneApiHost: z.string(), - backboneIntakePath: z.string(), - backboneArtifactIntakePath: z.string(), - backboneIntakeEnabled: z.boolean(), - bctwApiHost: z.string(), - critterbaseApiHost: z.string(), - elasticsearchURL: z.string(), - elasticsearchTaxonomyIndex: z.string(), - s3KeyPrefix: z.string(), - logLevel: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - replicasMax: z.string(), - }), - }), - test: z.object({ - build: z.object({ - namespace: z.string(), - tz: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - }), - deploy: z.object({ - namespace: z.string(), - nodeEnv: z.string(), - staticApiUrl: z.string(), - staticAppUrl: z.string(), - tz: z.string(), - backboneApiHost: z.string(), - backboneIntakePath: z.string(), - backboneArtifactIntakePath: z.string(), - backboneIntakeEnabled: z.boolean(), - bctwApiHost: z.string(), - critterbaseApiHost: z.string(), - elasticsearchURL: z.string(), - elasticsearchTaxonomyIndex: z.string(), - s3KeyPrefix: z.string(), - logLevel: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - replicasMax: z.string(), - }), - }), - prod: z.object({ - build: z.object({ - namespace: z.string(), - tz: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - }), - deploy: z.object({ - namespace: z.string(), - nodeEnv: z.string(), - staticApiUrl: z.string(), - staticAppUrl: z.string(), - staticAppVanityUrl: z.string(), - tz: z.string(), - backboneApiHost: z.string(), - backboneIntakePath: z.string(), - backboneArtifactIntakePath: z.string(), - backboneIntakeEnabled: z.boolean(), - bctwApiHost: z.string(), - critterbaseApiHost: z.string(), - elasticsearchURL: z.string(), - elasticsearchTaxonomyIndex: z.string(), - s3KeyPrefix: z.string(), - logLevel: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - replicasMax: z.string(), - }), - }), - }), - app: z.object({ - pr: z.object({ - build: z.object({ - namespace: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - }), - deploy: z.object({ - namespace: z.string(), - nodeEnv: z.string(), - siteminderLogoutURL: z.string(), - maxUploadNumFiles: z.number(), - maxUploadFileSize: z.number(), - biohubFeatureFlag: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - replicasMax: z.string(), - }), - }), - dev: z.object({ - build: z.object({ - namespace: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - }), - deploy: z.object({ - namespace: z.string(), - nodeEnv: z.string(), - staticApiUrl: z.string(), - staticAppUrl: z.string(), - siteminderLogoutURL: z.string(), - maxUploadNumFiles: z.number(), - maxUploadFileSize: z.number(), - biohubFeatureFlag: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - replicasMax: z.string(), - }), - }), - test: z.object({ - build: z.object({ - namespace: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - }), - deploy: z.object({ - namespace: z.string(), - nodeEnv: z.string(), - staticApiUrl: z.string(), - staticAppUrl: z.string(), - siteminderLogoutURL: z.string(), - maxUploadNumFiles: z.number(), - maxUploadFileSize: z.number(), - biohubFeatureFlag: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - replicasMax: z.string(), - }), - }), - prod: z.object({ - build: z.object({ - namespace: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - }), - deploy: z.object({ - namespace: z.string(), - nodeEnv: z.string(), - staticApiUrl: z.string(), - staticAppUrl: z.string(), - staticAppVanityUrl: z.string(), - siteminderLogoutURL: z.string(), - maxUploadNumFiles: z.number(), - maxUploadFileSize: z.number(), - biohubFeatureFlag: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - replicasMax: z.string(), - }), - }), - }), - database: z.object({ - pr: z.object({ - build: z.object({ - namespace: z.string(), - tz: z.string(), - sourceContextDir: z.string(), - dbSetupDockerfilePath: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - }), - deploy: z.object({ - namespace: z.string(), - nodeEnv: z.string(), - tz: z.string(), - volumeCapacity: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - }), - }), - dev: z.object({ - build: z.object({ - namespace: z.string(), - tz: z.string(), - sourceContextDir: z.string(), - dbSetupDockerfilePath: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - }), - deploy: z.object({ - namespace: z.string(), - nodeEnv: z.string(), - tz: z.string(), - volumeCapacity: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - }), - }), - test: z.object({ - build: z.object({ - namespace: z.string(), - tz: z.string(), - sourceContextDir: z.string(), - dbSetupDockerfilePath: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - }), - deploy: z.object({ - namespace: z.string(), - nodeEnv: z.string(), - tz: z.string(), - volumeCapacity: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - }), - }), - prod: z.object({ - build: z.object({ - namespace: z.string(), - tz: z.string(), - sourceContextDir: z.string(), - dbSetupDockerfilePath: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - }), - deploy: z.object({ - namespace: z.string(), - nodeEnv: z.string(), - tz: z.string(), - volumeCapacity: z.string(), - cpuRequest: z.string(), - cpuLimit: z.string(), - memoryRequest: z.string(), - memoryLimit: z.string(), - replicas: z.string(), - }), - }), - }), - sso: z.object({ - pr: z.object({ - host: z.string(), - realm: z.string(), - clientId: z.string(), - keycloakSecret: z.string(), - serviceClient: z.object({ - serviceClientName: z.string(), - keycloakSecretServiceClientPasswordKey: z.string(), - }), - cssApi: z.object({ - cssApiTokenUrl: z.string(), - cssApiClientId: z.string(), - cssApiHost: z.string(), - keycloakSecretCssApiSecretKey: z.string(), - cssApiEnvironment: z.string(), - }), - }), - dev: z.object({ - host: z.string(), - realm: z.string(), - clientId: z.string(), - keycloakSecret: z.string(), - serviceClient: z.object({ - serviceClientName: z.string(), - keycloakSecretServiceClientPasswordKey: z.string(), - }), - cssApi: z.object({ - cssApiTokenUrl: z.string(), - cssApiClientId: z.string(), - cssApiHost: z.string(), - keycloakSecretCssApiSecretKey: z.string(), - cssApiEnvironment: z.string(), - }), - }), - test: z.object({ - host: z.string(), - realm: z.string(), - clientId: z.string(), - keycloakSecret: z.string(), - serviceClient: z.object({ - serviceClientName: z.string(), - keycloakSecretServiceClientPasswordKey: z.string(), - }), - cssApi: z.object({ - cssApiTokenUrl: z.string(), - cssApiClientId: z.string(), - cssApiHost: z.string(), - keycloakSecretCssApiSecretKey: z.string(), - cssApiEnvironment: z.string(), - }), - }), - prod: z.object({ - host: z.string(), - realm: z.string(), - clientId: z.string(), - keycloakSecret: z.string(), - serviceClient: z.object({ - serviceClientName: z.string(), - keycloakSecretServiceClientPasswordKey: z.string(), - }), - cssApi: z.object({ - cssApiTokenUrl: z.string(), - cssApiClientId: z.string(), - cssApiHost: z.string(), - keycloakSecretCssApiSecretKey: z.string(), - cssApiEnvironment: z.string(), - }), - }), - }), - }); -}; - -module.exports = exports = { getPipelineConfigMapSchema }; diff --git a/.pipeline/configMaps/README.md b/.pipeline/configMaps/README.md index ace5d35099..44d707595c 100644 --- a/.pipeline/configMaps/README.md +++ b/.pipeline/configMaps/README.md @@ -1,10 +1,8 @@ # Openshift Config Map -`sims-pipeline-config.json` is a sample of the config map that should be created in each openshift environment. +`sims-pipeline-config.json` is a working sample of the config map that should be created in each openshift environment. -`sims.configmap.yaml` is a fully defined config map yaml which can be imported into OpenShift when first creating the config map. Edits can be made against the existing config map in OpenShift, but should also be captured here for future use and backup. - -The config map is validated at build and deployment time against the `PipelineConfigMapSchema` zod schema, which should always be kept up to date. See `configMapSchema.js`. +Note: The exact values in the sample config map may fall out of sync with what is in OpenShift, as changes are made organically directly in OpenShift. **Note: Config maps should never contain secrets, passwords, or other sensitive values. They are not protected in OpenShift and their values may appear in logs, etc. Sensitive data should always be stored in Openshift secrets.** diff --git a/.pipeline/configMaps/sims-configmap.json b/.pipeline/configMaps/sims-configmap.json deleted file mode 100644 index 2f7c804fce..0000000000 --- a/.pipeline/configMaps/sims-configmap.json +++ /dev/null @@ -1,407 +0,0 @@ -{ - "name": "sims", - "version": "1.0.0", - "module": { - "db": "sims-db", - "api": "sims-api", - "app": "sims-app" - }, - "api": { - "pr": { - "build": { - "namespace": "af2668-tools", - "tz": "America/Vancouver", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "3Gi" - }, - "deploy": { - "namespace": "af2668-dev", - "nodeEnv": "development", - "tz": "America/Vancouver", - "backboneApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", - "backboneIntakePath": "/api/dwc/submission/queue", - "backboneArtifactIntakePath": "/api/artifact/intake", - "backboneIntakeEnabled": false, - "bctwApiHost": "https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca", - "critterbaseApiHost": "https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api", - "elasticsearchURL": "http://es01.a0ec71-dev:9200", - "elasticsearchTaxonomyIndex": "taxonomy_3.0.0", - "s3KeyPrefix": "sims-pr", - "logLevel": "debug", - "cpuRequest": "50m", - "cpuLimit": "400m", - "memoryRequest": "100Mi", - "memoryLimit": "2Gi", - "replicas": "1", - "replicasMax": "2" - } - }, - "dev": { - "build": { - "namespace": "af2668-tools", - "tz": "America/Vancouver", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "3Gi" - }, - "deploy": { - "namespace": "af2668-dev", - "nodeEnv": "development", - "staticApiUrl": "api-dev-sims.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "dev-sims.apps.silver.devops.gov.bc.ca", - "tz": "America/Vancouver", - "backboneApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", - "backboneIntakePath": "/api/dwc/submission/queue", - "backboneArtifactIntakePath": "/api/artifact/intake", - "backboneIntakeEnabled": false, - "bctwApiHost": "https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca", - "critterbaseApiHost": "https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api", - "elasticsearchURL": "http://es01.a0ec71-dev:9200", - "elasticsearchTaxonomyIndex": "taxonomy_3.0.0", - "s3KeyPrefix": "sims", - "logLevel": "debug", - "cpuRequest": "50m", - "cpuLimit": "400m", - "memoryRequest": "100Mi", - "memoryLimit": "2Gi", - "replicas": "1", - "replicasMax": "2" - } - }, - "test": { - "build": { - "namespace": "af2668-tools", - "tz": "America/Vancouver", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "3Gi" - }, - "deploy": { - "namespace": "af2668-test", - "nodeEnv": "production", - "staticApiUrl": "api-test-sims.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "test-sims.apps.silver.devops.gov.bc.ca", - "tz": "America/Vancouver", - "backboneApiHost": "https://api-test-biohub-platform.apps.silver.devops.gov.bc.ca", - "backboneIntakePath": "/api/dwc/submission/queue", - "backboneArtifactIntakePath": "/api/artifact/intake", - "backboneIntakeEnabled": false, - "bctwApiHost": "https://moe-bctw-api-test.apps.silver.devops.gov.bc.ca", - "critterbaseApiHost": "https://moe-critterbase-api-test.apps.silver.devops.gov.bc.ca/api", - "elasticsearchURL": "http://es01.a0ec71-dev:9200", - "elasticsearchTaxonomyIndex": "taxonomy_3.0.0", - "s3KeyPrefix": "sims", - "logLevel": "info", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "3Gi", - "replicas": "2", - "replicasMax": "4" - } - }, - "prod": { - "build": { - "namespace": "af2668-tools", - "tz": "America/Vancouver", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "3Gi" - }, - "deploy": { - "namespace": "af2668-prod", - "nodeEnv": "production", - "staticApiUrl": "api-sims.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "sims.apps.silver.devops.gov.bc.ca", - "staticAppVanityUrl": "sims.nrs.gov.bc.ca", - "tz": "America/Vancouver", - "backboneApiHost": "https://api-biohub-platform.apps.silver.devops.gov.bc.ca", - "backboneIntakePath": "/api/dwc/submission/queue", - "backboneArtifactIntakePath": "/api/artifact/intake", - "backboneIntakeEnabled": false, - "bctwApiHost": "https://moe-bctw-api-prod.apps.silver.devops.gov.bc.ca", - "critterbaseApiHost": "https://moe-critterbase-api-prod.apps.silver.devops.gov.bc.ca/api", - "elasticsearchURL": "http://es01.a0ec71-prod:9200", - "elasticsearchTaxonomyIndex": "taxonomy_3.0.0", - "s3KeyPrefix": "sims", - "logLevel": "warn", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "3Gi", - "replicas": "2", - "replicasMax": "4" - } - } - }, - "app": { - "pr": { - "build": { - "namespace": "af2668-tools", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "5Gi" - }, - "deploy": { - "namespace": "af2668-dev", - "nodeEnv": "development", - "siteminderLogoutURL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", - "maxUploadNumFiles": 10, - "maxUploadFileSize": 52428800, - "biohubFeatureFlag": "true", - "cpuRequest": "50m", - "cpuLimit": "200m", - "memoryRequest": "100Mi", - "memoryLimit": "333Mi", - "replicas": "1", - "replicasMax": "1" - } - }, - "dev": { - "build": { - "namespace": "af2668-tools", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "5Gi" - }, - "deploy": { - "namespace": "af2668-dev", - "nodeEnv": "development", - "staticApiUrl": "api-dev-sims.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "dev-sims.apps.silver.devops.gov.bc.ca", - "siteminderLogoutURL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", - "maxUploadNumFiles": 10, - "maxUploadFileSize": 52428800, - "biohubFeatureFlag": "true", - "cpuRequest": "50m", - "cpuLimit": "200m", - "memoryRequest": "100Mi", - "memoryLimit": "333Mi", - "replicas": "1", - "replicasMax": "1" - } - }, - "test": { - "build": { - "namespace": "af2668-tools", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "5Gi" - }, - "deploy": { - "namespace": "af2668-test", - "nodeEnv": "production", - "staticApiUrl": "api-test-sims.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "test-sims.apps.silver.devops.gov.bc.ca", - "siteminderLogoutURL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", - "maxUploadNumFiles": 10, - "maxUploadFileSize": 52428800, - "biohubFeatureFlag": "false", - "cpuRequest": "50m", - "cpuLimit": "500m", - "memoryRequest": "100Mi", - "memoryLimit": "500Mi", - "replicas": "2", - "replicasMax": "3" - } - }, - "prod": { - "build": { - "namespace": "af2668-tools", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "5Gi" - }, - "deploy": { - "namespace": "af2668-prod", - "nodeEnv": "production", - "staticApiUrl": "api-sims.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "sims.apps.silver.devops.gov.bc.ca", - "staticAppVanityUrl": "sims.nrs.gov.bc.ca", - "siteminderLogoutURL": "https://logon7.gov.bc.ca/clp-cgi/logoff.cgi", - "maxUploadNumFiles": 10, - "maxUploadFileSize": 52428800, - "biohubFeatureFlag": "false", - "cpuRequest": "50m", - "cpuLimit": "500m", - "memoryRequest": "100Mi", - "memoryLimit": "500Mi", - "replicas": "2", - "replicasMax": "3" - } - } - }, - "database": { - "pr": { - "build": { - "namespace": "af2668-tools", - "tz": "America/Vancouver", - "sourceContextDir": "database", - "dbSetupDockerfilePath": "./.docker/db/Dockerfile.setup", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "1.5Gi" - }, - "deploy": { - "namespace": "af2668-dev", - "nodeEnv": "development", - "tz": "America/Vancouver", - "volumeCapacity": "500Mi", - "cpuRequest": "50m", - "cpuLimit": "400m", - "memoryRequest": "100Mi", - "memoryLimit": "2Gi", - "replicas": "1" - } - }, - "dev": { - "build": { - "namespace": "af2668-tools", - "tz": "America/Vancouver", - "sourceContextDir": "database", - "dbSetupDockerfilePath": "./.docker/db/Dockerfile.setup", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "1.5Gi" - }, - "deploy": { - "namespace": "af2668-dev", - "nodeEnv": "development", - "tz": "America/Vancouver", - "volumeCapacity": "3Gi", - "cpuRequest": "50m", - "cpuLimit": "400m", - "memoryRequest": "100Mi", - "memoryLimit": "2Gi", - "replicas": "1" - } - }, - "test": { - "build": { - "namespace": "af2668-tools", - "tz": "America/Vancouver", - "sourceContextDir": "database", - "dbSetupDockerfilePath": "./.docker/db/Dockerfile.migrate", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "1.5Gi" - }, - "deploy": { - "namespace": "af2668-test", - "nodeEnv": "production", - "tz": "America/Vancouver", - "volumeCapacity": "3Gi", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "3Gi", - "replicas": "1" - } - }, - "prod": { - "build": { - "namespace": "af2668-tools", - "tz": "America/Vancouver", - "sourceContextDir": "database", - "dbSetupDockerfilePath": "./.docker/db/Dockerfile.migrate", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "1.5Gi" - }, - "deploy": { - "namespace": "af2668-prod", - "nodeEnv": "production", - "tz": "America/Vancouver", - "volumeCapacity": "5Gi", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "3Gi", - "replicas": "1" - } - } - }, - "sso": { - "pr": { - "host": "https://dev.loginproxy.gov.bc.ca/auth", - "realm": "standard", - "clientId": "sims-4461", - "keycloakSecret": "keycloak", - "serviceClient": { - "serviceClientName": "sims-svc-4464", - "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" - }, - "cssApi": { - "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", - "cssApiClientId": "service-account-team-1190-4229", - "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", - "keycloakSecretCssApiSecretKey": "css_api_client_secret", - "cssApiEnvironment": "dev" - } - }, - "dev": { - "host": "https://dev.loginproxy.gov.bc.ca/auth", - "realm": "standard", - "clientId": "sims-4461", - "keycloakSecret": "keycloak", - "serviceClient": { - "serviceClientName": "sims-svc-4464", - "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" - }, - "cssApi": { - "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", - "cssApiClientId": "service-account-team-1190-4229", - "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", - "keycloakSecretCssApiSecretKey": "css_api_client_secret", - "cssApiEnvironment": "dev" - } - }, - "test": { - "host": "https://test.loginproxy.gov.bc.ca/auth", - "realm": "standard", - "clientId": "sims-4461", - "keycloakSecret": "keycloak", - "serviceClient": { - "serviceClientName": "sims-svc-4464", - "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" - }, - "cssApi": { - "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", - "cssApiClientId": "service-account-team-1190-4229", - "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", - "keycloakSecretCssApiSecretKey": "css_api_client_secret", - "cssApiEnvironment": "test" - } - }, - "prod": { - "host": "https://loginproxy.gov.bc.ca/auth", - "realm": "standard", - "clientId": "sims-4461", - "keycloakSecret": "keycloak", - "serviceClient": { - "serviceClientName": "sims-svc-4464", - "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" - }, - "cssApi": { - "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", - "cssApiClientId": "service-account-team-1190-4229", - "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", - "keycloakSecretCssApiSecretKey": "css_api_client_secret", - "cssApiEnvironment": "prod" - } - } - } -} diff --git a/api/.pipeline/config.js b/api/.pipeline/config.js index c98edc7582..45c417da15 100644 --- a/api/.pipeline/config.js +++ b/api/.pipeline/config.js @@ -1,9 +1,6 @@ 'use strict'; const PipelineCli = require('pipeline-cli'); -const { getPipelineConfigMapSchema } = require('../../.pipeline/configMaps/PipelineConfigMapSchema'); - -const PipelineConfigMapSchema = getPipelineConfigMapSchema(); // Options passed in from the git action const rawOptions = PipelineCli.Util.parseArguments(); @@ -14,7 +11,7 @@ const changeId = rawOptions.pr; // Pipeline config map from openshift const rawPipelineConfigMap = rawOptions.config; // Validate the pipeline config map is not missing any fields -const pipelineConfigMap = PipelineConfigMapSchema.parse(JSON.parse(rawPipelineConfigMap)); +const pipelineConfigMap = JSON.parse(rawPipelineConfigMap); // A static deployment is when the deployment is updating dev, test, or prod (rather than a temporary PR) // See `--type=static` in the `deployStatic.yml` git workflow diff --git a/app/.pipeline/config.js b/app/.pipeline/config.js index 69a5563566..472f23e3da 100644 --- a/app/.pipeline/config.js +++ b/app/.pipeline/config.js @@ -1,9 +1,6 @@ 'use strict'; const PipelineCli = require('pipeline-cli'); -const { getPipelineConfigMapSchema } = require('../../.pipeline/configMaps/PipelineConfigMapSchema'); - -const PipelineConfigMapSchema = getPipelineConfigMapSchema(); // Options passed in from the git action const rawOptions = PipelineCli.Util.parseArguments(); @@ -14,7 +11,7 @@ const changeId = rawOptions.pr; // Pipeline config map from openshift const rawPipelineConfigMap = rawOptions.config; // Validate the pipeline config map is not missing any fields -const pipelineConfigMap = PipelineConfigMapSchema.parse(JSON.parse(rawPipelineConfigMap)); +const pipelineConfigMap = JSON.parse(rawPipelineConfigMap); // A static deployment is when the deployment is updating dev, test, or prod (rather than a temporary PR) // See `--type=static` in the `deployStatic.yml` git workflow diff --git a/database/.pipeline/config.js b/database/.pipeline/config.js index 9c628c2155..8723eabaa5 100644 --- a/database/.pipeline/config.js +++ b/database/.pipeline/config.js @@ -1,9 +1,6 @@ 'use strict'; const PipelineCli = require('pipeline-cli'); -const { getPipelineConfigMapSchema } = require('../../.pipeline/configMaps/PipelineConfigMapSchema'); - -const PipelineConfigMapSchema = getPipelineConfigMapSchema(); // Options passed in from the git action const rawOptions = PipelineCli.Util.parseArguments(); @@ -14,7 +11,7 @@ const changeId = rawOptions.pr; // Pipeline config map from openshift const rawPipelineConfigMap = rawOptions.config; // Validate the pipeline config map is not missing any fields -const pipelineConfigMap = PipelineConfigMapSchema.parse(JSON.parse(rawPipelineConfigMap)); +const pipelineConfigMap = JSON.parse(rawPipelineConfigMap); // A static deployment is when the deployment is updating dev, test, or prod (rather than a temporary PR) // See `--type=static` in the `deployStatic.yml` git workflow From eead0431486f73ad008f67a4bbb5d7be01c51c8e Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Mon, 5 Feb 2024 10:39:25 -0800 Subject: [PATCH 28/62] ignore-skip From 7bc3b4ab7661726c5902c35991dab238a9cc6e5b Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Mon, 5 Feb 2024 11:47:37 -0800 Subject: [PATCH 29/62] ignore-skip From cd7f5814006ebcbf71f87ded4ad4f1bdc60fc2d4 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Mon, 5 Feb 2024 11:50:45 -0800 Subject: [PATCH 30/62] Fix type (ignore-skip) --- api/.pipeline/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/.pipeline/config.js b/api/.pipeline/config.js index 45c417da15..a03d99e1f0 100644 --- a/api/.pipeline/config.js +++ b/api/.pipeline/config.js @@ -79,7 +79,7 @@ const options = processOptions(rawOptions); const phases = { pr: { build: { - ...PipelineConfigMapSchema.api.pr.build, + ...pipelineConfigMap.api.pr.build, name: pipelineConfigMap.module.api, dbName: pipelineConfigMap.module.db, changeId: changeId, From bb51e1b6b9da438ebb1b80bb598198495c396656 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Fri, 23 Feb 2024 16:48:46 -0800 Subject: [PATCH 31/62] ignore-skip --- .pipeline/configMaps/sims.configmap.yaml | 32 ++++++++++++------------ api/.pipeline/lib/api.deploy.js | 4 +-- app/.pipeline/lib/app.deploy.js | 9 +++---- 3 files changed, 21 insertions(+), 24 deletions(-) diff --git a/.pipeline/configMaps/sims.configmap.yaml b/.pipeline/configMaps/sims.configmap.yaml index 17f627d937..c9072399da 100644 --- a/.pipeline/configMaps/sims.configmap.yaml +++ b/.pipeline/configMaps/sims.configmap.yaml @@ -28,15 +28,14 @@ data: "namespace": "af2668-dev", "nodeEnv": "development", "tz": "America/Vancouver", - "backboneApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", + "backboneInternalApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", "backboneIntakePath": "/api/dwc/submission/queue", "backboneArtifactIntakePath": "/api/artifact/intake", "biohubTaxonTsnPath": "/api/taxonomy/taxon/tsn", + "biohubTaxonPath": "/api/taxonomy/taxon", "backboneIntakeEnabled": false, "bctwApiHost": "https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca", "critterbaseApiHost": "https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api", - "elasticsearchURL": "http://es01.a0ec71-dev:9200", - "elasticsearchTaxonomyIndex": "taxonomy_3.0.0", "s3KeyPrefix": "sims-pr", "logLevel": "debug", "cpuRequest": "50m", @@ -62,15 +61,14 @@ data: "staticApiUrl": "api-dev-sims.apps.silver.devops.gov.bc.ca", "staticAppUrl": "dev-sims.apps.silver.devops.gov.bc.ca", "tz": "America/Vancouver", - "backboneApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", + "backboneInternalApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", "backboneIntakePath": "/api/dwc/submission/queue", "backboneArtifactIntakePath": "/api/artifact/intake", "biohubTaxonTsnPath": "/api/taxonomy/taxon/tsn", + "biohubTaxonPath": "/api/taxonomy/taxon", "backboneIntakeEnabled": false, "bctwApiHost": "https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca", "critterbaseApiHost": "https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api", - "elasticsearchURL": "http://es01.a0ec71-dev:9200", - "elasticsearchTaxonomyIndex": "taxonomy_3.0.0", "s3KeyPrefix": "sims", "logLevel": "debug", "cpuRequest": "50m", @@ -96,15 +94,14 @@ data: "staticApiUrl": "api-test-sims.apps.silver.devops.gov.bc.ca", "staticAppUrl": "test-sims.apps.silver.devops.gov.bc.ca", "tz": "America/Vancouver", - "backboneApiHost": "https://api-test-biohub-platform.apps.silver.devops.gov.bc.ca", + "backboneInternalApiHost": "https://api-test-biohub-platform.apps.silver.devops.gov.bc.ca", "backboneIntakePath": "/api/dwc/submission/queue", "backboneArtifactIntakePath": "/api/artifact/intake", "biohubTaxonTsnPath": "/api/taxonomy/taxon/tsn", + "biohubTaxonPath": "/api/taxonomy/taxon", "backboneIntakeEnabled": false, "bctwApiHost": "https://moe-bctw-api-test.apps.silver.devops.gov.bc.ca", "critterbaseApiHost": "https://moe-critterbase-api-test.apps.silver.devops.gov.bc.ca/api", - "elasticsearchURL": "http://es01.a0ec71-dev:9200", - "elasticsearchTaxonomyIndex": "taxonomy_3.0.0", "s3KeyPrefix": "sims", "logLevel": "info", "cpuRequest": "50m", @@ -131,15 +128,14 @@ data: "staticAppUrl": "sims.apps.silver.devops.gov.bc.ca", "staticAppVanityUrl": "sims.nrs.gov.bc.ca", "tz": "America/Vancouver", - "backboneApiHost": "https://api-biohub-platform.apps.silver.devops.gov.bc.ca", + "backboneInternalApiHost": "https://api-biohub-platform.apps.silver.devops.gov.bc.ca", "backboneIntakePath": "/api/dwc/submission/queue", "backboneArtifactIntakePath": "/api/artifact/intake", "biohubTaxonTsnPath": "/api/taxonomy/taxon/tsn", + "biohubTaxonPath": "/api/taxonomy/taxon", "backboneIntakeEnabled": false, "bctwApiHost": "https://moe-bctw-api-prod.apps.silver.devops.gov.bc.ca", "critterbaseApiHost": "https://moe-critterbase-api-prod.apps.silver.devops.gov.bc.ca/api", - "elasticsearchURL": "http://es01.a0ec71-prod:9200", - "elasticsearchTaxonomyIndex": "taxonomy_3.0.0", "s3KeyPrefix": "sims", "logLevel": "warn", "cpuRequest": "50m", @@ -167,8 +163,9 @@ data: "maxUploadNumFiles": 10, "maxUploadFileSize": 52428800, "biohubFeatureFlag": "true", - "backboneApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", + "backbonePublicApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", "biohubTaxonPath": "/api/taxonomy/taxon", + "biohubTaxonTsnPath": "/api/taxonomy/taxon/tsn", "cpuRequest": "50m", "cpuLimit": "200m", "memoryRequest": "100Mi", @@ -194,8 +191,9 @@ data: "maxUploadNumFiles": 10, "maxUploadFileSize": 52428800, "biohubFeatureFlag": "true", - "backboneApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", + "backbonePublicApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", "biohubTaxonPath": "/api/taxonomy/taxon", + "biohubTaxonTsnPath": "/api/taxonomy/taxon/tsn", "cpuRequest": "50m", "cpuLimit": "200m", "memoryRequest": "100Mi", @@ -221,8 +219,9 @@ data: "maxUploadNumFiles": 10, "maxUploadFileSize": 52428800, "biohubFeatureFlag": "false", - "backboneApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", + "backbonePublicApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", "biohubTaxonPath": "/api/taxonomy/taxon", + "biohubTaxonTsnPath": "/api/taxonomy/taxon/tsn", "cpuRequest": "50m", "cpuLimit": "500m", "memoryRequest": "100Mi", @@ -249,8 +248,9 @@ data: "maxUploadNumFiles": 10, "maxUploadFileSize": 52428800, "biohubFeatureFlag": "false", - "backboneApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", + "backbonePublicApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", "biohubTaxonPath": "/api/taxonomy/taxon", + "biohubTaxonTsnPath": "/api/taxonomy/taxon/tsn", "cpuRequest": "50m", "cpuLimit": "500m", "memoryRequest": "100Mi", diff --git a/api/.pipeline/lib/api.deploy.js b/api/.pipeline/lib/api.deploy.js index e0ee882154..3222619fc0 100644 --- a/api/.pipeline/lib/api.deploy.js +++ b/api/.pipeline/lib/api.deploy.js @@ -34,12 +34,12 @@ const apiDeploy = async (settings) => { NODE_ENV: phases[env][phase].nodeEnv, NODE_OPTIONS: phases[env][phase].nodeOptions, // BioHub Platform (aka: Backbone) - BACKBONE_API_HOST: phases[env][phase].backboneApiHost, + BACKBONE_INTERNAL_API_HOST: phases[env][phase].backboneInternalApiHost, BACKBONE_INTAKE_PATH: phases[env][phase].backboneIntakePath, BACKBONE_ARTIFACT_INTAKE_PATH: phases[env][phase].backboneArtifactIntakePath, BACKBONE_INTAKE_ENABLED: phases[env][phase].backboneIntakeEnabled, - BIOHUB_TAXON_TSN_PATH: phases[env][phase].biohubTaxonTsnPath, BIOHUB_TAXON_PATH: phases[env][phase].biohubTaxonPath, + BIOHUB_TAXON_TSN_PATH: phases[env][phase].biohubTaxonTsnPath, // BCTW / Critterbase BCTW_API_HOST: phases[env][phase].bctwApiHost, CB_API_HOST: phases[env][phase].critterbaseApiHost, diff --git a/app/.pipeline/lib/app.deploy.js b/app/.pipeline/lib/app.deploy.js index 3aa7837f0e..18316dbec7 100644 --- a/app/.pipeline/lib/app.deploy.js +++ b/app/.pipeline/lib/app.deploy.js @@ -37,19 +37,16 @@ const appDeploy = async (settings) => { REACT_APP_KEYCLOAK_CLIENT_ID: phases[env][phase].sso.clientId, // BioHub Plastform (aka: Backbone) REACT_APP_BIOHUB_FEATURE_FLAG: phases[env][phase].biohubFeatureFlag, - REACT_APP_BACKBONE_API_HOST: phases[env][phase].backboneApiHost, + REACT_APP_BACKBONE_PUBLIC_API_HOST: phases[env][phase].backbonePublicApiHost, REACT_APP_BIOHUB_TAXON_PATH: phases[env][phase].biohubTaxonPath, + REACT_APP_BIOHUB_TAXON_TSN_PATH: phases[env][phase].biohubTaxonTsnPath, // Openshift Resources CPU_REQUEST: phases[env][phase].cpuRequest, CPU_LIMIT: phases[env][phase].cpuLimit, MEMORY_REQUEST: phases[env][phase].memoryRequest, MEMORY_LIMIT: phases[env][phase].memoryLimit, REPLICAS: phases[env][phase].replicas, - REPLICAS_MAX: phases[env][phase].replicasMax, - REACT_APP_BIOHUB_FEATURE_FLAG: phases[env][phase].biohubFeatureFlag, - REACT_APP_BACKBONE_PUBLIC_API_HOST: phases[env][phase].backbonePublicApiHost, - REACT_APP_BIOHUB_TAXON_PATH: phases[env][phase].biohubTaxonPath, - REACT_APP_BIOHUB_TAXON_TSN_PATH: phases[env][phase].biohubTaxonTsnPath + REPLICAS_MAX: phases[env][phase].replicasMax } }) ); From 242ec885d545f1be40da9a5be230cc1ab122eeff Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Fri, 23 Feb 2024 17:01:53 -0800 Subject: [PATCH 32/62] Update database seed pipeline config settings. ignore-skip --- .pipeline/configMaps/sims.configmap.yaml | 12 ++++++++++++ api/.pipeline/templates/api.dc.yaml | 6 ------ database/.pipeline/lib/db.deploy.js | 1 + database/.pipeline/lib/db.setup.deploy.js | 5 +++++ database/.pipeline/templates/db.setup.dc.yaml | 14 ++++++++++++++ 5 files changed, 32 insertions(+), 6 deletions(-) diff --git a/.pipeline/configMaps/sims.configmap.yaml b/.pipeline/configMaps/sims.configmap.yaml index c9072399da..e9ace56487 100644 --- a/.pipeline/configMaps/sims.configmap.yaml +++ b/.pipeline/configMaps/sims.configmap.yaml @@ -276,6 +276,9 @@ data: "namespace": "af2668-dev", "nodeEnv": "development", "tz": "America/Vancouver", + "projectSeederUserIdentifier": "0", + "numSeedProjects": "2", + "numSeedSurveysPerProject": "2", "volumeCapacity": "500Mi", "cpuRequest": "50m", "cpuLimit": "400m", @@ -299,6 +302,9 @@ data: "namespace": "af2668-dev", "nodeEnv": "development", "tz": "America/Vancouver", + "projectSeederUserIdentifier": "0", + "numSeedProjects": "2", + "numSeedSurveysPerProject": "2", "volumeCapacity": "3Gi", "cpuRequest": "50m", "cpuLimit": "400m", @@ -322,6 +328,9 @@ data: "namespace": "af2668-test", "nodeEnv": "production", "tz": "America/Vancouver", + "projectSeederUserIdentifier": "0", + "numSeedProjects": "0", + "numSeedSurveysPerProject": "0", "volumeCapacity": "3Gi", "cpuRequest": "50m", "cpuLimit": "1000m", @@ -345,6 +354,9 @@ data: "namespace": "af2668-prod", "nodeEnv": "production", "tz": "America/Vancouver", + "projectSeederUserIdentifier": "0", + "numSeedProjects": "0", + "numSeedSurveysPerProject": "0", "volumeCapacity": "5Gi", "cpuRequest": "50m", "cpuLimit": "1000m", diff --git a/api/.pipeline/templates/api.dc.yaml b/api/.pipeline/templates/api.dc.yaml index bb3539d8d1..cfe1f359a7 100644 --- a/api/.pipeline/templates/api.dc.yaml +++ b/api/.pipeline/templates/api.dc.yaml @@ -267,12 +267,6 @@ objects: name: ${DB_SERVICE_NAME} - name: DB_PORT value: '5432' - - name: PROJECT_SEEDER_USER_IDENTIFIER - value: ${PROJECT_SEEDER_USER_IDENTIFIER} - - name: NUM_SEED_PROJECTS - value: ${NUM_SEED_PROJECTS} - - name: NUM_SEED_SURVEYS_PER_PROJECT - value: ${NUM_SEED_SURVEYS_PER_PROJECT} # Keycloak - name: KEYCLOAK_HOST value: ${KEYCLOAK_HOST} diff --git a/database/.pipeline/lib/db.deploy.js b/database/.pipeline/lib/db.deploy.js index ebb4c1cf17..05626d2aec 100644 --- a/database/.pipeline/lib/db.deploy.js +++ b/database/.pipeline/lib/db.deploy.js @@ -36,6 +36,7 @@ const dbDeploy = async (settings) => { TZ: phases[env][phase].tz, IMAGE_STREAM_NAMESPACE: phases[env].build.namespace, VOLUME_CAPACITY: phases[env][phase].volumeCapacity, + // Openshift Resources CPU_REQUEST: phases[env][phase].cpuRequest, CPU_LIMIT: phases[env][phase].cpuLimit, MEMORY_REQUEST: phases[env][phase].memoryRequest, diff --git a/database/.pipeline/lib/db.setup.deploy.js b/database/.pipeline/lib/db.setup.deploy.js index a78f0cb38c..ae40e31313 100644 --- a/database/.pipeline/lib/db.setup.deploy.js +++ b/database/.pipeline/lib/db.setup.deploy.js @@ -72,6 +72,11 @@ const dbSetupDeploy = async (settings) => { DB_SCHEMA: 'biohub', DB_SCHEMA_DAPI_V1: 'biohub_dapi_v1', IMAGE: dbSetupImageStream.image.dockerImageReference, + // Development Seeding + PROJECT_SEEDER_USER_IDENTIFIER: phases[env][phase].projectSeederUserIdentifier, + NUM_SEED_PROJECTS: phases[env][phase].numSeedProjects, + NUM_SEED_SURVEYS_PER_PROJECT: phases[env][phase].numSeedSurveysPerProject, + // Openshift Resources CPU_REQUEST: phases[env][phase].cpuRequest, CPU_LIMIT: phases[env][phase].cpuLimit, MEMORY_REQUEST: phases[env][phase].memoryRequest, diff --git a/database/.pipeline/templates/db.setup.dc.yaml b/database/.pipeline/templates/db.setup.dc.yaml index 99343f744d..f83ab20e10 100644 --- a/database/.pipeline/templates/db.setup.dc.yaml +++ b/database/.pipeline/templates/db.setup.dc.yaml @@ -32,6 +32,14 @@ parameters: description: Application Environment type variable required: true value: 'development' + # Development Seeding + - name: PROJECT_SEEDER_USER_IDENTIFIER + value: 0 + - name: NUM_SEED_PROJECTS + value: 0 + - name: NUM_SEED_SURVEYS_PER_PROJECT + value: 0 + # Openshift Resources - name: CPU_REQUEST value: '50m' - name: CPU_LIMIT @@ -90,6 +98,12 @@ objects: value: ${DB_SCHEMA} - name: DB_SCHEMA_DAPI_V1 value: ${DB_SCHEMA_DAPI_V1} + - name: PROJECT_SEEDER_USER_IDENTIFIER + value: ${PROJECT_SEEDER_USER_IDENTIFIER} + - name: NUM_SEED_PROJECTS + value: ${NUM_SEED_PROJECTS} + - name: NUM_SEED_SURVEYS_PER_PROJECT + value: ${NUM_SEED_SURVEYS_PER_PROJECT} image: '${IMAGE}' imagePullPolicy: Always resources: From f9735c76acd4bd0ac95fb47904852e804bba083f Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Fri, 23 Feb 2024 17:32:35 -0800 Subject: [PATCH 33/62] Update seed default value --- .pipeline/configMaps/sims.configmap.yaml | 8 ++++---- database/.pipeline/templates/db.setup.dc.yaml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.pipeline/configMaps/sims.configmap.yaml b/.pipeline/configMaps/sims.configmap.yaml index e9ace56487..8a6d2941e6 100644 --- a/.pipeline/configMaps/sims.configmap.yaml +++ b/.pipeline/configMaps/sims.configmap.yaml @@ -276,7 +276,7 @@ data: "namespace": "af2668-dev", "nodeEnv": "development", "tz": "America/Vancouver", - "projectSeederUserIdentifier": "0", + "projectSeederUserIdentifier": "1", "numSeedProjects": "2", "numSeedSurveysPerProject": "2", "volumeCapacity": "500Mi", @@ -302,7 +302,7 @@ data: "namespace": "af2668-dev", "nodeEnv": "development", "tz": "America/Vancouver", - "projectSeederUserIdentifier": "0", + "projectSeederUserIdentifier": "1", "numSeedProjects": "2", "numSeedSurveysPerProject": "2", "volumeCapacity": "3Gi", @@ -328,7 +328,7 @@ data: "namespace": "af2668-test", "nodeEnv": "production", "tz": "America/Vancouver", - "projectSeederUserIdentifier": "0", + "projectSeederUserIdentifier": "1", "numSeedProjects": "0", "numSeedSurveysPerProject": "0", "volumeCapacity": "3Gi", @@ -354,7 +354,7 @@ data: "namespace": "af2668-prod", "nodeEnv": "production", "tz": "America/Vancouver", - "projectSeederUserIdentifier": "0", + "projectSeederUserIdentifier": "1", "numSeedProjects": "0", "numSeedSurveysPerProject": "0", "volumeCapacity": "5Gi", diff --git a/database/.pipeline/templates/db.setup.dc.yaml b/database/.pipeline/templates/db.setup.dc.yaml index f83ab20e10..1a49dafa60 100644 --- a/database/.pipeline/templates/db.setup.dc.yaml +++ b/database/.pipeline/templates/db.setup.dc.yaml @@ -34,7 +34,7 @@ parameters: value: 'development' # Development Seeding - name: PROJECT_SEEDER_USER_IDENTIFIER - value: 0 + value: 1 - name: NUM_SEED_PROJECTS value: 0 - name: NUM_SEED_SURVEYS_PER_PROJECT From 855edafa42bef31aee01aa403d3998e3e9ccdf66 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Fri, 23 Feb 2024 17:34:31 -0800 Subject: [PATCH 34/62] Fix db setup yaml --- database/.pipeline/templates/db.setup.dc.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/database/.pipeline/templates/db.setup.dc.yaml b/database/.pipeline/templates/db.setup.dc.yaml index 1a49dafa60..b6d09508a6 100644 --- a/database/.pipeline/templates/db.setup.dc.yaml +++ b/database/.pipeline/templates/db.setup.dc.yaml @@ -34,11 +34,11 @@ parameters: value: 'development' # Development Seeding - name: PROJECT_SEEDER_USER_IDENTIFIER - value: 1 + value: '1' - name: NUM_SEED_PROJECTS - value: 0 + value: '0' - name: NUM_SEED_SURVEYS_PER_PROJECT - value: 0 + value: '0' # Openshift Resources - name: CPU_REQUEST value: '50m' From f170c159b30676fb23463dc4bf5b52e2f440307a Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Mon, 11 Mar 2024 11:05:56 -0700 Subject: [PATCH 35/62] Tweak node options --- api/.pipeline/templates/api.dc.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/.pipeline/templates/api.dc.yaml b/api/.pipeline/templates/api.dc.yaml index cfe1f359a7..8f3c1828e8 100644 --- a/api/.pipeline/templates/api.dc.yaml +++ b/api/.pipeline/templates/api.dc.yaml @@ -27,6 +27,8 @@ parameters: required: true value: 'development' - name: NODE_OPTIONS + description: Optional node options. See https://nodejs.org/api/cli.html#node_optionsoptions + value: '' - name: API_PORT_DEFAULT value: '6100' - name: API_PORT_DEFAULT_NAME From b4bcac0a622760f8f6554699ce3ae44482d1cf26 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Mon, 11 Mar 2024 15:12:09 -0700 Subject: [PATCH 36/62] Remove logging --- database/.pipeline/config.js | 6 ------ database/.pipeline/lib/db.setup.build.js | 16 ---------------- 2 files changed, 22 deletions(-) diff --git a/database/.pipeline/config.js b/database/.pipeline/config.js index 8723eabaa5..c0f92795d7 100644 --- a/database/.pipeline/config.js +++ b/database/.pipeline/config.js @@ -163,10 +163,4 @@ const phases = { } }; -console.log('1=============================================='); -console.log('phases', phases); -console.log('2=============================================='); -console.log('options', options); -console.log('3=============================================='); - module.exports = exports = { phases, options }; diff --git a/database/.pipeline/lib/db.setup.build.js b/database/.pipeline/lib/db.setup.build.js index dd67a0b897..e5dae3f890 100644 --- a/database/.pipeline/lib/db.setup.build.js +++ b/database/.pipeline/lib/db.setup.build.js @@ -22,22 +22,6 @@ const dbSetupBuild = (settings) => { const objects = []; - console.log('4=========================================='); - console.log({ - NAME: name, - SUFFIX: phases[env][phase].suffix, - VERSION: phases[env][phase].tag, - SOURCE_CONTEXT_DIR: phases[env][phase].sourceContextDir, - DB_SETUP_DOCKERFILE_PATH: phases[env][phase].dbSetupDockerfilePath, - SOURCE_REPOSITORY_URL: oc.git.http_url, - SOURCE_REPOSITORY_REF: phases[env][phase].branch, - CPU_REQUEST: phases[env][phase].cpuRequest, - CPU_LIMIT: phases[env][phase].cpuLimit, - MEMORY_REQUEST: phases[env][phase].memoryRequest, - MEMORY_LIMIT: phases[env][phase].memoryLimit - }); - console.log('5=========================================='); - objects.push( ...oc.processDeploymentTemplate(`${templatesLocalBaseUrl}/db.setup.bc.yaml`, { param: { From b9bb0ca94727ce3f6ddfca52c94fdb786230c9eb Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Thu, 14 Mar 2024 12:29:54 -0700 Subject: [PATCH 37/62] Revert sims to biohubbc to reduce possible conflicts --- .github/workflows/addComments.yml | 4 +- .github/workflows/deploy.yml | 8 +- .github/workflows/deployStatic.yml | 4 +- .pipeline/configMaps/README.md | 33 ++++++- .pipeline/configMaps/sims.configmap.yaml | 48 +++++----- api/.pipeline/config.js | 77 +++------------- api/.pipeline/package-lock.json | 5 - api/.pipeline/package.json | 3 +- api/.pipeline/templates/api.bc.yaml | 6 +- api/.pipeline/templates/api.dc.yaml | 8 +- .../prereqs/biohubbc-object-store.yaml | 2 +- api/.pipeline/utils/utils.js | 56 +++++++++++ api/package-lock.json | 42 ++++----- app/.pipeline/config.js | 77 +++------------- app/.pipeline/package-lock.json | 5 - app/.pipeline/package.json | 3 +- app/.pipeline/templates/app.bc.yaml | 6 +- app/.pipeline/templates/app.dc.yaml | 8 +- app/.pipeline/utils/utils.js | 56 +++++++++++ app/package-lock.json | 92 +++++++++---------- database/.pipeline/config.js | 79 +++------------- database/.pipeline/package-lock.json | 5 - database/.pipeline/package.json | 3 +- database/.pipeline/templates/db.dc.yaml | 4 +- database/.pipeline/templates/db.setup.bc.yaml | 6 +- database/.pipeline/templates/db.setup.dc.yaml | 6 +- database/.pipeline/templates/db.setup.is.yaml | 2 +- database/.pipeline/utils/utils.js | 52 +++++++++++ 28 files changed, 361 insertions(+), 339 deletions(-) create mode 100644 api/.pipeline/utils/utils.js create mode 100644 app/.pipeline/utils/utils.js diff --git a/.github/workflows/addComments.yml b/.github/workflows/addComments.yml index bfd5469349..fb2f63be4e 100644 --- a/.github/workflows/addComments.yml +++ b/.github/workflows/addComments.yml @@ -19,6 +19,6 @@ jobs: issue-number: ${{ github.event.number }} body: | Openshift URLs for the PR Deployment: - - App Route: https://sims-app-${{ github.event.number }}-af2668-dev.apps.silver.devops.gov.bc.ca/ - - Api Route: https://sims-api-${{ github.event.number }}-af2668-dev.apps.silver.devops.gov.bc.ca/ + - App Route: https://biohubbc-app-${{ github.event.number }}-af2668-dev.apps.silver.devops.gov.bc.ca/ + - Api Route: https://biohubbc-api-${{ github.event.number }}-af2668-dev.apps.silver.devops.gov.bc.ca/ - Pods: https://console.apps.silver.devops.gov.bc.ca/k8s/ns/af2668-dev/pods?name=${{ github.event.number }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 6f8023f354..db64ed29a7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -147,7 +147,7 @@ jobs: - 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 and store in pipeline_config for use by subsequent jobs + # Fetch config map named 'sims-pipeline-config' and store in 'pipeline_config' variable for use by subsequent jobs - name: Fetch pipeline config map id: "get_config" run: | @@ -165,7 +165,7 @@ jobs: fromJSON(needs.skipDuplicateActions.outputs.paths_result).app.skipped_by.branch != github.head_ref ) }} env: PR_NUMBER: ${{ github.event.number }} - APP_NAME: "sims-app" + APP_NAME: "biohubbc-app" PIPELINE_CONFIG: ${{ needs.getPipelineConfigMap.outputs.pipeline_config }} needs: - checkoutRepo @@ -229,7 +229,7 @@ jobs: fromJSON(needs.skipDuplicateActions.outputs.paths_result).database.skipped_by.branch != github.head_ref ) }} env: PR_NUMBER: ${{ github.event.number }} - APP_NAME: "sims-db" + APP_NAME: "biohubbc-db" PIPELINE_CONFIG: ${{ needs.getPipelineConfigMap.outputs.pipeline_config }} needs: - checkoutRepo @@ -350,7 +350,7 @@ jobs: fromJSON(needs.skipDuplicateActions.outputs.paths_result).api.skipped_by.branch != github.head_ref ) }} env: PR_NUMBER: ${{ github.event.number }} - APP_NAME: "sims-api" + APP_NAME: "biohubbc-api" PIPELINE_CONFIG: ${{ needs.getPipelineConfigMap.outputs.pipeline_config }} needs: - checkoutRepo diff --git a/.github/workflows/deployStatic.yml b/.github/workflows/deployStatic.yml index 57c033f6b2..8aa3e25d9a 100644 --- a/.github/workflows/deployStatic.yml +++ b/.github/workflows/deployStatic.yml @@ -102,7 +102,7 @@ jobs: - 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 and store in pipeline_config for use by subsequent jobs + # Fetch config map named 'sims-pipeline-config' and store in 'pipeline_config' variable for use by subsequent jobs - name: Fetch pipeline config map id: "get_config" run: | @@ -599,7 +599,7 @@ jobs: # Clean the reamaining build/deployment artifacts - name: Clean remaining Artifacts env: - POD_SELECTOR: sims + POD_SELECTOR: biohubbc run: | 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 diff --git a/.pipeline/configMaps/README.md b/.pipeline/configMaps/README.md index 44d707595c..18a2c51355 100644 --- a/.pipeline/configMaps/README.md +++ b/.pipeline/configMaps/README.md @@ -2,14 +2,39 @@ `sims-pipeline-config.json` is a working sample of the config map that should be created in each openshift environment. -Note: The exact values in the sample config map may fall out of sync with what is in OpenShift, as changes are made organically directly in OpenShift. +Note: The exact values in the sample config map may fall out of sync with what is in Openshift, as changes to values are made directly in Openshift (ex: updating cpu/memory limits in OpenShift, etc). **Note: Config maps should never contain secrets, passwords, or other sensitive values. They are not protected in OpenShift and their values may appear in logs, etc. Sensitive data should always be stored in Openshift secrets.** ## Create Config Map in Openshift +Under the target environment (dev, test, prod) + +#### Option 1 + +Under `Workloads` -> `ConfigMaps` + +1. Click `Create ConfigMap` +2. Set field values as follows: + - **name:** `sims-pipeline-config` + - **immutable:** `false` (leave unchecked) + - **key:** `config` + - **value:** A JSON object containing the config map settings. +3. Click `Create` + +#### Option 2 + +1. Click the plus icon `(+)` in the Openshift header (next to your user name in the top right corner). +2. Copy/paste the entire contents of the sample `sims.configmap.yaml` (make changes as needed now, or update afterwards) +3. Click `Create` + +## Updating Config Map in Openshift + +Under the target environment (dev, test, prod) + Under `Workloads` -> `ConfigMaps` -- **name:** `sims-pipeline-config` - - **key:** `config` - - **value:** A JSON object containing the config map settings. +1. Click on target config map +2. Click `Actions` -> `Edit ConfigMap` +3. Update the `value`, making changes to the JSON object as needed. +4. Click `Save` diff --git a/.pipeline/configMaps/sims.configmap.yaml b/.pipeline/configMaps/sims.configmap.yaml index 8a6d2941e6..b1c2824802 100644 --- a/.pipeline/configMaps/sims.configmap.yaml +++ b/.pipeline/configMaps/sims.configmap.yaml @@ -7,12 +7,12 @@ immutable: false data: config: | { - "name": "sims", + "name": "biohubbc", "version": "1.0.0", "module": { - "db": "sims-db", - "api": "sims-api", - "app": "sims-app" + "db": "biohubbc-db", + "api": "biohubbc-api", + "app": "biohubbc-app" }, "api": { "pr": { @@ -58,8 +58,8 @@ data: "deploy": { "namespace": "af2668-dev", "nodeEnv": "development", - "staticApiUrl": "api-dev-sims.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "dev-sims.apps.silver.devops.gov.bc.ca", + "staticApiUrl": "api-dev-biohubbc.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "dev-biohubbc.apps.silver.devops.gov.bc.ca", "tz": "America/Vancouver", "backboneInternalApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", "backboneIntakePath": "/api/dwc/submission/queue", @@ -91,8 +91,8 @@ data: "deploy": { "namespace": "af2668-test", "nodeEnv": "production", - "staticApiUrl": "api-test-sims.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "test-sims.apps.silver.devops.gov.bc.ca", + "staticApiUrl": "api-test-biohubbc.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "test-biohubbc.apps.silver.devops.gov.bc.ca", "tz": "America/Vancouver", "backboneInternalApiHost": "https://api-test-biohub-platform.apps.silver.devops.gov.bc.ca", "backboneIntakePath": "/api/dwc/submission/queue", @@ -124,9 +124,9 @@ data: "deploy": { "namespace": "af2668-prod", "nodeEnv": "production", - "staticApiUrl": "api-sims.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "sims.apps.silver.devops.gov.bc.ca", - "staticAppVanityUrl": "sims.nrs.gov.bc.ca", + "staticApiUrl": "api-biohubbc.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "biohubbc.apps.silver.devops.gov.bc.ca", + "staticAppVanityUrl": "biohubbc.nrs.gov.bc.ca", "tz": "America/Vancouver", "backboneInternalApiHost": "https://api-biohub-platform.apps.silver.devops.gov.bc.ca", "backboneIntakePath": "/api/dwc/submission/queue", @@ -185,8 +185,8 @@ data: "deploy": { "namespace": "af2668-dev", "nodeEnv": "development", - "staticApiUrl": "api-dev-sims.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "dev-sims.apps.silver.devops.gov.bc.ca", + "staticApiUrl": "api-dev-biohubbc.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "dev-biohubbc.apps.silver.devops.gov.bc.ca", "siteminderLogoutURL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", "maxUploadNumFiles": 10, "maxUploadFileSize": 52428800, @@ -213,8 +213,8 @@ data: "deploy": { "namespace": "af2668-test", "nodeEnv": "production", - "staticApiUrl": "api-test-sims.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "test-sims.apps.silver.devops.gov.bc.ca", + "staticApiUrl": "api-test-biohubbc.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "test-biohubbc.apps.silver.devops.gov.bc.ca", "siteminderLogoutURL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", "maxUploadNumFiles": 10, "maxUploadFileSize": 52428800, @@ -241,9 +241,9 @@ data: "deploy": { "namespace": "af2668-prod", "nodeEnv": "production", - "staticApiUrl": "api-sims.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "sims.apps.silver.devops.gov.bc.ca", - "staticAppVanityUrl": "sims.nrs.gov.bc.ca", + "staticApiUrl": "api-biohubbc.apps.silver.devops.gov.bc.ca", + "staticAppUrl": "biohubbc.apps.silver.devops.gov.bc.ca", + "staticAppVanityUrl": "biohubbc.nrs.gov.bc.ca", "siteminderLogoutURL": "https://logon7.gov.bc.ca/clp-cgi/logoff.cgi", "maxUploadNumFiles": 10, "maxUploadFileSize": 52428800, @@ -318,7 +318,7 @@ data: "namespace": "af2668-tools", "tz": "America/Vancouver", "sourceContextDir": "database", - "dbSetupDockerfilePath": "./.docker/db/Dockerfile.migrate", + "dbSetupDockerfilePath": "./.docker/db/Dockerfile.setup", "cpuRequest": "50m", "cpuLimit": "1000m", "memoryRequest": "100Mi", @@ -344,7 +344,7 @@ data: "namespace": "af2668-tools", "tz": "America/Vancouver", "sourceContextDir": "database", - "dbSetupDockerfilePath": "./.docker/db/Dockerfile.migrate", + "dbSetupDockerfilePath": "./.docker/db/Dockerfile.setup", "cpuRequest": "50m", "cpuLimit": "1000m", "memoryRequest": "100Mi", @@ -371,7 +371,7 @@ data: "host": "https://dev.loginproxy.gov.bc.ca/auth", "realm": "standard", "clientId": "sims-4461", - "keycloakSecret": "keycloak", + "keycloakSecret": "sims-keycloak", "serviceClient": { "serviceClientName": "sims-svc-4464", "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" @@ -388,7 +388,7 @@ data: "host": "https://dev.loginproxy.gov.bc.ca/auth", "realm": "standard", "clientId": "sims-4461", - "keycloakSecret": "keycloak", + "keycloakSecret": "sims-keycloak", "serviceClient": { "serviceClientName": "sims-svc-4464", "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" @@ -405,7 +405,7 @@ data: "host": "https://test.loginproxy.gov.bc.ca/auth", "realm": "standard", "clientId": "sims-4461", - "keycloakSecret": "keycloak", + "keycloakSecret": "sims-keycloak", "serviceClient": { "serviceClientName": "sims-svc-4464", "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" @@ -422,7 +422,7 @@ data: "host": "https://loginproxy.gov.bc.ca/auth", "realm": "standard", "clientId": "sims-4461", - "keycloakSecret": "keycloak", + "keycloakSecret": "sims-keycloak", "serviceClient": { "serviceClientName": "sims-svc-4464", "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" diff --git a/api/.pipeline/config.js b/api/.pipeline/config.js index a03d99e1f0..2a04377cf0 100644 --- a/api/.pipeline/config.js +++ b/api/.pipeline/config.js @@ -1,81 +1,32 @@ 'use strict'; const PipelineCli = require('pipeline-cli'); +const { processOptions } = require('./utils/utils'); // Options passed in from the git action const rawOptions = PipelineCli.Util.parseArguments(); -// Pull-request number or branch name +const options = processOptions(rawOptions); + +// Get pull-request number from git action '--pr' arg const changeId = rawOptions.pr; -// Pipeline config map from openshift -const rawPipelineConfigMap = rawOptions.config; -// Validate the pipeline config map is not missing any fields -const pipelineConfigMap = JSON.parse(rawPipelineConfigMap); +// Get pipeline config map from git action '--config' arg +const pipelineConfigMapString = rawOptions.config; +const pipelineConfigMap = JSON.parse(pipelineConfigMapString); // A static deployment is when the deployment is updating dev, test, or prod (rather than a temporary PR) // See `--type=static` in the `deployStatic.yml` git workflow const isStaticDeployment = rawOptions.type === 'static'; -const branch = (isStaticDeployment && rawOptions.branch) || null; +// The branch name, which is either the branch name provided in the git action (for a static deploy) or the current git +// branch name (in the case of a PR deploy) +const branch = (isStaticDeployment && rawOptions.branch) || options.git.ref; const tag = (branch && `build-${pipelineConfigMap.version}-${changeId}-${branch}`) || `build-${pipelineConfigMap.version}-${changeId}`; -/** - * Parses the npm cli command options and the git action context. - * - * @param {*} options - * @return {{ - * git: { - * dir: '', - * branch: { - * name: '', - * remote: '', - * merge: '' - * }, - * url: 'https://github.com/bcgov/biohubbc.git', - * uri: 'https://github.com/bcgov/biohubbc', - * http_url: 'https://github.com/bcgov/biohubbc.git', - * owner: 'bcgov', - * repository: 'biohubbc', - * pull_request: '', - * ref: '', - * branch_ref: '' - * }, - * env: 'pr' | 'dev' | 'test' | 'prod', - * phase: 'build' | 'deploy', - * pr?: '', - * branch?: '', - * config: {}, // JSON config map - * type?: 'static' - * }} - */ -function processOptions(options) { - const result = { ...options }; - - // Check git - if (!result.git.url.includes('.git')) { - result.git.url = `${result.git.url}.git`; - } - - if (!result.git.http_url.includes('.git')) { - result.git.http_url = `${result.git.http_url}.git`; - } - - // Fixing repo - if (result.git.repository.includes('/')) { - const last = result.git.repository.split('/').pop(); - const final = last.split('.')[0]; - result.git.repository = final; - } - - return result; -} - -const options = processOptions(rawOptions); - const phases = { pr: { build: { @@ -87,7 +38,7 @@ const phases = { instance: `${pipelineConfigMap.module.api}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, tag: tag, - branch: branch || options.git.ref + branch: branch }, deploy: { ...pipelineConfigMap.api.pr.deploy, @@ -114,7 +65,7 @@ const phases = { instance: `${pipelineConfigMap.module.api}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, tag: tag, - branch: branch || options.git.ref + branch: branch }, deploy: { ...pipelineConfigMap.api.dev.deploy, @@ -140,7 +91,7 @@ const phases = { instance: `${pipelineConfigMap.module.api}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, tag: tag, - branch: branch || options.git.ref + branch: branch }, deploy: { ...pipelineConfigMap.api.test.deploy, @@ -167,7 +118,7 @@ const phases = { instance: `${pipelineConfigMap.module.api}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, tag: tag, - branch: branch || options.git.ref + branch: branch }, deploy: { ...pipelineConfigMap.api.prod.deploy, diff --git a/api/.pipeline/package-lock.json b/api/.pipeline/package-lock.json index aa3783dada..83751a9d58 100644 --- a/api/.pipeline/package-lock.json +++ b/api/.pipeline/package-lock.json @@ -53,11 +53,6 @@ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz", "integrity": "sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==", "dev": true - }, - "zod": { - "version": "3.22.4", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.4.tgz", - "integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==" } } } diff --git a/api/.pipeline/package.json b/api/.pipeline/package.json index f1d916754b..1f13d26ce9 100644 --- a/api/.pipeline/package.json +++ b/api/.pipeline/package.json @@ -26,8 +26,7 @@ "lodash.isfunction": "^3.0.9", "lodash.isplainobject": "^4.0.6", "lodash.isstring": "^4.0.1", - "pipeline-cli": "git+https://github.com/bcgov/biohubbc-pipeline-cli.git", - "zod": "^3.21.4" + "pipeline-cli": "git+https://github.com/bcgov/biohubbc-pipeline-cli.git" }, "devDependencies": { "prettier": "~2.3.2" diff --git a/api/.pipeline/templates/api.bc.yaml b/api/.pipeline/templates/api.bc.yaml index 9de416aa2f..6b3bf00d04 100644 --- a/api/.pipeline/templates/api.bc.yaml +++ b/api/.pipeline/templates/api.bc.yaml @@ -1,15 +1,15 @@ apiVersion: template.openshift.io/v1 kind: Template metadata: - name: sims-api-bc + name: biohubbc-api-bc labels: - build: sims-api + build: biohubbc-api parameters: - name: NAME displayName: Name description: Image name required: true - value: sims-api + value: biohubbc-api - name: SUFFIX displayName: Name Suffix description: A suffix appended to all objects diff --git a/api/.pipeline/templates/api.dc.yaml b/api/.pipeline/templates/api.dc.yaml index f982c9e910..24d79b8bfb 100644 --- a/api/.pipeline/templates/api.dc.yaml +++ b/api/.pipeline/templates/api.dc.yaml @@ -1,12 +1,12 @@ apiVersion: template.openshift.io/v1 kind: Template metadata: - name: sims-api-dc + name: biohubbc-api-dc labels: - build: sims-api + build: biohubbc-api parameters: - name: NAME - value: sims-api + value: biohubbc-api - name: SUFFIX value: '-dev' - name: VERSION @@ -115,7 +115,7 @@ parameters: # Object Store (S3) - name: OBJECT_STORE_SECRETS description: Secrets used to read and write to the S3 storage - value: 'sims-object-store' + value: 'biohubbc-object-store' - name: S3_KEY_PREFIX description: S3 key optional prefix required: false diff --git a/api/.pipeline/templates/prereqs/biohubbc-object-store.yaml b/api/.pipeline/templates/prereqs/biohubbc-object-store.yaml index d1432cb893..d8ebf0bdde 100644 --- a/api/.pipeline/templates/prereqs/biohubbc-object-store.yaml +++ b/api/.pipeline/templates/prereqs/biohubbc-object-store.yaml @@ -1,7 +1,7 @@ kind: Secret apiVersion: v1 metadata: - name: sims-object-store + name: biohubbc-object-store data: object_store_access_key_id: object_store_bucket_name: diff --git a/api/.pipeline/utils/utils.js b/api/.pipeline/utils/utils.js new file mode 100644 index 0000000000..4009118ae9 --- /dev/null +++ b/api/.pipeline/utils/utils.js @@ -0,0 +1,56 @@ +'use strict'; + +/** + * Parses the npm cli command options and the git action context. + * + * @param {*} options + * @return {{ + * git: { + * dir: '', + * branch: { + * name: '', + * remote: '', + * merge: '' + * }, + * url: 'https://github.com/bcgov/biohubbc.git', + * uri: 'https://github.com/bcgov/biohubbc', + * http_url: 'https://github.com/bcgov/biohubbc.git', + * owner: 'bcgov', + * repository: 'biohubbc', + * pull_request: '', + * ref: '', + * branch_ref: '' + * }, + * env: 'pr' | 'dev' | 'test' | 'prod', + * phase: 'build' | 'deploy', + * pr?: '', + * branch?: '', + * config: {}, // JSON config map + * type?: 'static' + * }} + */ +const processOptions = (options) => { + const result = { ...options }; + + // Check git + if (!result.git.url.includes('.git')) { + result.git.url = `${result.git.url}.git`; + } + + if (!result.git.http_url.includes('.git')) { + result.git.http_url = `${result.git.http_url}.git`; + } + + // Fixing repo + if (result.git.repository.includes('/')) { + const last = result.git.repository.split('/').pop(); + const final = last.split('.')[0]; + result.git.repository = final; + } + + return result; +}; + +module.exports = { + processOptions +}; diff --git a/api/package-lock.json b/api/package-lock.json index 11419f0cd1..675a178ffd 100644 --- a/api/package-lock.json +++ b/api/package-lock.json @@ -662,7 +662,7 @@ "@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", + "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", "dev": true, "optional": true }, @@ -1415,7 +1415,7 @@ "arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", "dev": true }, "asn1": { @@ -2743,7 +2743,7 @@ "encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" }, "end-of-stream": { "version": "1.4.4", @@ -2906,7 +2906,7 @@ "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" }, "escape-string-regexp": { "version": "1.0.5", @@ -3180,7 +3180,7 @@ "etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" }, "eventemitter3": { "version": "4.0.7", @@ -3190,7 +3190,7 @@ "events": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", - "integrity": "sha512-kEcvvCBByWXGnZy6JUlgAp2gBIUjfCAV6P6TgT1/aaQKcmuAEC4OZTV1I4EWQLz2gxZw76atuVyvHhTxvi0Flw==" + "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=" }, "expand-brackets": { "version": "2.1.4", @@ -3825,7 +3825,7 @@ "fresh": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==" }, "fromentries": { "version": "1.3.2", @@ -4727,7 +4727,7 @@ "ignore-by-default": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", - "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", + "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", "dev": true }, "import-fresh": { @@ -4948,7 +4948,7 @@ "is-dir": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-dir/-/is-dir-1.0.0.tgz", - "integrity": "sha1-QdN/SV/MrMBaR3jWboMCTCkro/8=" + "integrity": "sha512-vLwCNpTNkFC5k7SBRxPubhOCryeulkOsSkjbGyZ8eOzZmzMS+hSEO/Kn9ZOVhFNAlRZTFc4ZKql48hESuYUPIQ==" }, "is-extendable": { "version": "0.1.1", @@ -5656,7 +5656,7 @@ "lodash.clonedeep": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==" + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=" }, "lodash.defaults": { "version": "4.2.0", @@ -5672,7 +5672,7 @@ "lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", "dev": true }, "lodash.includes": { @@ -5753,7 +5753,7 @@ "lru-cache": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.0.2.tgz", - "integrity": "sha512-uQw9OqphAGiZhkuPlpFGmdTU2tEuhxTourM/19qGJrxBPHAr/f8BT1a0i/lOclESnGatdJG/UCkP9kZB/Lh1iw==", + "integrity": "sha1-HRdnnAac2l0ECZGgnbwsDbN35V4=", "requires": { "pseudomap": "^1.0.1", "yallist": "^2.0.0" @@ -6415,7 +6415,7 @@ "nopt": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", - "integrity": "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==", + "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", "dev": true, "requires": { "abbrev": "1" @@ -7392,7 +7392,7 @@ "pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==" + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" }, "pstree.remy": { "version": "1.1.8", @@ -7424,7 +7424,7 @@ "punycode": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw==" + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=" }, "qs": { "version": "6.10.1", @@ -7437,7 +7437,7 @@ "querystring": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g==" + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=" }, "randombytes": { "version": "2.1.0", @@ -7965,7 +7965,7 @@ "simple-swizzle": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", - "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", + "integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=", "requires": { "is-arrayish": "^0.3.1" } @@ -8983,7 +8983,7 @@ "unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==" }, "unset-value": { "version": "1.0.0", @@ -9055,7 +9055,7 @@ "url": { "version": "0.10.3", "resolved": "https://registry.npmjs.org/url/-/url-0.10.3.tgz", - "integrity": "sha512-hzSUW2q06EqL1gKM/a+obYHLIO6ct2hwPuviqTTOcfFVc61UbfJ2Q32+uGL/HCPxKqrdGB5QUwIe7UqlDgwsOQ==", + "integrity": "sha1-Ah5NnHcF8hu/N9A861h2dAJ3TGQ=", "requires": { "punycode": "1.3.2", "querystring": "0.2.0" @@ -9443,7 +9443,7 @@ "yallist": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==" + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" }, "yargs": { "version": "15.4.1", @@ -9501,7 +9501,7 @@ "yn": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/yn/-/yn-2.0.0.tgz", - "integrity": "sha512-uTv8J/wiWTgUTg+9vLTi//leUl5vDQS6uii/emeTb2ssY7vl6QWf2fFbIIGjnhjvbdKlU0ed7QPgY1htTC86jQ==", + "integrity": "sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=", "dev": true }, "yocto-queue": { diff --git a/app/.pipeline/config.js b/app/.pipeline/config.js index 472f23e3da..b5c6c0c936 100644 --- a/app/.pipeline/config.js +++ b/app/.pipeline/config.js @@ -1,81 +1,32 @@ 'use strict'; const PipelineCli = require('pipeline-cli'); +const { processOptions } = require('./utils/utils'); // Options passed in from the git action const rawOptions = PipelineCli.Util.parseArguments(); -// Pull-request number or branch name +const options = processOptions(rawOptions); + +// Get pull-request number from git action '--pr' arg const changeId = rawOptions.pr; -// Pipeline config map from openshift -const rawPipelineConfigMap = rawOptions.config; -// Validate the pipeline config map is not missing any fields -const pipelineConfigMap = JSON.parse(rawPipelineConfigMap); +// Get pipeline config map from git action '--config' arg +const pipelineConfigMapString = rawOptions.config; +const pipelineConfigMap = JSON.parse(pipelineConfigMapString); // A static deployment is when the deployment is updating dev, test, or prod (rather than a temporary PR) // See `--type=static` in the `deployStatic.yml` git workflow const isStaticDeployment = rawOptions.type === 'static'; -const branch = (isStaticDeployment && rawOptions.branch) || null; +// The branch name, which is either the branch name provided in the git action (for a static deploy) or the current git +// branch name (in the case of a PR deploy) +const branch = (isStaticDeployment && rawOptions.branch) || options.git.ref; const tag = (branch && `build-${pipelineConfigMap.version}-${changeId}-${branch}`) || `build-${pipelineConfigMap.version}-${changeId}`; -/** - * Parses the npm cli command options and the git action context. - * - * @param {*} options - * @return {{ - * git: { - * dir: '', - * branch: { - * name: '', - * remote: '', - * merge: '' - * }, - * url: 'https://github.com/bcgov/biohubbc.git', - * uri: 'https://github.com/bcgov/biohubbc', - * http_url: 'https://github.com/bcgov/biohubbc.git', - * owner: 'bcgov', - * repository: 'biohubbc', - * pull_request: '', - * ref: '', - * branch_ref: '' - * }, - * env: 'pr' | 'dev' | 'test' | 'prod', - * phase: 'build' | 'deploy', - * pr?: '', - * branch?: '', - * config: {}, // JSON config map - * type?: 'static' - * }} - */ -function processOptions(options) { - const result = { ...options }; - - // Check git - if (!result.git.url.includes('.git')) { - result.git.url = `${result.git.url}.git`; - } - - if (!result.git.http_url.includes('.git')) { - result.git.http_url = `${result.git.http_url}.git`; - } - - // Fixing repo - if (result.git.repository.includes('/')) { - const last = result.git.repository.split('/').pop(); - const final = last.split('.')[0]; - result.git.repository = final; - } - - return result; -} - -const options = processOptions(rawOptions); - const phases = { pr: { build: { @@ -86,7 +37,7 @@ const phases = { instance: `${pipelineConfigMap.module.app}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, tag: tag, - branch: branch || options.git.ref + branch: branch }, deploy: { ...pipelineConfigMap.app.pr.deploy, @@ -110,7 +61,7 @@ const phases = { instance: `${pipelineConfigMap.module.app}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, tag: tag, - branch: branch || options.git.ref + branch: branch }, deploy: { ...pipelineConfigMap.app.dev.deploy, @@ -134,7 +85,7 @@ const phases = { instance: `${pipelineConfigMap.module.app}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, tag: tag, - branch: branch || options.git.ref + branch: branch }, deploy: { ...pipelineConfigMap.app.test.deploy, @@ -158,7 +109,7 @@ const phases = { instance: `${pipelineConfigMap.module.app}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, tag: tag, - branch: branch || options.git.ref + branch: branch }, deploy: { ...pipelineConfigMap.app.prod.deploy, diff --git a/app/.pipeline/package-lock.json b/app/.pipeline/package-lock.json index aa3783dada..83751a9d58 100644 --- a/app/.pipeline/package-lock.json +++ b/app/.pipeline/package-lock.json @@ -53,11 +53,6 @@ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz", "integrity": "sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==", "dev": true - }, - "zod": { - "version": "3.22.4", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.4.tgz", - "integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==" } } } diff --git a/app/.pipeline/package.json b/app/.pipeline/package.json index cfbd6be394..3e805fbba6 100644 --- a/app/.pipeline/package.json +++ b/app/.pipeline/package.json @@ -26,8 +26,7 @@ "lodash.isfunction": "^3.0.9", "lodash.isplainobject": "^4.0.6", "lodash.isstring": "^4.0.1", - "pipeline-cli": "git+https://github.com/bcgov/biohubbc-pipeline-cli.git", - "zod": "^3.21.4" + "pipeline-cli": "git+https://github.com/bcgov/biohubbc-pipeline-cli.git" }, "devDependencies": { "prettier": "~2.3.2" diff --git a/app/.pipeline/templates/app.bc.yaml b/app/.pipeline/templates/app.bc.yaml index ccab4daca0..346a021e03 100644 --- a/app/.pipeline/templates/app.bc.yaml +++ b/app/.pipeline/templates/app.bc.yaml @@ -1,15 +1,15 @@ apiVersion: template.openshift.io/v1 kind: Template metadata: - name: sims-app-bc + name: biohubbc-app-bc labels: - build: sims-app + build: biohubbc-app parameters: - name: NAME displayName: Name description: Image name required: true - value: sims-app + value: biohubbc-app - name: SUFFIX displayName: Name Suffix description: A suffix appended to all objects diff --git a/app/.pipeline/templates/app.dc.yaml b/app/.pipeline/templates/app.dc.yaml index aec728f30b..6bc31cf023 100644 --- a/app/.pipeline/templates/app.dc.yaml +++ b/app/.pipeline/templates/app.dc.yaml @@ -1,12 +1,12 @@ apiVersion: template.openshift.io/v1 kind: Template metadata: - name: sims-app-dc + name: biohubbc-app-dc labels: - build: sims-app + build: biohubbc-app parameters: - name: NAME - value: sims-app + value: biohubbc-app - name: SUFFIX value: 'dev' - name: VERSION @@ -37,7 +37,7 @@ parameters: value: 'development' - name: OBJECT_STORE_SECRETS description: Secrets used to read and write to the S3 storage - value: 'sims-object-store' + value: 'biohubbc-object-store' - name: APP_PORT_DEFAULT description: Application default port value: '7100' diff --git a/app/.pipeline/utils/utils.js b/app/.pipeline/utils/utils.js new file mode 100644 index 0000000000..4009118ae9 --- /dev/null +++ b/app/.pipeline/utils/utils.js @@ -0,0 +1,56 @@ +'use strict'; + +/** + * Parses the npm cli command options and the git action context. + * + * @param {*} options + * @return {{ + * git: { + * dir: '', + * branch: { + * name: '', + * remote: '', + * merge: '' + * }, + * url: 'https://github.com/bcgov/biohubbc.git', + * uri: 'https://github.com/bcgov/biohubbc', + * http_url: 'https://github.com/bcgov/biohubbc.git', + * owner: 'bcgov', + * repository: 'biohubbc', + * pull_request: '', + * ref: '', + * branch_ref: '' + * }, + * env: 'pr' | 'dev' | 'test' | 'prod', + * phase: 'build' | 'deploy', + * pr?: '', + * branch?: '', + * config: {}, // JSON config map + * type?: 'static' + * }} + */ +const processOptions = (options) => { + const result = { ...options }; + + // Check git + if (!result.git.url.includes('.git')) { + result.git.url = `${result.git.url}.git`; + } + + if (!result.git.http_url.includes('.git')) { + result.git.http_url = `${result.git.http_url}.git`; + } + + // Fixing repo + if (result.git.repository.includes('/')) { + const last = result.git.repository.split('/').pop(); + const final = last.split('.')[0]; + result.git.repository = final; + } + + return result; +}; + +module.exports = { + processOptions +}; diff --git a/app/package-lock.json b/app/package-lock.json index 67b7a4058d..290583fdaf 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -5453,7 +5453,7 @@ "array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" }, "array-includes": { "version": "3.1.6", @@ -5594,7 +5594,7 @@ "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "at-least-node": { "version": "1.0.0", @@ -6407,7 +6407,7 @@ "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" }, "color-support": { "version": "1.1.3", @@ -6514,7 +6514,7 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, "concaveman": { "version": "1.2.1", @@ -6570,7 +6570,7 @@ "cookie-signature": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" }, "core-js": { "version": "3.31.1", @@ -7234,7 +7234,7 @@ "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==" }, "delegates": { "version": "1.0.0", @@ -7244,7 +7244,7 @@ "depd": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" + "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==" }, "dequal": { "version": "2.0.3", @@ -7255,7 +7255,7 @@ "destroy": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" + "integrity": "sha512-3NdhDuEXnfun/z7x9GOElY49LoqVHoGScmOKwmxhsS8N5Y+Z8KyPPDnaSzqWgYt/ji4mqwfTS34Htrk0zPIXVg==" }, "detect-newline": { "version": "3.1.0", @@ -7486,7 +7486,7 @@ "ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "ejs": { "version": "3.1.9", @@ -7522,7 +7522,7 @@ "encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" }, "encoding": { "version": "0.1.13", @@ -7739,12 +7739,12 @@ "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==" }, "escodegen": { "version": "2.1.0", @@ -8448,7 +8448,7 @@ "etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" }, "eventemitter3": { "version": "4.0.7", @@ -9042,7 +9042,7 @@ "fresh": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==" }, "fs-constants": { "version": "1.0.0", @@ -9078,7 +9078,7 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, "fsevents": { "version": "2.3.2", @@ -9385,7 +9385,7 @@ "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==" }, "has-property-descriptors": { "version": "1.0.0", @@ -9727,7 +9727,7 @@ "immediate": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", - "integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=" + "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==" }, "immer": { "version": "9.0.21", @@ -9772,7 +9772,7 @@ "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "requires": { "once": "^1.3.0", "wrappy": "1" @@ -9842,7 +9842,7 @@ "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==" }, "is-bigint": { "version": "1.0.4", @@ -10085,7 +10085,7 @@ "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==" }, "is-weakmap": { "version": "2.0.1", @@ -10123,12 +10123,12 @@ "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" }, "isstream": { "version": "0.1.2", @@ -12966,7 +12966,7 @@ "leaflet-fullscreen": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/leaflet-fullscreen/-/leaflet-fullscreen-1.0.2.tgz", - "integrity": "sha1-CcYcS6xF9jsu4Sav2H5c2XZQ/Bs=" + "integrity": "sha512-1Yxm8RZg6KlKX25+hbP2H/wnOAphH7hFcvuADJFb4QZTN7uOSN9Hsci5EZpow8vtNej9OGzu59Jxmn+0qKOO9Q==" }, "leaflet.locatecontrol": { "version": "0.79.0", @@ -13043,7 +13043,7 @@ "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", "dev": true } } @@ -13205,7 +13205,7 @@ "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==" }, "memfs": { "version": "3.5.3", @@ -13295,7 +13295,7 @@ "merge-descriptors": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" }, "merge-stream": { "version": "2.0.0", @@ -13312,7 +13312,7 @@ "methods": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==" }, "mgrs": { "version": "1.0.0", @@ -14043,7 +14043,7 @@ "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==" }, "object-hash": { "version": "3.0.0", @@ -14155,7 +14155,7 @@ "on-finished": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", "requires": { "ee-first": "1.1.1" } @@ -14169,7 +14169,7 @@ "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "requires": { "wrappy": "1" } @@ -14326,7 +14326,7 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" }, "path-key": { "version": "3.1.1", @@ -14341,7 +14341,7 @@ "path-to-regexp": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" }, "path-type": { "version": "4.0.0", @@ -14351,7 +14351,7 @@ "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==" }, "picocolors": { "version": "1.0.0", @@ -14372,7 +14372,7 @@ "pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", "dev": true }, "pirates": { @@ -17157,7 +17157,7 @@ "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==" }, "require-from-string": { "version": "2.0.2", @@ -17726,7 +17726,7 @@ "lru-cache": { "version": "2.7.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", - "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=" + "integrity": "sha512-WpibWJ60c3AgAz8a2iYErDrcT2C7OmKnsWhIcHOjkUHFjkXncJhtLxNSqUmxRxRunpb5I8Vprd7aNSd2NtksJQ==" } } }, @@ -17801,7 +17801,7 @@ "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==" }, "source-map-js": { "version": "1.0.2", @@ -17992,7 +17992,7 @@ "statuses": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==" }, "stdout-stream": { "version": "1.4.1", @@ -18611,7 +18611,7 @@ "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=" + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==" }, "to-regex-range": { "version": "5.0.1", @@ -18630,7 +18630,7 @@ "toposort": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/toposort/-/toposort-2.0.2.tgz", - "integrity": "sha1-riF2gXXRVZ1IvvNUILL0li8JwzA=" + "integrity": "sha512-0a5EOkAUp8D4moMi2W8ZF8jcga7BgZd91O/yabJCFY8az+XSzeGyTKs0Aoo897iV1Nj6guFq8orWDS96z91oGg==" }, "tough-cookie": { "version": "2.5.0", @@ -18896,7 +18896,7 @@ "unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==" }, "unquote": { "version": "1.1.1", @@ -18953,7 +18953,7 @@ "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, "util.promisify": { "version": "1.0.1", @@ -18976,7 +18976,7 @@ "utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==" }, "uuid": { "version": "8.3.2", @@ -19019,7 +19019,7 @@ "vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==" }, "verror": { "version": "1.10.0", @@ -19739,7 +19739,7 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "write-file-atomic": { "version": "4.0.2", @@ -19760,7 +19760,7 @@ "xml": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz", - "integrity": "sha1-eLpyAgApxbyHuKgaPPzXS0ovweU=", + "integrity": "sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw==", "dev": true }, "xml-name-validator": { diff --git a/database/.pipeline/config.js b/database/.pipeline/config.js index e0c09d91f2..464ab59fa5 100644 --- a/database/.pipeline/config.js +++ b/database/.pipeline/config.js @@ -1,78 +1,27 @@ 'use strict'; const PipelineCli = require('pipeline-cli'); +const { processOptions } = require('./utils/utils'); // Options passed in from the git action const rawOptions = PipelineCli.Util.parseArguments(); -// Pull-request number or branch name +const options = processOptions(rawOptions); + +// Get pull-request number from git action '--pr' arg const changeId = rawOptions.pr; -// Pipeline config map from openshift -const rawPipelineConfigMap = rawOptions.config; -// Validate the pipeline config map is not missing any fields -const pipelineConfigMap = JSON.parse(rawPipelineConfigMap); +// Get pipeline config map from git action '--config' arg +const pipelineConfigMapString = rawOptions.config; +const pipelineConfigMap = JSON.parse(pipelineConfigMapString); // A static deployment is when the deployment is updating dev, test, or prod (rather than a temporary PR) // See `--type=static` in the `deployStatic.yml` git workflow const isStaticDeployment = rawOptions.type === 'static'; -const branch = (isStaticDeployment && rawOptions.branch) || null; - -const dbSetupDockerfilePath = './.docker/db/Dockerfile.setup'; - -/** - * Parses the npm cli command options and the git action context. - * - * @param {*} options - * @return {{ - * git: { - * dir: '', - * branch: { - * name: '', - * remote: '', - * merge: '' - * }, - * url: 'https://github.com/bcgov/biohubbc.git', - * uri: 'https://github.com/bcgov/biohubbc', - * http_url: 'https://github.com/bcgov/biohubbc.git', - * owner: 'bcgov', - * repository: 'biohubbc', - * pull_request: '', - * ref: '', - * branch_ref: '' - * }, - * env: 'pr' | 'dev' | 'test' | 'prod', - * phase: 'build' | 'deploy', - * pr?: '', - * branch?: '', - * config: {}, // JSON config map - * type?: 'static' - * }} - */ -function processOptions(options) { - const result = { ...options }; - - // Check git - if (!result.git.url.includes('.git')) { - result.git.url = `${result.git.url}.git`; - } - - if (!result.git.http_url.includes('.git')) { - result.git.http_url = `${result.git.http_url}.git`; - } - - // Fixing repo - if (result.git.repository.includes('/')) { - const last = result.git.repository.split('/').pop(); - const final = last.split('.')[0]; - result.git.repository = final; - } - - return result; -} - -const options = processOptions(rawOptions); +// The branch name, which is either the branch name provided in the git action (for a static deploy) or the current git +// branch name (in the case of a PR deploy) +const branch = (isStaticDeployment && rawOptions.branch) || options.git.ref; const phases = { pr: { @@ -84,7 +33,7 @@ const phases = { instance: `${pipelineConfigMap.module.db}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, tag: tag, - branch: branch || options.git.ref + branch: branch }, deploy: { ...pipelineConfigMap.database.pr.deploy, @@ -105,7 +54,7 @@ const phases = { instance: `${pipelineConfigMap.module.db}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, tag: tag, - branch: branch || options.git.ref + branch: branch }, deploy: { ...pipelineConfigMap.database.dev.deploy, @@ -126,7 +75,7 @@ const phases = { instance: `${pipelineConfigMap.module.db}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, tag: tag, - branch: branch || options.git.ref + branch: branch }, deploy: { ...pipelineConfigMap.database.test.deploy, @@ -147,7 +96,7 @@ const phases = { instance: `${pipelineConfigMap.module.db}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, tag: tag, - branch: branch || options.git.ref + branch: branch }, deploy: { ...pipelineConfigMap.database.prod.deploy, diff --git a/database/.pipeline/package-lock.json b/database/.pipeline/package-lock.json index aa3783dada..83751a9d58 100644 --- a/database/.pipeline/package-lock.json +++ b/database/.pipeline/package-lock.json @@ -53,11 +53,6 @@ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz", "integrity": "sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==", "dev": true - }, - "zod": { - "version": "3.22.4", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.4.tgz", - "integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==" } } } diff --git a/database/.pipeline/package.json b/database/.pipeline/package.json index 80a8d2d18a..2f88bbbd01 100644 --- a/database/.pipeline/package.json +++ b/database/.pipeline/package.json @@ -28,8 +28,7 @@ "lodash.isfunction": "^3.0.9", "lodash.isplainobject": "^4.0.6", "lodash.isstring": "^4.0.1", - "pipeline-cli": "git+https://github.com/bcgov/biohubbc-pipeline-cli.git", - "zod": "^3.21.4" + "pipeline-cli": "git+https://github.com/bcgov/biohubbc-pipeline-cli.git" }, "devDependencies": { "prettier": "~2.3.2" diff --git a/database/.pipeline/templates/db.dc.yaml b/database/.pipeline/templates/db.dc.yaml index 75a41829b8..e955ef3c50 100644 --- a/database/.pipeline/templates/db.dc.yaml +++ b/database/.pipeline/templates/db.dc.yaml @@ -3,9 +3,9 @@ apiVersion: template.openshift.io/v1 labels: template: postgresql-persistent-template metadata: - name: sims-db-dc + name: biohubbc-db-dc labels: - build: sims-db + build: biohubbc-db parameters: - description: The name of the OpenShift Service exposed for the database. displayName: Database Service Name diff --git a/database/.pipeline/templates/db.setup.bc.yaml b/database/.pipeline/templates/db.setup.bc.yaml index 15e37b419d..20bcf1880a 100644 --- a/database/.pipeline/templates/db.setup.bc.yaml +++ b/database/.pipeline/templates/db.setup.bc.yaml @@ -1,15 +1,15 @@ apiVersion: template.openshift.io/v1 kind: Template metadata: - name: sims-db-setup-bc + name: biohubbc-db-setup-bc labels: - build: sims-db-setup + build: biohubbc-db-setup parameters: - name: NAME displayName: Name description: Image name required: true - value: sims-db-setup + value: biohubbc-db-setup - name: SUFFIX displayName: Name Suffix description: A suffix appended to all objects diff --git a/database/.pipeline/templates/db.setup.dc.yaml b/database/.pipeline/templates/db.setup.dc.yaml index b6d09508a6..39f354dd40 100644 --- a/database/.pipeline/templates/db.setup.dc.yaml +++ b/database/.pipeline/templates/db.setup.dc.yaml @@ -1,15 +1,15 @@ kind: Template apiVersion: template.openshift.io/v1 metadata: - name: sims-db-setup-dc + name: biohubbc-db-setup-dc labels: - build: sims-db-setup + build: biohubbc-db-setup parameters: - name: IMAGE description: 'Image for pod' required: true - name: NAME - value: sims-db-setup + value: biohubbc-db-setup - name: SUFFIX value: '-dev' - name: VERSION diff --git a/database/.pipeline/templates/db.setup.is.yaml b/database/.pipeline/templates/db.setup.is.yaml index 2482ba52dd..6434f042aa 100644 --- a/database/.pipeline/templates/db.setup.is.yaml +++ b/database/.pipeline/templates/db.setup.is.yaml @@ -2,7 +2,7 @@ apiVersion: template.openshift.io/v1 kind: Template parameters: - name: NAME - value: sims-db-setup + value: biohubbc-db-setup objects: - apiVersion: image.openshift.io/v1 kind: ImageStream diff --git a/database/.pipeline/utils/utils.js b/database/.pipeline/utils/utils.js index ba08779ca1..34b9182856 100644 --- a/database/.pipeline/utils/utils.js +++ b/database/.pipeline/utils/utils.js @@ -1,5 +1,56 @@ 'use strict'; +/** + * Parses the npm cli command options and the git action context. + * + * @param {*} options + * @return {{ + * git: { + * dir: '', + * branch: { + * name: '', + * remote: '', + * merge: '' + * }, + * url: 'https://github.com/bcgov/biohubbc.git', + * uri: 'https://github.com/bcgov/biohubbc', + * http_url: 'https://github.com/bcgov/biohubbc.git', + * owner: 'bcgov', + * repository: 'biohubbc', + * pull_request: '', + * ref: '', + * branch_ref: '' + * }, + * env: 'pr' | 'dev' | 'test' | 'prod', + * phase: 'build' | 'deploy', + * pr?: '', + * branch?: '', + * config: {}, // JSON config map + * type?: 'static' + * }} + */ +const processOptions = (options) => { + const result = { ...options }; + + // Check git + if (!result.git.url.includes('.git')) { + result.git.url = `${result.git.url}.git`; + } + + if (!result.git.http_url.includes('.git')) { + result.git.http_url = `${result.git.http_url}.git`; + } + + // Fixing repo + if (result.git.repository.includes('/')) { + const last = result.git.repository.split('/').pop(); + const final = last.split('.')[0]; + result.git.repository = final; + } + + return result; +}; + /** * Make an `oc get` command to fetch a resource by name. * @@ -315,6 +366,7 @@ const checkAndClean = async (resourceName, numberOfRetries, timeoutBetweenRetrie }; module.exports = { + processOptions, checkAndClean, deleteResourceByName, getResourceByName, From 0605d1460da1b86e55167a7bd5a57f370d1f78c2 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Thu, 14 Mar 2024 12:32:15 -0700 Subject: [PATCH 38/62] Revert more sims to biohubbc --- .github/workflows/cleanClosedPR.yml | 2 +- .github/workflows/cleanMergedPR.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cleanClosedPR.yml b/.github/workflows/cleanClosedPR.yml index f59f4c5b02..16904da8be 100644 --- a/.github/workflows/cleanClosedPR.yml +++ b/.github/workflows/cleanClosedPR.yml @@ -73,7 +73,7 @@ jobs: # Clean the reamaining build/deployment artifacts - name: Clean remaining Artifacts env: - POD_SELECTOR: sims + POD_SELECTOR: biohubbc run: | 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 diff --git a/.github/workflows/cleanMergedPR.yml b/.github/workflows/cleanMergedPR.yml index 9f4a9ae2eb..5f1a1f00f5 100644 --- a/.github/workflows/cleanMergedPR.yml +++ b/.github/workflows/cleanMergedPR.yml @@ -77,7 +77,7 @@ jobs: # Clean the reamaining build/deployment artifacts - name: Clean remaining Artifacts env: - POD_SELECTOR: sims + POD_SELECTOR: biohubbc run: | 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 From 575cf4a6a591f4d7fc53dbd1253f4baaec633818 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Thu, 14 Mar 2024 12:50:06 -0700 Subject: [PATCH 39/62] Update values ignore-skip --- .pipeline/configMaps/sims.configmap.yaml | 42 +++++++++++++++--------- api/.pipeline/lib/api.deploy.js | 2 +- api/.pipeline/templates/api.dc.yaml | 1 + app/.pipeline/lib/app.deploy.js | 2 +- 4 files changed, 30 insertions(+), 17 deletions(-) diff --git a/.pipeline/configMaps/sims.configmap.yaml b/.pipeline/configMaps/sims.configmap.yaml index b1c2824802..a6415de2c6 100644 --- a/.pipeline/configMaps/sims.configmap.yaml +++ b/.pipeline/configMaps/sims.configmap.yaml @@ -33,17 +33,20 @@ data: "backboneArtifactIntakePath": "/api/artifact/intake", "biohubTaxonTsnPath": "/api/taxonomy/taxon/tsn", "biohubTaxonPath": "/api/taxonomy/taxon", - "backboneIntakeEnabled": false, + "backboneIntakeEnabled": true, "bctwApiHost": "https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca", "critterbaseApiHost": "https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api", "s3KeyPrefix": "sims-pr", "logLevel": "debug", + "apiResponseValidationEnabled": true, + "databaseResponseValidationEnabled": true, + "nodeOptions": "--max_old_space_size=2250", "cpuRequest": "50m", "cpuLimit": "400m", "memoryRequest": "100Mi", - "memoryLimit": "2Gi", + "memoryLimit": "3Gi", "replicas": "1", - "replicasMax": "2" + "replicasMax": "1" } }, "dev": { @@ -66,15 +69,18 @@ data: "backboneArtifactIntakePath": "/api/artifact/intake", "biohubTaxonTsnPath": "/api/taxonomy/taxon/tsn", "biohubTaxonPath": "/api/taxonomy/taxon", - "backboneIntakeEnabled": false, + "backboneIntakeEnabled": true, "bctwApiHost": "https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca", "critterbaseApiHost": "https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api", "s3KeyPrefix": "sims", "logLevel": "debug", + "apiResponseValidationEnabled": true, + "databaseResponseValidationEnabled": true, + "nodeOptions": "--max_old_space_size=2250", "cpuRequest": "50m", - "cpuLimit": "400m", + "cpuLimit": "600m", "memoryRequest": "100Mi", - "memoryLimit": "2Gi", + "memoryLimit": "3Gi", "replicas": "1", "replicasMax": "2" } @@ -104,6 +110,9 @@ data: "critterbaseApiHost": "https://moe-critterbase-api-test.apps.silver.devops.gov.bc.ca/api", "s3KeyPrefix": "sims", "logLevel": "info", + "apiResponseValidationEnabled": true, + "databaseResponseValidationEnabled": true, + "nodeOptions": "--max_old_space_size=2250", "cpuRequest": "50m", "cpuLimit": "1000m", "memoryRequest": "100Mi", @@ -138,6 +147,9 @@ data: "critterbaseApiHost": "https://moe-critterbase-api-prod.apps.silver.devops.gov.bc.ca/api", "s3KeyPrefix": "sims", "logLevel": "warn", + "apiResponseValidationEnabled": true, + "databaseResponseValidationEnabled": true, + "nodeOptions": "--max_old_space_size=2250", "cpuRequest": "50m", "cpuLimit": "1000m", "memoryRequest": "100Mi", @@ -167,9 +179,9 @@ data: "biohubTaxonPath": "/api/taxonomy/taxon", "biohubTaxonTsnPath": "/api/taxonomy/taxon/tsn", "cpuRequest": "50m", - "cpuLimit": "200m", + "cpuLimit": "300m", "memoryRequest": "100Mi", - "memoryLimit": "333Mi", + "memoryLimit": "500Mi", "replicas": "1", "replicasMax": "1" } @@ -195,11 +207,11 @@ data: "biohubTaxonPath": "/api/taxonomy/taxon", "biohubTaxonTsnPath": "/api/taxonomy/taxon/tsn", "cpuRequest": "50m", - "cpuLimit": "200m", + "cpuLimit": "300m", "memoryRequest": "100Mi", - "memoryLimit": "333Mi", + "memoryLimit": "500Mi", "replicas": "1", - "replicasMax": "1" + "replicasMax": "2" } }, "test": { @@ -307,9 +319,9 @@ data: "numSeedSurveysPerProject": "2", "volumeCapacity": "3Gi", "cpuRequest": "50m", - "cpuLimit": "400m", + "cpuLimit": "600m", "memoryRequest": "100Mi", - "memoryLimit": "2Gi", + "memoryLimit": "3Gi", "replicas": "1" } }, @@ -331,7 +343,7 @@ data: "projectSeederUserIdentifier": "1", "numSeedProjects": "0", "numSeedSurveysPerProject": "0", - "volumeCapacity": "3Gi", + "volumeCapacity": "20Gi", "cpuRequest": "50m", "cpuLimit": "1000m", "memoryRequest": "100Mi", @@ -357,7 +369,7 @@ data: "projectSeederUserIdentifier": "1", "numSeedProjects": "0", "numSeedSurveysPerProject": "0", - "volumeCapacity": "5Gi", + "volumeCapacity": "20Gi", "cpuRequest": "50m", "cpuLimit": "1000m", "memoryRequest": "100Mi", diff --git a/api/.pipeline/lib/api.deploy.js b/api/.pipeline/lib/api.deploy.js index 430d1beeb4..f3f95edb29 100644 --- a/api/.pipeline/lib/api.deploy.js +++ b/api/.pipeline/lib/api.deploy.js @@ -37,9 +37,9 @@ const apiDeploy = async (settings) => { BACKBONE_INTERNAL_API_HOST: phases[env][phase].backboneInternalApiHost, BACKBONE_INTAKE_PATH: phases[env][phase].backboneIntakePath, BACKBONE_ARTIFACT_INTAKE_PATH: phases[env][phase].backboneArtifactIntakePath, - BACKBONE_INTAKE_ENABLED: phases[env][phase].backboneIntakeEnabled, BIOHUB_TAXON_PATH: phases[env][phase].biohubTaxonPath, BIOHUB_TAXON_TSN_PATH: phases[env][phase].biohubTaxonTsnPath, + BACKBONE_INTAKE_ENABLED: phases[env][phase].backboneIntakeEnabled, // BCTW / Critterbase BCTW_API_HOST: phases[env][phase].bctwApiHost, CB_API_HOST: phases[env][phase].critterbaseApiHost, diff --git a/api/.pipeline/templates/api.dc.yaml b/api/.pipeline/templates/api.dc.yaml index 24d79b8bfb..483ca49f4c 100644 --- a/api/.pipeline/templates/api.dc.yaml +++ b/api/.pipeline/templates/api.dc.yaml @@ -222,6 +222,7 @@ objects: value: ${VERSION} - name: CHANGE_VERSION value: ${CHANGE_ID} + # Node - name: NODE_ENV value: ${NODE_ENV} - name: NODE_OPTIONS diff --git a/app/.pipeline/lib/app.deploy.js b/app/.pipeline/lib/app.deploy.js index 18316dbec7..bb21d4d7c7 100644 --- a/app/.pipeline/lib/app.deploy.js +++ b/app/.pipeline/lib/app.deploy.js @@ -36,10 +36,10 @@ const appDeploy = async (settings) => { REACT_APP_KEYCLOAK_REALM: phases[env][phase].sso.realm, REACT_APP_KEYCLOAK_CLIENT_ID: phases[env][phase].sso.clientId, // BioHub Plastform (aka: Backbone) - REACT_APP_BIOHUB_FEATURE_FLAG: phases[env][phase].biohubFeatureFlag, REACT_APP_BACKBONE_PUBLIC_API_HOST: phases[env][phase].backbonePublicApiHost, REACT_APP_BIOHUB_TAXON_PATH: phases[env][phase].biohubTaxonPath, REACT_APP_BIOHUB_TAXON_TSN_PATH: phases[env][phase].biohubTaxonTsnPath, + REACT_APP_BIOHUB_FEATURE_FLAG: phases[env][phase].biohubFeatureFlag, // Openshift Resources CPU_REQUEST: phases[env][phase].cpuRequest, CPU_LIMIT: phases[env][phase].cpuLimit, From d0232b9f2b5c865a78694781f0b2cd7d127ead8b Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Thu, 14 Mar 2024 13:31:23 -0700 Subject: [PATCH 40/62] Update config env ignore-skip --- .github/workflows/deploy.yml | 4 ++-- .github/workflows/deployStatic.yml | 4 ++-- .pipeline/configMaps/README.md | 8 ++++---- .pipeline/configMaps/sims.configmap.yaml | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index db64ed29a7..dbf1160c2d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -147,11 +147,11 @@ jobs: - 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' and store in 'pipeline_config' variable for use by subsequent jobs + # 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 get configmap sims-pipeline-config -o jsonpath={.data.config} | jq -c )" >> "$GITHUB_OUTPUT" + 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: diff --git a/.github/workflows/deployStatic.yml b/.github/workflows/deployStatic.yml index 8aa3e25d9a..5ddca86040 100644 --- a/.github/workflows/deployStatic.yml +++ b/.github/workflows/deployStatic.yml @@ -102,11 +102,11 @@ jobs: - 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' and store in 'pipeline_config' variable for use by subsequent jobs + # 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 get configmap sims-pipeline-config -o jsonpath={.data.config} | jq -c )" >> "$GITHUB_OUTPUT" + 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: diff --git a/.pipeline/configMaps/README.md b/.pipeline/configMaps/README.md index 18a2c51355..72ad12e30b 100644 --- a/.pipeline/configMaps/README.md +++ b/.pipeline/configMaps/README.md @@ -1,14 +1,14 @@ # Openshift Config Map -`sims-pipeline-config.json` is a working sample of the config map that should be created in each openshift environment. +`sims-pipeline-config.json` is a working sample of the config map that should be created in the tools environment. Note: The exact values in the sample config map may fall out of sync with what is in Openshift, as changes to values are made directly in Openshift (ex: updating cpu/memory limits in OpenShift, etc). -**Note: Config maps should never contain secrets, passwords, or other sensitive values. They are not protected in OpenShift and their values may appear in logs, etc. Sensitive data should always be stored in Openshift secrets.** +Note: Config maps should never contain secrets, passwords, or other sensitive values. They are not protected in OpenShift and their values may appear in logs, etc. Sensitive data should always be stored in Openshift secrets. ## Create Config Map in Openshift -Under the target environment (dev, test, prod) +Under the tools environment: `af2668-tools` #### Option 1 @@ -30,7 +30,7 @@ Under `Workloads` -> `ConfigMaps` ## Updating Config Map in Openshift -Under the target environment (dev, test, prod) +Under the tools environment: `af2668-tools` Under `Workloads` -> `ConfigMaps` diff --git a/.pipeline/configMaps/sims.configmap.yaml b/.pipeline/configMaps/sims.configmap.yaml index a6415de2c6..44d8ca4b0e 100644 --- a/.pipeline/configMaps/sims.configmap.yaml +++ b/.pipeline/configMaps/sims.configmap.yaml @@ -2,7 +2,7 @@ kind: ConfigMap apiVersion: v1 metadata: name: sims-pipeline-config - namespace: af2668-dev + namespace: af2668-tools immutable: false data: config: | From e1d9831bf584d3c4196554614a14dff27ac20376 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Thu, 14 Mar 2024 15:01:18 -0700 Subject: [PATCH 41/62] Updates ignore-skip --- .github/workflows/deployStatic.yml | 16 ++++++++-------- api/.pipeline/config.js | 18 +++++------------- api/.pipeline/utils/utils.js | 7 +++---- app/.pipeline/config.js | 18 +++++------------- app/.pipeline/utils/utils.js | 7 +++---- database/.pipeline/config.js | 14 +++++--------- database/.pipeline/utils/utils.js | 7 +++---- 7 files changed, 32 insertions(+), 55 deletions(-) diff --git a/.github/workflows/deployStatic.yml b/.github/workflows/deployStatic.yml index 5ddca86040..4f7d143c3d 100644 --- a/.github/workflows/deployStatic.yml +++ b/.github/workflows/deployStatic.yml @@ -158,7 +158,7 @@ jobs: - name: Build APP Image working-directory: "app/.pipeline/" run: | - DEBUG=* npm run build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --branch=$BRANCH --type=static + DEBUG=* npm run build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=$BRANCH --phase=build --branch=$BRANCH # Build the Database image buildDatabase: @@ -210,7 +210,7 @@ jobs: - name: Build Database Image working-directory: "database/.pipeline/" run: | - DEBUG=* npm run db:build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --branch=$BRANCH --type=static + DEBUG=* npm run db:build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=$BRANCH --phase=build --branch=$BRANCH # Build the Database Setup image buildDatabaseSetup: @@ -262,7 +262,7 @@ jobs: - name: Build Database Setup Image working-directory: "database/.pipeline/" run: | - DEBUG=* npm run db-setup:build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --branch=$BRANCH --type=static + DEBUG=* npm run db-setup:build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=$BRANCH --phase=build --branch=$BRANCH # Build the API image buildAPI: @@ -314,7 +314,7 @@ jobs: - name: Build API Image working-directory: "api/.pipeline/" run: | - DEBUG=* npm run build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --branch=$BRANCH --type=static + DEBUG=* npm run build -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=$BRANCH --phase=build --branch=$BRANCH # Deploy APP image deployAPP: @@ -367,7 +367,7 @@ jobs: - name: Deploy APP Image working-directory: "app/.pipeline" run: | - DEBUG=* npm run deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=$BRANCH --phase=deploy --branch=$BRANCH --type=static + DEBUG=* npm run deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=$BRANCH --phase=deploy --branch=$BRANCH # Deploy Database image deployDatabase: @@ -420,7 +420,7 @@ jobs: - name: Deploy Database Image working-directory: "database/.pipeline/" run: | - DEBUG=* npm run db:deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=$BRANCH --phase=deploy --branch=$BRANCH --type=static + DEBUG=* npm run db:deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=$BRANCH --phase=deploy --branch=$BRANCH # Deploy Database setup image deployDatabaseSetup: @@ -474,7 +474,7 @@ jobs: - name: Deploy Database Setup Image working-directory: "database/.pipeline/" run: | - DEBUG=* npm run db-setup:deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=$BRANCH --phase=deploy --branch=$BRANCH --type=static + DEBUG=* npm run db-setup:deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=$BRANCH --phase=deploy --branch=$BRANCH # Deploy API image deployAPI: @@ -528,7 +528,7 @@ jobs: - name: Deploy API Image working-directory: "api/.pipeline/" run: | - DEBUG=* npm run deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=$BRANCH --phase=deploy --branch=$BRANCH --type=static + DEBUG=* npm run deploy -- --pr=$PR_NUMBER --config=$PIPELINE_CONFIG --env=$BRANCH --phase=deploy --branch=$BRANCH # Clean build/deployment artifacts clean: diff --git a/api/.pipeline/config.js b/api/.pipeline/config.js index 2a04377cf0..7b95aed588 100644 --- a/api/.pipeline/config.js +++ b/api/.pipeline/config.js @@ -15,17 +15,9 @@ const changeId = rawOptions.pr; const pipelineConfigMapString = rawOptions.config; const pipelineConfigMap = JSON.parse(pipelineConfigMapString); -// A static deployment is when the deployment is updating dev, test, or prod (rather than a temporary PR) -// See `--type=static` in the `deployStatic.yml` git workflow -const isStaticDeployment = rawOptions.type === 'static'; - // The branch name, which is either the branch name provided in the git action (for a static deploy) or the current git // branch name (in the case of a PR deploy) -const branch = (isStaticDeployment && rawOptions.branch) || options.git.ref; - -const tag = - (branch && `build-${pipelineConfigMap.version}-${changeId}-${branch}`) || - `build-${pipelineConfigMap.version}-${changeId}`; +const branch = rawOptions.branch || null; const phases = { pr: { @@ -37,7 +29,7 @@ const phases = { suffix: `-build-${changeId}`, instance: `${pipelineConfigMap.module.api}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, - tag: tag, + tag: `build-${pipelineConfigMap.version}-${changeId}`, branch: branch }, deploy: { @@ -64,7 +56,7 @@ const phases = { suffix: `-build-${changeId}`, instance: `${pipelineConfigMap.module.api}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, - tag: tag, + tag: `build-${pipelineConfigMap.version}-${changeId}-${branch}`, branch: branch }, deploy: { @@ -90,7 +82,7 @@ const phases = { suffix: `-build-${changeId}`, instance: `${pipelineConfigMap.module.api}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, - tag: tag, + tag: `build-${pipelineConfigMap.version}-${changeId}-${branch}`, branch: branch }, deploy: { @@ -117,7 +109,7 @@ const phases = { suffix: `-build-${changeId}`, instance: `${pipelineConfigMap.module.api}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, - tag: tag, + tag: `build-${pipelineConfigMap.version}-${changeId}-${branch}`, branch: branch }, deploy: { diff --git a/api/.pipeline/utils/utils.js b/api/.pipeline/utils/utils.js index 4009118ae9..70f843959b 100644 --- a/api/.pipeline/utils/utils.js +++ b/api/.pipeline/utils/utils.js @@ -23,10 +23,9 @@ * }, * env: 'pr' | 'dev' | 'test' | 'prod', * phase: 'build' | 'deploy', - * pr?: '', - * branch?: '', - * config: {}, // JSON config map - * type?: 'static' + * config: {}, // sims pipeline config map + * pr?: '', // For PR based deployments + * branch?: '', // For static (dev, test, prod) deployments * }} */ const processOptions = (options) => { diff --git a/app/.pipeline/config.js b/app/.pipeline/config.js index b5c6c0c936..8b8756ad8e 100644 --- a/app/.pipeline/config.js +++ b/app/.pipeline/config.js @@ -15,17 +15,9 @@ const changeId = rawOptions.pr; const pipelineConfigMapString = rawOptions.config; const pipelineConfigMap = JSON.parse(pipelineConfigMapString); -// A static deployment is when the deployment is updating dev, test, or prod (rather than a temporary PR) -// See `--type=static` in the `deployStatic.yml` git workflow -const isStaticDeployment = rawOptions.type === 'static'; - // The branch name, which is either the branch name provided in the git action (for a static deploy) or the current git // branch name (in the case of a PR deploy) -const branch = (isStaticDeployment && rawOptions.branch) || options.git.ref; - -const tag = - (branch && `build-${pipelineConfigMap.version}-${changeId}-${branch}`) || - `build-${pipelineConfigMap.version}-${changeId}`; +const branch = rawOptions.branch || null; const phases = { pr: { @@ -36,7 +28,7 @@ const phases = { suffix: `-build-${changeId}`, instance: `${pipelineConfigMap.module.app}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, - tag: tag, + tag: `build-${pipelineConfigMap.version}-${changeId}`, branch: branch }, deploy: { @@ -60,7 +52,7 @@ const phases = { suffix: `-build-${changeId}`, instance: `${pipelineConfigMap.module.app}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, - tag: tag, + tag: `build-${pipelineConfigMap.version}-${changeId}-${branch}`, branch: branch }, deploy: { @@ -84,7 +76,7 @@ const phases = { suffix: `-build-${changeId}`, instance: `${pipelineConfigMap.module.app}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, - tag: tag, + tag: `build-${pipelineConfigMap.version}-${changeId}-${branch}`, branch: branch }, deploy: { @@ -108,7 +100,7 @@ const phases = { suffix: `-build-${changeId}`, instance: `${pipelineConfigMap.module.app}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, - tag: tag, + tag: `build-${pipelineConfigMap.version}-${changeId}-${branch}`, branch: branch }, deploy: { diff --git a/app/.pipeline/utils/utils.js b/app/.pipeline/utils/utils.js index 4009118ae9..70f843959b 100644 --- a/app/.pipeline/utils/utils.js +++ b/app/.pipeline/utils/utils.js @@ -23,10 +23,9 @@ * }, * env: 'pr' | 'dev' | 'test' | 'prod', * phase: 'build' | 'deploy', - * pr?: '', - * branch?: '', - * config: {}, // JSON config map - * type?: 'static' + * config: {}, // sims pipeline config map + * pr?: '', // For PR based deployments + * branch?: '', // For static (dev, test, prod) deployments * }} */ const processOptions = (options) => { diff --git a/database/.pipeline/config.js b/database/.pipeline/config.js index 464ab59fa5..2b5a2aeb44 100644 --- a/database/.pipeline/config.js +++ b/database/.pipeline/config.js @@ -15,13 +15,9 @@ const changeId = rawOptions.pr; const pipelineConfigMapString = rawOptions.config; const pipelineConfigMap = JSON.parse(pipelineConfigMapString); -// A static deployment is when the deployment is updating dev, test, or prod (rather than a temporary PR) -// See `--type=static` in the `deployStatic.yml` git workflow -const isStaticDeployment = rawOptions.type === 'static'; - // The branch name, which is either the branch name provided in the git action (for a static deploy) or the current git // branch name (in the case of a PR deploy) -const branch = (isStaticDeployment && rawOptions.branch) || options.git.ref; +const branch = rawOptions.branch || null; const phases = { pr: { @@ -32,7 +28,7 @@ const phases = { suffix: `-build-${changeId}`, instance: `${pipelineConfigMap.module.db}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, - tag: tag, + tag: `build-${pipelineConfigMap.version}-${changeId}`, branch: branch }, deploy: { @@ -53,7 +49,7 @@ const phases = { suffix: `-build-${changeId}`, instance: `${pipelineConfigMap.module.db}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, - tag: tag, + tag: `build-${pipelineConfigMap.version}-${changeId}-${branch}`, branch: branch }, deploy: { @@ -74,7 +70,7 @@ const phases = { suffix: `-build-${changeId}`, instance: `${pipelineConfigMap.module.db}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, - tag: tag, + tag: `build-${pipelineConfigMap.version}-${changeId}-${branch}`, branch: branch }, deploy: { @@ -95,7 +91,7 @@ const phases = { suffix: `-build-${changeId}`, instance: `${pipelineConfigMap.module.db}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, - tag: tag, + tag: `build-${pipelineConfigMap.version}-${changeId}-${branch}`, branch: branch }, deploy: { diff --git a/database/.pipeline/utils/utils.js b/database/.pipeline/utils/utils.js index 34b9182856..0951abb9db 100644 --- a/database/.pipeline/utils/utils.js +++ b/database/.pipeline/utils/utils.js @@ -23,10 +23,9 @@ * }, * env: 'pr' | 'dev' | 'test' | 'prod', * phase: 'build' | 'deploy', - * pr?: '', - * branch?: '', - * config: {}, // JSON config map - * type?: 'static' + * config: {}, // sims pipeline config map + * pr?: '', // For PR based deployments + * branch?: '', // For static (dev, test, prod) deployments * }} */ const processOptions = (options) => { From 642944480ce6acec92feee659edbdb02a702699b Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Thu, 14 Mar 2024 15:29:00 -0700 Subject: [PATCH 42/62] Add logging when in PR phase --- api/.pipeline/config.js | 7 ++++++- app/.pipeline/config.js | 5 +++++ database/.pipeline/config.js | 5 +++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/api/.pipeline/config.js b/api/.pipeline/config.js index 7b95aed588..6880948455 100644 --- a/api/.pipeline/config.js +++ b/api/.pipeline/config.js @@ -44,7 +44,7 @@ const phases = { host: `${pipelineConfigMap.module.api}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, appHost: `${pipelineConfigMap.module.app}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, sso: pipelineConfigMap.sso.pr, - s3KeyPrefix: `local/${changeId}/${pipelineConfigMap.name}` + s3KeyPrefix: `${pipelineConfigMap.s3KeyPrefix}/${changeId}` } }, dev: { @@ -128,4 +128,9 @@ const phases = { } }; +if (options.phase === 'pr') { + console.debug(JSON.stringify(options, null, 2)); + console.debug(JSON.stringify(phases, null, 2)); +} + module.exports = exports = { phases, options }; diff --git a/app/.pipeline/config.js b/app/.pipeline/config.js index 8b8756ad8e..b7ba27cfd2 100644 --- a/app/.pipeline/config.js +++ b/app/.pipeline/config.js @@ -118,4 +118,9 @@ const phases = { } }; +if (options.phase === 'pr') { + console.debug(JSON.stringify(options, null, 2)); + console.debug(JSON.stringify(phases, null, 2)); +} + module.exports = exports = { phases, options }; diff --git a/database/.pipeline/config.js b/database/.pipeline/config.js index 2b5a2aeb44..9f53e5484f 100644 --- a/database/.pipeline/config.js +++ b/database/.pipeline/config.js @@ -106,4 +106,9 @@ const phases = { } }; +if (options.phase === 'pr') { + console.debug(JSON.stringify(options, null, 2)); + console.debug(JSON.stringify(phases, null, 2)); +} + module.exports = exports = { phases, options }; From 618c30d0908088767a6b8d91aa4d8c51cddc3214 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Thu, 14 Mar 2024 15:40:27 -0700 Subject: [PATCH 43/62] tweak --- api/.pipeline/config.js | 4 ++-- app/.pipeline/config.js | 4 ++-- database/.pipeline/config.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/.pipeline/config.js b/api/.pipeline/config.js index 6880948455..26fd6ba208 100644 --- a/api/.pipeline/config.js +++ b/api/.pipeline/config.js @@ -129,8 +129,8 @@ const phases = { }; if (options.phase === 'pr') { - console.debug(JSON.stringify(options, null, 2)); - console.debug(JSON.stringify(phases, null, 2)); + console.log(JSON.stringify(options)); + console.log(JSON.stringify(phases)); } module.exports = exports = { phases, options }; diff --git a/app/.pipeline/config.js b/app/.pipeline/config.js index b7ba27cfd2..6892d08c45 100644 --- a/app/.pipeline/config.js +++ b/app/.pipeline/config.js @@ -119,8 +119,8 @@ const phases = { }; if (options.phase === 'pr') { - console.debug(JSON.stringify(options, null, 2)); - console.debug(JSON.stringify(phases, null, 2)); + console.log(JSON.stringify(options)); + console.log(JSON.stringify(phases)); } module.exports = exports = { phases, options }; diff --git a/database/.pipeline/config.js b/database/.pipeline/config.js index 9f53e5484f..2db02dd5f4 100644 --- a/database/.pipeline/config.js +++ b/database/.pipeline/config.js @@ -107,8 +107,8 @@ const phases = { }; if (options.phase === 'pr') { - console.debug(JSON.stringify(options, null, 2)); - console.debug(JSON.stringify(phases, null, 2)); + console.log(JSON.stringify(options)); + console.log(JSON.stringify(phases)); } module.exports = exports = { phases, options }; From ba966a87a8beb8c4cbf3edf3211c020d9a2b5b1c Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Thu, 14 Mar 2024 15:58:54 -0700 Subject: [PATCH 44/62] move logging --- api/.pipeline/config.js | 5 ----- api/.pipeline/scripts/api.build.js | 5 +++++ app/.pipeline/config.js | 5 ----- app/.pipeline/scripts/app.build.js | 5 +++++ database/.pipeline/config.js | 5 ----- database/.pipeline/scripts/db.build.js | 5 +++++ database/.pipeline/scripts/db.setup.build.js | 5 +++++ 7 files changed, 20 insertions(+), 15 deletions(-) diff --git a/api/.pipeline/config.js b/api/.pipeline/config.js index 26fd6ba208..bc94c48747 100644 --- a/api/.pipeline/config.js +++ b/api/.pipeline/config.js @@ -128,9 +128,4 @@ const phases = { } }; -if (options.phase === 'pr') { - console.log(JSON.stringify(options)); - console.log(JSON.stringify(phases)); -} - module.exports = exports = { phases, options }; diff --git a/api/.pipeline/scripts/api.build.js b/api/.pipeline/scripts/api.build.js index e69590ad61..13adb175ad 100644 --- a/api/.pipeline/scripts/api.build.js +++ b/api/.pipeline/scripts/api.build.js @@ -3,5 +3,10 @@ const { apiBuild } = require('../lib/api.build.js'); const config = require('../config.js'); +if (config.options.phase === 'pr') { + console.log(JSON.stringify(options)); + console.log(JSON.stringify(phases)); +} + // Builds the api image apiBuild(config); diff --git a/app/.pipeline/config.js b/app/.pipeline/config.js index 6892d08c45..8b8756ad8e 100644 --- a/app/.pipeline/config.js +++ b/app/.pipeline/config.js @@ -118,9 +118,4 @@ const phases = { } }; -if (options.phase === 'pr') { - console.log(JSON.stringify(options)); - console.log(JSON.stringify(phases)); -} - module.exports = exports = { phases, options }; diff --git a/app/.pipeline/scripts/app.build.js b/app/.pipeline/scripts/app.build.js index 95881a34be..54a2a95d49 100644 --- a/app/.pipeline/scripts/app.build.js +++ b/app/.pipeline/scripts/app.build.js @@ -3,5 +3,10 @@ const { appBuild } = require('../lib/app.build.js'); const config = require('../config.js'); +if (config.options.phase === 'pr') { + console.log(JSON.stringify(options)); + console.log(JSON.stringify(phases)); +} + // Builds the app image appBuild(config); diff --git a/database/.pipeline/config.js b/database/.pipeline/config.js index 2db02dd5f4..2b5a2aeb44 100644 --- a/database/.pipeline/config.js +++ b/database/.pipeline/config.js @@ -106,9 +106,4 @@ const phases = { } }; -if (options.phase === 'pr') { - console.log(JSON.stringify(options)); - console.log(JSON.stringify(phases)); -} - module.exports = exports = { phases, options }; diff --git a/database/.pipeline/scripts/db.build.js b/database/.pipeline/scripts/db.build.js index 664f29b96a..93e6509f7a 100644 --- a/database/.pipeline/scripts/db.build.js +++ b/database/.pipeline/scripts/db.build.js @@ -3,5 +3,10 @@ const { dbBuild } = require('../lib/db.build.js'); const config = require('../config.js'); +if (config.options.phase === 'pr') { + console.log(JSON.stringify(options)); + console.log(JSON.stringify(phases)); +} + // builds the database image dbBuild(config); diff --git a/database/.pipeline/scripts/db.setup.build.js b/database/.pipeline/scripts/db.setup.build.js index 23b7273536..4a82172cd7 100644 --- a/database/.pipeline/scripts/db.setup.build.js +++ b/database/.pipeline/scripts/db.setup.build.js @@ -3,5 +3,10 @@ const { dbSetupBuild } = require('../lib/db.setup.build.js'); const config = require('../config.js'); +if (config.options.phase === 'pr') { + console.log(JSON.stringify(options)); + console.log(JSON.stringify(phases)); +} + // build database Setup (migrations, seeding, etc) image dbSetupBuild(config); From eb1657100bcb61ffc8bbf9def16c56bb9b53877b Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Thu, 14 Mar 2024 16:04:25 -0700 Subject: [PATCH 45/62] Tweaks --- api/.pipeline/scripts/api.build.js | 8 ++++---- app/.pipeline/scripts/app.build.js | 8 ++++---- database/.pipeline/scripts/db.build.js | 8 ++++---- database/.pipeline/scripts/db.setup.build.js | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/api/.pipeline/scripts/api.build.js b/api/.pipeline/scripts/api.build.js index 13adb175ad..6a6d094def 100644 --- a/api/.pipeline/scripts/api.build.js +++ b/api/.pipeline/scripts/api.build.js @@ -3,10 +3,10 @@ const { apiBuild } = require('../lib/api.build.js'); const config = require('../config.js'); -if (config.options.phase === 'pr') { - console.log(JSON.stringify(options)); - console.log(JSON.stringify(phases)); -} +// if (config.options.phase === 'pr') { +console.log(JSON.stringify(options)); +console.log(JSON.stringify(phases)); +// } // Builds the api image apiBuild(config); diff --git a/app/.pipeline/scripts/app.build.js b/app/.pipeline/scripts/app.build.js index 54a2a95d49..08139801f0 100644 --- a/app/.pipeline/scripts/app.build.js +++ b/app/.pipeline/scripts/app.build.js @@ -3,10 +3,10 @@ const { appBuild } = require('../lib/app.build.js'); const config = require('../config.js'); -if (config.options.phase === 'pr') { - console.log(JSON.stringify(options)); - console.log(JSON.stringify(phases)); -} +// if (config.options.phase === 'pr') { +console.log(JSON.stringify(options)); +console.log(JSON.stringify(phases)); +// } // Builds the app image appBuild(config); diff --git a/database/.pipeline/scripts/db.build.js b/database/.pipeline/scripts/db.build.js index 93e6509f7a..d8d6d9560f 100644 --- a/database/.pipeline/scripts/db.build.js +++ b/database/.pipeline/scripts/db.build.js @@ -3,10 +3,10 @@ const { dbBuild } = require('../lib/db.build.js'); const config = require('../config.js'); -if (config.options.phase === 'pr') { - console.log(JSON.stringify(options)); - console.log(JSON.stringify(phases)); -} +// if (config.options.phase === 'pr') { +console.log(JSON.stringify(options)); +console.log(JSON.stringify(phases)); +// } // builds the database image dbBuild(config); diff --git a/database/.pipeline/scripts/db.setup.build.js b/database/.pipeline/scripts/db.setup.build.js index 4a82172cd7..a6d3d3bb13 100644 --- a/database/.pipeline/scripts/db.setup.build.js +++ b/database/.pipeline/scripts/db.setup.build.js @@ -3,10 +3,10 @@ const { dbSetupBuild } = require('../lib/db.setup.build.js'); const config = require('../config.js'); -if (config.options.phase === 'pr') { - console.log(JSON.stringify(options)); - console.log(JSON.stringify(phases)); -} +// if (config.options.phase === 'pr') { +console.log(JSON.stringify(options)); +console.log(JSON.stringify(phases)); +// } // build database Setup (migrations, seeding, etc) image dbSetupBuild(config); From dce8a826d41a9b65bcc332dafa740f6dc7c3767a Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Thu, 14 Mar 2024 16:06:26 -0700 Subject: [PATCH 46/62] Fix log issue --- api/.pipeline/scripts/api.build.js | 4 ++-- app/.pipeline/scripts/app.build.js | 4 ++-- database/.pipeline/scripts/db.build.js | 4 ++-- database/.pipeline/scripts/db.setup.build.js | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/api/.pipeline/scripts/api.build.js b/api/.pipeline/scripts/api.build.js index 6a6d094def..994da2f53c 100644 --- a/api/.pipeline/scripts/api.build.js +++ b/api/.pipeline/scripts/api.build.js @@ -4,8 +4,8 @@ const { apiBuild } = require('../lib/api.build.js'); const config = require('../config.js'); // if (config.options.phase === 'pr') { -console.log(JSON.stringify(options)); -console.log(JSON.stringify(phases)); +console.log(JSON.stringify(config.options)); +console.log(JSON.stringify(config.phases)); // } // Builds the api image diff --git a/app/.pipeline/scripts/app.build.js b/app/.pipeline/scripts/app.build.js index 08139801f0..967a387870 100644 --- a/app/.pipeline/scripts/app.build.js +++ b/app/.pipeline/scripts/app.build.js @@ -4,8 +4,8 @@ const { appBuild } = require('../lib/app.build.js'); const config = require('../config.js'); // if (config.options.phase === 'pr') { -console.log(JSON.stringify(options)); -console.log(JSON.stringify(phases)); +console.log(JSON.stringify(config.options)); +console.log(JSON.stringify(config.phases)); // } // Builds the app image diff --git a/database/.pipeline/scripts/db.build.js b/database/.pipeline/scripts/db.build.js index d8d6d9560f..d473708646 100644 --- a/database/.pipeline/scripts/db.build.js +++ b/database/.pipeline/scripts/db.build.js @@ -4,8 +4,8 @@ const { dbBuild } = require('../lib/db.build.js'); const config = require('../config.js'); // if (config.options.phase === 'pr') { -console.log(JSON.stringify(options)); -console.log(JSON.stringify(phases)); +console.log(JSON.stringify(config.options)); +console.log(JSON.stringify(config.phases)); // } // builds the database image diff --git a/database/.pipeline/scripts/db.setup.build.js b/database/.pipeline/scripts/db.setup.build.js index a6d3d3bb13..101541ac22 100644 --- a/database/.pipeline/scripts/db.setup.build.js +++ b/database/.pipeline/scripts/db.setup.build.js @@ -4,8 +4,8 @@ const { dbSetupBuild } = require('../lib/db.setup.build.js'); const config = require('../config.js'); // if (config.options.phase === 'pr') { -console.log(JSON.stringify(options)); -console.log(JSON.stringify(phases)); +console.log(JSON.stringify(config.options)); +console.log(JSON.stringify(config.phases)); // } // build database Setup (migrations, seeding, etc) image From 57ee7288a32729ba244aba5951421e6a0106a0b1 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Thu, 14 Mar 2024 16:36:30 -0700 Subject: [PATCH 47/62] Updates --- api/.pipeline/config.js | 9 ++++----- api/.pipeline/scripts/api.build.js | 8 ++++---- app/.pipeline/config.js | 9 ++++----- app/.pipeline/scripts/app.build.js | 8 ++++---- database/.pipeline/config.js | 9 ++++----- database/.pipeline/scripts/db.build.js | 8 ++++---- database/.pipeline/scripts/db.setup.build.js | 8 ++++---- 7 files changed, 28 insertions(+), 31 deletions(-) diff --git a/api/.pipeline/config.js b/api/.pipeline/config.js index bc94c48747..6c2e55d1b4 100644 --- a/api/.pipeline/config.js +++ b/api/.pipeline/config.js @@ -11,14 +11,13 @@ const options = processOptions(rawOptions); // Get pull-request number from git action '--pr' arg const changeId = rawOptions.pr; +// Get branch name from the git action '--branch' arg +const branch = rawOptions.branch || null; + // Get pipeline config map from git action '--config' arg const pipelineConfigMapString = rawOptions.config; const pipelineConfigMap = JSON.parse(pipelineConfigMapString); -// The branch name, which is either the branch name provided in the git action (for a static deploy) or the current git -// branch name (in the case of a PR deploy) -const branch = rawOptions.branch || null; - const phases = { pr: { build: { @@ -30,7 +29,7 @@ const phases = { instance: `${pipelineConfigMap.module.api}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, tag: `build-${pipelineConfigMap.version}-${changeId}`, - branch: branch + branch: options.git.ref }, deploy: { ...pipelineConfigMap.api.pr.deploy, diff --git a/api/.pipeline/scripts/api.build.js b/api/.pipeline/scripts/api.build.js index 994da2f53c..aede09d36d 100644 --- a/api/.pipeline/scripts/api.build.js +++ b/api/.pipeline/scripts/api.build.js @@ -3,10 +3,10 @@ const { apiBuild } = require('../lib/api.build.js'); const config = require('../config.js'); -// if (config.options.phase === 'pr') { -console.log(JSON.stringify(config.options)); -console.log(JSON.stringify(config.phases)); -// } +if (['pr', 'dev'].includes(config.options.env)) { + console.debug(JSON.stringify(config.options)); + console.debug(JSON.stringify(config.phases)); +} // Builds the api image apiBuild(config); diff --git a/app/.pipeline/config.js b/app/.pipeline/config.js index 8b8756ad8e..4cfc93c5e7 100644 --- a/app/.pipeline/config.js +++ b/app/.pipeline/config.js @@ -11,14 +11,13 @@ const options = processOptions(rawOptions); // Get pull-request number from git action '--pr' arg const changeId = rawOptions.pr; +// Get branch name from the git action '--branch' arg +const branch = rawOptions.branch || null; + // Get pipeline config map from git action '--config' arg const pipelineConfigMapString = rawOptions.config; const pipelineConfigMap = JSON.parse(pipelineConfigMapString); -// The branch name, which is either the branch name provided in the git action (for a static deploy) or the current git -// branch name (in the case of a PR deploy) -const branch = rawOptions.branch || null; - const phases = { pr: { build: { @@ -29,7 +28,7 @@ const phases = { instance: `${pipelineConfigMap.module.app}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, tag: `build-${pipelineConfigMap.version}-${changeId}`, - branch: branch + branch: options.git.ref }, deploy: { ...pipelineConfigMap.app.pr.deploy, diff --git a/app/.pipeline/scripts/app.build.js b/app/.pipeline/scripts/app.build.js index 967a387870..508c55fd5f 100644 --- a/app/.pipeline/scripts/app.build.js +++ b/app/.pipeline/scripts/app.build.js @@ -3,10 +3,10 @@ const { appBuild } = require('../lib/app.build.js'); const config = require('../config.js'); -// if (config.options.phase === 'pr') { -console.log(JSON.stringify(config.options)); -console.log(JSON.stringify(config.phases)); -// } +if (['pr', 'dev'].includes(config.options.env)) { + console.debug(JSON.stringify(config.options)); + console.debug(JSON.stringify(config.phases)); +} // Builds the app image appBuild(config); diff --git a/database/.pipeline/config.js b/database/.pipeline/config.js index 2b5a2aeb44..ac5b2cf989 100644 --- a/database/.pipeline/config.js +++ b/database/.pipeline/config.js @@ -11,14 +11,13 @@ const options = processOptions(rawOptions); // Get pull-request number from git action '--pr' arg const changeId = rawOptions.pr; +// Get branch name from the git action '--branch' arg +const branch = rawOptions.branch || null; + // Get pipeline config map from git action '--config' arg const pipelineConfigMapString = rawOptions.config; const pipelineConfigMap = JSON.parse(pipelineConfigMapString); -// The branch name, which is either the branch name provided in the git action (for a static deploy) or the current git -// branch name (in the case of a PR deploy) -const branch = rawOptions.branch || null; - const phases = { pr: { build: { @@ -29,7 +28,7 @@ const phases = { instance: `${pipelineConfigMap.module.db}-build-${changeId}`, version: `${pipelineConfigMap.version}-${changeId}`, tag: `build-${pipelineConfigMap.version}-${changeId}`, - branch: branch + branch: options.git.ref }, deploy: { ...pipelineConfigMap.database.pr.deploy, diff --git a/database/.pipeline/scripts/db.build.js b/database/.pipeline/scripts/db.build.js index d473708646..8a281c2577 100644 --- a/database/.pipeline/scripts/db.build.js +++ b/database/.pipeline/scripts/db.build.js @@ -3,10 +3,10 @@ const { dbBuild } = require('../lib/db.build.js'); const config = require('../config.js'); -// if (config.options.phase === 'pr') { -console.log(JSON.stringify(config.options)); -console.log(JSON.stringify(config.phases)); -// } +if (['pr', 'dev'].includes(config.options.env)) { + console.debug(JSON.stringify(config.options)); + console.debug(JSON.stringify(config.phases)); +} // builds the database image dbBuild(config); diff --git a/database/.pipeline/scripts/db.setup.build.js b/database/.pipeline/scripts/db.setup.build.js index 101541ac22..49e6eeb583 100644 --- a/database/.pipeline/scripts/db.setup.build.js +++ b/database/.pipeline/scripts/db.setup.build.js @@ -3,10 +3,10 @@ const { dbSetupBuild } = require('../lib/db.setup.build.js'); const config = require('../config.js'); -// if (config.options.phase === 'pr') { -console.log(JSON.stringify(config.options)); -console.log(JSON.stringify(config.phases)); -// } +if (['pr', 'dev'].includes(config.options.env)) { + console.debug(JSON.stringify(config.options)); + console.debug(JSON.stringify(config.phases)); +} // build database Setup (migrations, seeding, etc) image dbSetupBuild(config); From f6664ed9ded5e0fa81d158d73d60dc06fb3f3889 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Thu, 14 Mar 2024 17:14:25 -0700 Subject: [PATCH 48/62] Fix api loglevel env var --- api/.pipeline/lib/api.deploy.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/.pipeline/lib/api.deploy.js b/api/.pipeline/lib/api.deploy.js index f3f95edb29..0327383de0 100644 --- a/api/.pipeline/lib/api.deploy.js +++ b/api/.pipeline/lib/api.deploy.js @@ -64,9 +64,9 @@ const apiDeploy = async (settings) => { KEYCLOAK_API_HOST: phases[env][phase].sso.cssApi.cssApiHost, KEYCLOAK_API_ENVIRONMENT: phases[env][phase].sso.cssApi.cssApiEnvironment, // Log Level - LOG_LEVEL: phases[phase].logLevel, - API_RESPONSE_VALIDATION_ENABLED: phases[phase].apiResponseValidationEnabled, - DATABASE_RESPONSE_VALIDATION_ENABLED: phases[phase].databaseResponseValidationEnabled, + LOG_LEVEL: phases[env][phase].logLevel, + API_RESPONSE_VALIDATION_ENABLED: phases[env][phase].apiResponseValidationEnabled, + DATABASE_RESPONSE_VALIDATION_ENABLED: phases[env][phase].databaseResponseValidationEnabled, // Openshift Resources CPU_REQUEST: phases[env][phase].cpuRequest, CPU_LIMIT: phases[env][phase].cpuLimit, From 0de35be68122e3bfa78e35b6e16877d878b33357 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Fri, 15 Mar 2024 14:01:54 -0700 Subject: [PATCH 49/62] Minor cleanup --- api/.pipeline/config.js | 6 +++--- api/.pipeline/utils/utils.js | 6 +++--- app/.pipeline/config.js | 6 +++--- app/.pipeline/utils/utils.js | 6 +++--- database/.pipeline/config.js | 6 +++--- database/.pipeline/utils/utils.js | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/api/.pipeline/config.js b/api/.pipeline/config.js index 6c2e55d1b4..69f57b6697 100644 --- a/api/.pipeline/config.js +++ b/api/.pipeline/config.js @@ -9,13 +9,13 @@ const rawOptions = PipelineCli.Util.parseArguments(); const options = processOptions(rawOptions); // Get pull-request number from git action '--pr' arg -const changeId = rawOptions.pr; +const changeId = options.pr; // Get branch name from the git action '--branch' arg -const branch = rawOptions.branch || null; +const branch = options.branch || null; // Get pipeline config map from git action '--config' arg -const pipelineConfigMapString = rawOptions.config; +const pipelineConfigMapString = options.config; const pipelineConfigMap = JSON.parse(pipelineConfigMapString); const phases = { diff --git a/api/.pipeline/utils/utils.js b/api/.pipeline/utils/utils.js index 70f843959b..e199e6ebeb 100644 --- a/api/.pipeline/utils/utils.js +++ b/api/.pipeline/utils/utils.js @@ -23,9 +23,9 @@ * }, * env: 'pr' | 'dev' | 'test' | 'prod', * phase: 'build' | 'deploy', - * config: {}, // sims pipeline config map - * pr?: '', // For PR based deployments - * branch?: '', // For static (dev, test, prod) deployments + * config: string, // sims pipeline config map (stringified JSON) + * pr?: number, // For PR based deployments + * branch?: string, // For static (dev, test, prod) deployments * }} */ const processOptions = (options) => { diff --git a/app/.pipeline/config.js b/app/.pipeline/config.js index 4cfc93c5e7..52fe71f358 100644 --- a/app/.pipeline/config.js +++ b/app/.pipeline/config.js @@ -9,13 +9,13 @@ const rawOptions = PipelineCli.Util.parseArguments(); const options = processOptions(rawOptions); // Get pull-request number from git action '--pr' arg -const changeId = rawOptions.pr; +const changeId = options.pr; // Get branch name from the git action '--branch' arg -const branch = rawOptions.branch || null; +const branch = options.branch || null; // Get pipeline config map from git action '--config' arg -const pipelineConfigMapString = rawOptions.config; +const pipelineConfigMapString = options.config; const pipelineConfigMap = JSON.parse(pipelineConfigMapString); const phases = { diff --git a/app/.pipeline/utils/utils.js b/app/.pipeline/utils/utils.js index 70f843959b..e199e6ebeb 100644 --- a/app/.pipeline/utils/utils.js +++ b/app/.pipeline/utils/utils.js @@ -23,9 +23,9 @@ * }, * env: 'pr' | 'dev' | 'test' | 'prod', * phase: 'build' | 'deploy', - * config: {}, // sims pipeline config map - * pr?: '', // For PR based deployments - * branch?: '', // For static (dev, test, prod) deployments + * config: string, // sims pipeline config map (stringified JSON) + * pr?: number, // For PR based deployments + * branch?: string, // For static (dev, test, prod) deployments * }} */ const processOptions = (options) => { diff --git a/database/.pipeline/config.js b/database/.pipeline/config.js index ac5b2cf989..1fb27d1cc8 100644 --- a/database/.pipeline/config.js +++ b/database/.pipeline/config.js @@ -9,13 +9,13 @@ const rawOptions = PipelineCli.Util.parseArguments(); const options = processOptions(rawOptions); // Get pull-request number from git action '--pr' arg -const changeId = rawOptions.pr; +const changeId = options.pr; // Get branch name from the git action '--branch' arg -const branch = rawOptions.branch || null; +const branch = options.branch || null; // Get pipeline config map from git action '--config' arg -const pipelineConfigMapString = rawOptions.config; +const pipelineConfigMapString = options.config; const pipelineConfigMap = JSON.parse(pipelineConfigMapString); const phases = { diff --git a/database/.pipeline/utils/utils.js b/database/.pipeline/utils/utils.js index 0951abb9db..9dc831e507 100644 --- a/database/.pipeline/utils/utils.js +++ b/database/.pipeline/utils/utils.js @@ -23,9 +23,9 @@ * }, * env: 'pr' | 'dev' | 'test' | 'prod', * phase: 'build' | 'deploy', - * config: {}, // sims pipeline config map - * pr?: '', // For PR based deployments - * branch?: '', // For static (dev, test, prod) deployments + * config: string, // sims pipeline config map (stringified JSON) + * pr?: number, // For PR based deployments + * branch?: string, // For static (dev, test, prod) deployments * }} */ const processOptions = (options) => { From f196e9f63d7120338b7c54f26fc56e9a123ff5eb Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Fri, 15 Mar 2024 14:19:31 -0700 Subject: [PATCH 50/62] More misc doc --- .pipeline/configMaps/sims.configmap.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.pipeline/configMaps/sims.configmap.yaml b/.pipeline/configMaps/sims.configmap.yaml index 44d8ca4b0e..5478fa973b 100644 --- a/.pipeline/configMaps/sims.configmap.yaml +++ b/.pipeline/configMaps/sims.configmap.yaml @@ -3,6 +3,10 @@ apiVersion: v1 metadata: name: sims-pipeline-config namespace: af2668-tools + annotations: + description: | + This config map is required by the sims pipeline. It provides all of the configuration settings and environment + variables required by the pipeline. immutable: false data: config: | From ed8b75d47492c25323625e276d534fe77edd164e Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Fri, 15 Mar 2024 14:21:02 -0700 Subject: [PATCH 51/62] Update --- .pipeline/configMaps/sims.configmap.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.pipeline/configMaps/sims.configmap.yaml b/.pipeline/configMaps/sims.configmap.yaml index 5478fa973b..1b31a015ce 100644 --- a/.pipeline/configMaps/sims.configmap.yaml +++ b/.pipeline/configMaps/sims.configmap.yaml @@ -6,7 +6,8 @@ metadata: annotations: description: | This config map is required by the sims pipeline. It provides all of the configuration settings and environment - variables required by the pipeline. + variables required by the pipeline. This config is designed to exist, in the tools namespace, and + provide all of the configuration settings required by the pipeline for all environments (PR, DEV, TEST, PROD). immutable: false data: config: | From 99bfaad882e6f6e2137268487e9e468bf630c0ea Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Mon, 18 Mar 2024 13:08:04 -0700 Subject: [PATCH 52/62] Update env var names --- .pipeline/configMaps/sims.configmap.yaml | 660 +++---- Makefile | 28 + api/.pipeline/config.js | 146 +- api/.pipeline/lib/api.build.js | 24 +- api/.pipeline/lib/api.deploy.js | 90 +- api/.pipeline/lib/clean.js | 22 +- api/.pipeline/package-lock.json | 2057 ++++++++++++++++++++- api/.pipeline/package.json | 10 +- api/.pipeline/templates/api.dc.yaml | 6 +- app/.pipeline/config.js | 128 +- app/.pipeline/lib/app.build.js | 26 +- app/.pipeline/lib/app.deploy.js | 60 +- app/.pipeline/lib/clean.js | 22 +- app/.pipeline/package-lock.json | 2057 ++++++++++++++++++++- app/.pipeline/package.json | 10 +- app/.pipeline/templates/app.dc.yaml | 4 +- database/.pipeline/config.js | 104 +- database/.pipeline/lib/clean.js | 26 +- database/.pipeline/lib/db.build.js | 16 +- database/.pipeline/lib/db.deploy.js | 38 +- database/.pipeline/lib/db.setup.build.js | 26 +- database/.pipeline/lib/db.setup.deploy.js | 54 +- database/.pipeline/package-lock.json | 2057 ++++++++++++++++++++- database/.pipeline/package.json | 10 +- database/.pipeline/utils/utils.js | 34 +- 25 files changed, 6969 insertions(+), 746 deletions(-) diff --git a/.pipeline/configMaps/sims.configmap.yaml b/.pipeline/configMaps/sims.configmap.yaml index 1b31a015ce..c146763c43 100644 --- a/.pipeline/configMaps/sims.configmap.yaml +++ b/.pipeline/configMaps/sims.configmap.yaml @@ -22,434 +22,434 @@ data: "api": { "pr": { "build": { - "namespace": "af2668-tools", - "tz": "America/Vancouver", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "3Gi" + "NAMESPACE": "af2668-tools", + "TZ": "America/Vancouver", + "CPU_REQUEST": "50m", + "CPU_LIMIT": "1000m", + "MEMORY_REQUEST": "100Mi", + "MEMORY_LIMIT": "3Gi" }, "deploy": { - "namespace": "af2668-dev", - "nodeEnv": "development", - "tz": "America/Vancouver", - "backboneInternalApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", - "backboneIntakePath": "/api/dwc/submission/queue", - "backboneArtifactIntakePath": "/api/artifact/intake", - "biohubTaxonTsnPath": "/api/taxonomy/taxon/tsn", - "biohubTaxonPath": "/api/taxonomy/taxon", - "backboneIntakeEnabled": true, - "bctwApiHost": "https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca", - "critterbaseApiHost": "https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api", - "s3KeyPrefix": "sims-pr", - "logLevel": "debug", - "apiResponseValidationEnabled": true, - "databaseResponseValidationEnabled": true, - "nodeOptions": "--max_old_space_size=2250", - "cpuRequest": "50m", - "cpuLimit": "400m", - "memoryRequest": "100Mi", - "memoryLimit": "3Gi", - "replicas": "1", - "replicasMax": "1" + "NAMESPACE": "af2668-dev", + "NODE_ENV": "development", + "TZ": "America/Vancouver", + "BACKBONE_INTERNAL_API_HOST": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", + "BACKBONE_INTAKE_PATH": "/api/dwc/submission/queue", + "BACKBONE_ARTIFACT_INTAKE_PATH": "/api/artifact/intake", + "BIOHUB_TAXON_TSN_PATH": "/api/taxonomy/taxon/tsn", + "BIOHUB_TAXON_PATH": "/api/taxonomy/taxon", + "BACKBONE_INTAKE_ENABLED": true, + "BCTW_API_HOST": "https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca", + "CB_API_HOST": "https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api", + "S3_KEY_PREFIX": "sims-pr", + "LOG_LEVEL": "debug", + "API_RESPONSE_VALIDATION_ENABLED": true, + "DATABASE_RESPONSE_VALIDATION_ENABLED": true, + "NODE_OPTIONS": "--max_old_space_size=2250", + "CPU_REQUEST": "50m", + "CPU_LIMIT": "400m", + "MEMORY_REQUEST": "100Mi", + "MEMORY_LIMIT": "3Gi", + "REPLICAS": "1", + "REPLICAS_MAX": "1" } }, "dev": { "build": { - "namespace": "af2668-tools", - "tz": "America/Vancouver", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "3Gi" + "NAMESPACE": "af2668-tools", + "TZ": "America/Vancouver", + "CPU_REQUEST": "50m", + "CPU_LIMIT": "1000m", + "MEMORY_REQUEST": "100Mi", + "MEMORY_LIMIT": "3Gi" }, "deploy": { - "namespace": "af2668-dev", - "nodeEnv": "development", - "staticApiUrl": "api-dev-biohubbc.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "dev-biohubbc.apps.silver.devops.gov.bc.ca", - "tz": "America/Vancouver", - "backboneInternalApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", - "backboneIntakePath": "/api/dwc/submission/queue", - "backboneArtifactIntakePath": "/api/artifact/intake", - "biohubTaxonTsnPath": "/api/taxonomy/taxon/tsn", - "biohubTaxonPath": "/api/taxonomy/taxon", - "backboneIntakeEnabled": true, - "bctwApiHost": "https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca", - "critterbaseApiHost": "https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api", - "s3KeyPrefix": "sims", - "logLevel": "debug", - "apiResponseValidationEnabled": true, - "databaseResponseValidationEnabled": true, - "nodeOptions": "--max_old_space_size=2250", - "cpuRequest": "50m", - "cpuLimit": "600m", - "memoryRequest": "100Mi", - "memoryLimit": "3Gi", - "replicas": "1", - "replicasMax": "2" + "NAMESPACE": "af2668-dev", + "NODE_ENV": "development", + "API_HOST": "api-dev-biohubbc.apps.silver.devops.gov.bc.ca", + "APP_HOST": "dev-biohubbc.apps.silver.devops.gov.bc.ca", + "TZ": "America/Vancouver", + "BACKBONE_INTERNAL_API_HOST": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", + "BACKBONE_INTAKE_PATH": "/api/dwc/submission/queue", + "BACKBONE_ARTIFACT_INTAKE_PATH": "/api/artifact/intake", + "BIOHUB_TAXON_TSN_PATH": "/api/taxonomy/taxon/tsn", + "BIOHUB_TAXON_PATH": "/api/taxonomy/taxon", + "BACKBONE_INTAKE_ENABLED": true, + "BCTW_API_HOST": "https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca", + "CB_API_HOST": "https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api", + "S3_KEY_PREFIX": "sims", + "LOG_LEVEL": "debug", + "API_RESPONSE_VALIDATION_ENABLED": true, + "DATABASE_RESPONSE_VALIDATION_ENABLED": true, + "NODE_OPTIONS": "--max_old_space_size=2250", + "CPU_REQUEST": "50m", + "CPU_LIMIT": "600m", + "MEMORY_REQUEST": "100Mi", + "MEMORY_LIMIT": "3Gi", + "REPLICAS": "1", + "REPLICAS_MAX": "2" } }, "test": { "build": { - "namespace": "af2668-tools", - "tz": "America/Vancouver", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "3Gi" + "NAMESPACE": "af2668-tools", + "TZ": "America/Vancouver", + "CPU_REQUEST": "50m", + "CPU_LIMIT": "1000m", + "MEMORY_REQUEST": "100Mi", + "MEMORY_LIMIT": "3Gi" }, "deploy": { - "namespace": "af2668-test", - "nodeEnv": "production", - "staticApiUrl": "api-test-biohubbc.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "test-biohubbc.apps.silver.devops.gov.bc.ca", - "tz": "America/Vancouver", - "backboneInternalApiHost": "https://api-test-biohub-platform.apps.silver.devops.gov.bc.ca", - "backboneIntakePath": "/api/dwc/submission/queue", - "backboneArtifactIntakePath": "/api/artifact/intake", - "biohubTaxonTsnPath": "/api/taxonomy/taxon/tsn", - "biohubTaxonPath": "/api/taxonomy/taxon", - "backboneIntakeEnabled": false, - "bctwApiHost": "https://moe-bctw-api-test.apps.silver.devops.gov.bc.ca", - "critterbaseApiHost": "https://moe-critterbase-api-test.apps.silver.devops.gov.bc.ca/api", - "s3KeyPrefix": "sims", - "logLevel": "info", - "apiResponseValidationEnabled": true, - "databaseResponseValidationEnabled": true, - "nodeOptions": "--max_old_space_size=2250", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "3Gi", - "replicas": "2", - "replicasMax": "4" + "NAMESPACE": "af2668-test", + "NODE_ENV": "production", + "API_HOST": "api-test-biohubbc.apps.silver.devops.gov.bc.ca", + "APP_HOST": "test-biohubbc.apps.silver.devops.gov.bc.ca", + "TZ": "America/Vancouver", + "BACKBONE_INTERNAL_API_HOST": "https://api-test-biohub-platform.apps.silver.devops.gov.bc.ca", + "BACKBONE_INTAKE_PATH": "/api/dwc/submission/queue", + "BACKBONE_ARTIFACT_INTAKE_PATH": "/api/artifact/intake", + "BIOHUB_TAXON_TSN_PATH": "/api/taxonomy/taxon/tsn", + "BIOHUB_TAXON_PATH": "/api/taxonomy/taxon", + "BACKBONE_INTAKE_ENABLED": false, + "BCTW_API_HOST": "https://moe-bctw-api-test.apps.silver.devops.gov.bc.ca", + "CB_API_HOST": "https://moe-critterbase-api-test.apps.silver.devops.gov.bc.ca/api", + "S3_KEY_PREFIX": "sims", + "LOG_LEVEL": "info", + "API_RESPONSE_VALIDATION_ENABLED": true, + "DATABASE_RESPONSE_VALIDATION_ENABLED": true, + "NODE_OPTIONS": "--max_old_space_size=2250", + "CPU_REQUEST": "50m", + "CPU_LIMIT": "1000m", + "MEMORY_REQUEST": "100Mi", + "MEMORY_LIMIT": "3Gi", + "REPLICAS": "2", + "REPLICAS_MAX": "4" } }, "prod": { "build": { - "namespace": "af2668-tools", - "tz": "America/Vancouver", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "3Gi" + "NAMESPACE": "af2668-tools", + "TZ": "America/Vancouver", + "CPU_REQUEST": "50m", + "CPU_LIMIT": "1000m", + "MEMORY_REQUEST": "100Mi", + "MEMORY_LIMIT": "3Gi" }, "deploy": { - "namespace": "af2668-prod", - "nodeEnv": "production", - "staticApiUrl": "api-biohubbc.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "biohubbc.apps.silver.devops.gov.bc.ca", - "staticAppVanityUrl": "biohubbc.nrs.gov.bc.ca", - "tz": "America/Vancouver", - "backboneInternalApiHost": "https://api-biohub-platform.apps.silver.devops.gov.bc.ca", - "backboneIntakePath": "/api/dwc/submission/queue", - "backboneArtifactIntakePath": "/api/artifact/intake", - "biohubTaxonTsnPath": "/api/taxonomy/taxon/tsn", - "biohubTaxonPath": "/api/taxonomy/taxon", - "backboneIntakeEnabled": false, - "bctwApiHost": "https://moe-bctw-api-prod.apps.silver.devops.gov.bc.ca", - "critterbaseApiHost": "https://moe-critterbase-api-prod.apps.silver.devops.gov.bc.ca/api", - "s3KeyPrefix": "sims", - "logLevel": "warn", - "apiResponseValidationEnabled": true, - "databaseResponseValidationEnabled": true, - "nodeOptions": "--max_old_space_size=2250", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "3Gi", - "replicas": "2", - "replicasMax": "4" + "NAMESPACE": "af2668-prod", + "NODE_ENV": "production", + "API_HOST": "api-biohubbc.apps.silver.devops.gov.bc.ca", + "APP_HOST": "biohubbc.apps.silver.devops.gov.bc.ca", + "APP_VANITY_URL": "biohubbc.nrs.gov.bc.ca", + "TZ": "America/Vancouver", + "BACKBONE_INTERNAL_API_HOST": "https://api-biohub-platform.apps.silver.devops.gov.bc.ca", + "BACKBONE_INTAKE_PATH": "/api/dwc/submission/queue", + "BACKBONE_ARTIFACT_INTAKE_PATH": "/api/artifact/intake", + "BIOHUB_TAXON_TSN_PATH": "/api/taxonomy/taxon/tsn", + "BIOHUB_TAXON_PATH": "/api/taxonomy/taxon", + "BACKBONE_INTAKE_ENABLED": false, + "BCTW_API_HOST": "https://moe-bctw-api-prod.apps.silver.devops.gov.bc.ca", + "CB_API_HOST": "https://moe-critterbase-api-prod.apps.silver.devops.gov.bc.ca/api", + "S3_KEY_PREFIX": "sims", + "LOG_LEVEL": "warn", + "API_RESPONSE_VALIDATION_ENABLED": true, + "DATABASE_RESPONSE_VALIDATION_ENABLED": true, + "NODE_OPTIONS": "--max_old_space_size=2250", + "CPU_REQUEST": "50m", + "CPU_LIMIT": "1000m", + "MEMORY_REQUEST": "100Mi", + "MEMORY_LIMIT": "3Gi", + "REPLICAS": "2", + "REPLICAS_MAX": "4" } } }, "app": { "pr": { "build": { - "namespace": "af2668-tools", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "5Gi" + "NAMESPACE": "af2668-tools", + "CPU_REQUEST": "50m", + "CPU_LIMIT": "1000m", + "MEMORY_REQUEST": "100Mi", + "MEMORY_LIMIT": "5Gi" }, "deploy": { - "namespace": "af2668-dev", - "nodeEnv": "development", - "siteminderLogoutURL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", - "maxUploadNumFiles": 10, - "maxUploadFileSize": 52428800, - "biohubFeatureFlag": "true", - "backbonePublicApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", - "biohubTaxonPath": "/api/taxonomy/taxon", - "biohubTaxonTsnPath": "/api/taxonomy/taxon/tsn", - "cpuRequest": "50m", - "cpuLimit": "300m", - "memoryRequest": "100Mi", - "memoryLimit": "500Mi", - "replicas": "1", - "replicasMax": "1" + "NAMESPACE": "af2668-dev", + "NODE_ENV": "development", + "SITEMINDER_LOGOUT_URL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", + "MAX_UPLOAD_NUM_FILES": 10, + "MAX_UPLOAD_FILE_SIZE": 52428800, + "REACT_APP_BIOHUB_FEATURE_FLAG": "true", + "BACKBONE_PUBLIC_API_HOST": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", + "BIOHUB_TAXON_PATH": "/api/taxonomy/taxon", + "BIOHUB_TAXON_TSN_PATH": "/api/taxonomy/taxon/tsn", + "CPU_REQUEST": "50m", + "CPU_LIMIT": "300m", + "MEMORY_REQUEST": "100Mi", + "MEMORY_LIMIT": "500Mi", + "REPLICAS": "1", + "REPLICAS_MAX": "1" } }, "dev": { "build": { - "namespace": "af2668-tools", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "5Gi" + "NAMESPACE": "af2668-tools", + "CPU_REQUEST": "50m", + "CPU_LIMIT": "1000m", + "MEMORY_REQUEST": "100Mi", + "MEMORY_LIMIT": "5Gi" }, "deploy": { - "namespace": "af2668-dev", - "nodeEnv": "development", - "staticApiUrl": "api-dev-biohubbc.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "dev-biohubbc.apps.silver.devops.gov.bc.ca", - "siteminderLogoutURL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", - "maxUploadNumFiles": 10, - "maxUploadFileSize": 52428800, - "biohubFeatureFlag": "true", - "backbonePublicApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", - "biohubTaxonPath": "/api/taxonomy/taxon", - "biohubTaxonTsnPath": "/api/taxonomy/taxon/tsn", - "cpuRequest": "50m", - "cpuLimit": "300m", - "memoryRequest": "100Mi", - "memoryLimit": "500Mi", - "replicas": "1", - "replicasMax": "2" + "NAMESPACE": "af2668-dev", + "NODE_ENV": "development", + "API_HOST": "api-dev-biohubbc.apps.silver.devops.gov.bc.ca", + "APP_HOST": "dev-biohubbc.apps.silver.devops.gov.bc.ca", + "SITEMINDER_LOGOUT_URL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", + "MAX_UPLOAD_NUM_FILES": 10, + "MAX_UPLOAD_FILE_SIZE": 52428800, + "REACT_APP_BIOHUB_FEATURE_FLAG": "true", + "BACKBONE_PUBLIC_API_HOST": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", + "BIOHUB_TAXON_PATH": "/api/taxonomy/taxon", + "BIOHUB_TAXON_TSN_PATH": "/api/taxonomy/taxon/tsn", + "CPU_REQUEST": "50m", + "CPU_LIMIT": "300m", + "MEMORY_REQUEST": "100Mi", + "MEMORY_LIMIT": "500Mi", + "REPLICAS": "1", + "REPLICAS_MAX": "2" } }, "test": { "build": { - "namespace": "af2668-tools", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "5Gi" + "NAMESPACE": "af2668-tools", + "CPU_REQUEST": "50m", + "CPU_LIMIT": "1000m", + "MEMORY_REQUEST": "100Mi", + "MEMORY_LIMIT": "5Gi" }, "deploy": { - "namespace": "af2668-test", - "nodeEnv": "production", - "staticApiUrl": "api-test-biohubbc.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "test-biohubbc.apps.silver.devops.gov.bc.ca", - "siteminderLogoutURL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", - "maxUploadNumFiles": 10, - "maxUploadFileSize": 52428800, - "biohubFeatureFlag": "false", - "backbonePublicApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", - "biohubTaxonPath": "/api/taxonomy/taxon", - "biohubTaxonTsnPath": "/api/taxonomy/taxon/tsn", - "cpuRequest": "50m", - "cpuLimit": "500m", - "memoryRequest": "100Mi", - "memoryLimit": "500Mi", - "replicas": "2", - "replicasMax": "3" + "NAMESPACE": "af2668-test", + "NODE_ENV": "production", + "API_HOST": "api-test-biohubbc.apps.silver.devops.gov.bc.ca", + "APP_HOST": "test-biohubbc.apps.silver.devops.gov.bc.ca", + "SITEMINDER_LOGOUT_URL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", + "MAX_UPLOAD_NUM_FILES": 10, + "MAX_UPLOAD_FILE_SIZE": 52428800, + "REACT_APP_BIOHUB_FEATURE_FLAG": "false", + "BACKBONE_PUBLIC_API_HOST": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", + "BIOHUB_TAXON_PATH": "/api/taxonomy/taxon", + "BIOHUB_TAXON_TSN_PATH": "/api/taxonomy/taxon/tsn", + "CPU_REQUEST": "50m", + "CPU_LIMIT": "500m", + "MEMORY_REQUEST": "100Mi", + "MEMORY_LIMIT": "500Mi", + "REPLICAS": "2", + "REPLICAS_MAX": "3" } }, "prod": { "build": { - "namespace": "af2668-tools", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "5Gi" + "NAMESPACE": "af2668-tools", + "CPU_REQUEST": "50m", + "CPU_LIMIT": "1000m", + "MEMORY_REQUEST": "100Mi", + "MEMORY_LIMIT": "5Gi" }, "deploy": { - "namespace": "af2668-prod", - "nodeEnv": "production", - "staticApiUrl": "api-biohubbc.apps.silver.devops.gov.bc.ca", - "staticAppUrl": "biohubbc.apps.silver.devops.gov.bc.ca", - "staticAppVanityUrl": "biohubbc.nrs.gov.bc.ca", - "siteminderLogoutURL": "https://logon7.gov.bc.ca/clp-cgi/logoff.cgi", - "maxUploadNumFiles": 10, - "maxUploadFileSize": 52428800, - "biohubFeatureFlag": "false", - "backbonePublicApiHost": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", - "biohubTaxonPath": "/api/taxonomy/taxon", - "biohubTaxonTsnPath": "/api/taxonomy/taxon/tsn", - "cpuRequest": "50m", - "cpuLimit": "500m", - "memoryRequest": "100Mi", - "memoryLimit": "500Mi", - "replicas": "2", - "replicasMax": "3" + "NAMESPACE": "af2668-prod", + "NODE_ENV": "production", + "API_HOST": "api-biohubbc.apps.silver.devops.gov.bc.ca", + "APP_HOST": "biohubbc.apps.silver.devops.gov.bc.ca", + "APP_VANITY_URL": "biohubbc.nrs.gov.bc.ca", + "SITEMINDER_LOGOUT_URL": "https://logon7.gov.bc.ca/clp-cgi/logoff.cgi", + "MAX_UPLOAD_NUM_FILES": 10, + "MAX_UPLOAD_FILE_SIZE": 52428800, + "REACT_APP_BIOHUB_FEATURE_FLAG": "false", + "BACKBONE_PUBLIC_API_HOST": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", + "BIOHUB_TAXON_PATH": "/api/taxonomy/taxon", + "BIOHUB_TAXON_TSN_PATH": "/api/taxonomy/taxon/tsn", + "CPU_REQUEST": "50m", + "CPU_LIMIT": "500m", + "MEMORY_REQUEST": "100Mi", + "MEMORY_LIMIT": "500Mi", + "REPLICAS": "2", + "REPLICAS_MAX": "3" } } }, "database": { "pr": { "build": { - "namespace": "af2668-tools", - "tz": "America/Vancouver", - "sourceContextDir": "database", - "dbSetupDockerfilePath": "./.docker/db/Dockerfile.setup", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "1.5Gi" + "NAMESPACE": "af2668-tools", + "TZ": "America/Vancouver", + "SOURCE_CONTEXT_DIR": "database", + "DB_SETUP_DOCKERFILE_PATH": "./.docker/db/Dockerfile.setup", + "CPU_REQUEST": "50m", + "CPU_LIMIT": "1000m", + "MEMORY_REQUEST": "100Mi", + "MEMORY_LIMIT": "1.5Gi" }, "deploy": { - "namespace": "af2668-dev", - "nodeEnv": "development", - "tz": "America/Vancouver", - "projectSeederUserIdentifier": "1", - "numSeedProjects": "2", - "numSeedSurveysPerProject": "2", - "volumeCapacity": "500Mi", - "cpuRequest": "50m", - "cpuLimit": "400m", - "memoryRequest": "100Mi", - "memoryLimit": "2Gi", - "replicas": "1" + "NAMESPACE": "af2668-dev", + "NODE_ENV": "development", + "TZ": "America/Vancouver", + "PROJECT_SEEDER_USER_IDENTIFIER": "1", + "NUM_SEED_PROJECTS": "2", + "NUM_SEED_SURVEYS_PER_PROJECT": "2", + "VOLUME_CAPACITY": "500Mi", + "CPU_REQUEST": "50m", + "CPU_LIMIT": "400m", + "MEMORY_REQUEST": "100Mi", + "MEMORY_LIMIT": "2Gi", + "REPLICAS": "1" } }, "dev": { "build": { - "namespace": "af2668-tools", - "tz": "America/Vancouver", - "sourceContextDir": "database", - "dbSetupDockerfilePath": "./.docker/db/Dockerfile.setup", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "1.5Gi" + "NAMESPACE": "af2668-tools", + "TZ": "America/Vancouver", + "SOURCE_CONTEXT_DIR": "database", + "DB_SETUP_DOCKERFILE_PATH": "./.docker/db/Dockerfile.setup", + "CPU_REQUEST": "50m", + "CPU_LIMIT": "1000m", + "MEMORY_REQUEST": "100Mi", + "MEMORY_LIMIT": "1.5Gi" }, "deploy": { - "namespace": "af2668-dev", - "nodeEnv": "development", - "tz": "America/Vancouver", - "projectSeederUserIdentifier": "1", - "numSeedProjects": "2", - "numSeedSurveysPerProject": "2", - "volumeCapacity": "3Gi", - "cpuRequest": "50m", - "cpuLimit": "600m", - "memoryRequest": "100Mi", - "memoryLimit": "3Gi", - "replicas": "1" + "NAMESPACE": "af2668-dev", + "NODE_ENV": "development", + "TZ": "America/Vancouver", + "PROJECT_SEEDER_USER_IDENTIFIER": "1", + "NUM_SEED_PROJECTS": "2", + "NUM_SEED_SURVEYS_PER_PROJECT": "2", + "VOLUME_CAPACITY": "3Gi", + "CPU_REQUEST": "50m", + "CPU_LIMIT": "600m", + "MEMORY_REQUEST": "100Mi", + "MEMORY_LIMIT": "3Gi", + "REPLICAS": "1" } }, "test": { "build": { - "namespace": "af2668-tools", - "tz": "America/Vancouver", - "sourceContextDir": "database", - "dbSetupDockerfilePath": "./.docker/db/Dockerfile.setup", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "1.5Gi" + "NAMESPACE": "af2668-tools", + "TZ": "America/Vancouver", + "SOURCE_CONTEXT_DIR": "database", + "DB_SETUP_DOCKERFILE_PATH": "./.docker/db/Dockerfile.setup", + "CPU_REQUEST": "50m", + "CPU_LIMIT": "1000m", + "MEMORY_REQUEST": "100Mi", + "MEMORY_LIMIT": "1.5Gi" }, "deploy": { - "namespace": "af2668-test", - "nodeEnv": "production", - "tz": "America/Vancouver", - "projectSeederUserIdentifier": "1", - "numSeedProjects": "0", - "numSeedSurveysPerProject": "0", - "volumeCapacity": "20Gi", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "3Gi", - "replicas": "1" + "NAMESPACE": "af2668-test", + "NODE_ENV": "production", + "TZ": "America/Vancouver", + "PROJECT_SEEDER_USER_IDENTIFIER": "1", + "NUM_SEED_PROJECTS": "0", + "NUM_SEED_SURVEYS_PER_PROJECT": "0", + "VOLUME_CAPACITY": "20Gi", + "CPU_REQUEST": "50m", + "CPU_LIMIT": "1000m", + "MEMORY_REQUEST": "100Mi", + "MEMORY_LIMIT": "3Gi", + "REPLICAS": "1" } }, "prod": { "build": { - "namespace": "af2668-tools", - "tz": "America/Vancouver", - "sourceContextDir": "database", - "dbSetupDockerfilePath": "./.docker/db/Dockerfile.setup", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "1.5Gi" + "NAMESPACE": "af2668-tools", + "TZ": "America/Vancouver", + "SOURCE_CONTEXT_DIR": "database", + "DB_SETUP_DOCKERFILE_PATH": "./.docker/db/Dockerfile.setup", + "CPU_REQUEST": "50m", + "CPU_LIMIT": "1000m", + "MEMORY_REQUEST": "100Mi", + "MEMORY_LIMIT": "1.5Gi" }, "deploy": { - "namespace": "af2668-prod", - "nodeEnv": "production", - "tz": "America/Vancouver", - "projectSeederUserIdentifier": "1", - "numSeedProjects": "0", - "numSeedSurveysPerProject": "0", - "volumeCapacity": "20Gi", - "cpuRequest": "50m", - "cpuLimit": "1000m", - "memoryRequest": "100Mi", - "memoryLimit": "3Gi", - "replicas": "1" + "NAMESPACE": "af2668-prod", + "NODE_ENV": "production", + "TZ": "America/Vancouver", + "PROJECT_SEEDER_USER_IDENTIFIER": "1", + "NUM_SEED_PROJECTS": "0", + "NUM_SEED_SURVEYS_PER_PROJECT": "0", + "VOLUME_CAPACITY": "20Gi", + "CPU_REQUEST": "50m", + "CPU_LIMIT": "1000m", + "MEMORY_REQUEST": "100Mi", + "MEMORY_LIMIT": "3Gi", + "REPLICAS": "1" } } }, "sso": { "pr": { - "host": "https://dev.loginproxy.gov.bc.ca/auth", - "realm": "standard", - "clientId": "sims-4461", - "keycloakSecret": "sims-keycloak", + "KEYCLOAK_HOST": "https://dev.loginproxy.gov.bc.ca/auth", + "KEYCLOAK_REALM": "standard", + "KEYCLOAK_CLIENT_ID": "sims-4461", + "KEYCLOAK_SECRET": "sims-keycloak", "serviceClient": { - "serviceClientName": "sims-svc-4464", - "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" + "KEYCLOAK_ADMIN_USERNAME": "sims-svc-4464", + "KEYCLOAK_SECRET_ADMIN_PASSWORD_KEY": "sims_svc_client_password" }, "cssApi": { - "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", - "cssApiClientId": "service-account-team-1190-4229", - "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", - "keycloakSecretCssApiSecretKey": "css_api_client_secret", - "cssApiEnvironment": "dev" + "KEYCLOAK_API_TOKEN_URL": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", + "KEYCLOAK_API_CLIENT_ID": "service-account-team-1190-4229", + "KEYCLOAK_API_HOST": "https://api.loginproxy.gov.bc.ca/api/v1", + "KEYCLOAK_API_CLIENT_SECRET_KEY": "css_api_client_secret", + "KEYCLOAK_API_ENVIRONMENT": "dev" } }, "dev": { - "host": "https://dev.loginproxy.gov.bc.ca/auth", - "realm": "standard", - "clientId": "sims-4461", - "keycloakSecret": "sims-keycloak", + "KEYCLOAK_HOST": "https://dev.loginproxy.gov.bc.ca/auth", + "KEYCLOAK_REALM": "standard", + "KEYCLOAK_CLIENT_ID": "sims-4461", + "KEYCLOAK_SECRET": "sims-keycloak", "serviceClient": { - "serviceClientName": "sims-svc-4464", - "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" + "KEYCLOAK_ADMIN_USERNAME": "sims-svc-4464", + "KEYCLOAK_SECRET_ADMIN_PASSWORD_KEY": "sims_svc_client_password" }, "cssApi": { - "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", - "cssApiClientId": "service-account-team-1190-4229", - "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", - "keycloakSecretCssApiSecretKey": "css_api_client_secret", - "cssApiEnvironment": "dev" + "KEYCLOAK_API_TOKEN_URL": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", + "KEYCLOAK_API_CLIENT_ID": "service-account-team-1190-4229", + "KEYCLOAK_API_HOST": "https://api.loginproxy.gov.bc.ca/api/v1", + "KEYCLOAK_API_CLIENT_SECRET_KEY": "css_api_client_secret", + "KEYCLOAK_API_ENVIRONMENT": "dev" } }, "test": { - "host": "https://test.loginproxy.gov.bc.ca/auth", - "realm": "standard", - "clientId": "sims-4461", - "keycloakSecret": "sims-keycloak", + "KEYCLOAK_HOST": "https://test.loginproxy.gov.bc.ca/auth", + "KEYCLOAK_REALM": "standard", + "KEYCLOAK_CLIENT_ID": "sims-4461", + "KEYCLOAK_SECRET": "sims-keycloak", "serviceClient": { - "serviceClientName": "sims-svc-4464", - "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" + "KEYCLOAK_ADMIN_USERNAME": "sims-svc-4464", + "KEYCLOAK_SECRET_ADMIN_PASSWORD_KEY": "sims_svc_client_password" }, "cssApi": { - "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", - "cssApiClientId": "service-account-team-1190-4229", - "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", - "keycloakSecretCssApiSecretKey": "css_api_client_secret", - "cssApiEnvironment": "test" + "KEYCLOAK_API_TOKEN_URL": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", + "KEYCLOAK_API_CLIENT_ID": "service-account-team-1190-4229", + "KEYCLOAK_API_HOST": "https://api.loginproxy.gov.bc.ca/api/v1", + "KEYCLOAK_API_CLIENT_SECRET_KEY": "css_api_client_secret", + "KEYCLOAK_API_ENVIRONMENT": "test" } }, "prod": { - "host": "https://loginproxy.gov.bc.ca/auth", - "realm": "standard", - "clientId": "sims-4461", - "keycloakSecret": "sims-keycloak", + "KEYCLOAK_HOST": "https://loginproxy.gov.bc.ca/auth", + "KEYCLOAK_REALM": "standard", + "KEYCLOAK_CLIENT_ID": "sims-4461", + "KEYCLOAK_SECRET": "sims-keycloak", "serviceClient": { - "serviceClientName": "sims-svc-4464", - "keycloakSecretServiceClientPasswordKey": "sims_svc_client_password" + "KEYCLOAK_ADMIN_USERNAME": "sims-svc-4464", + "KEYCLOAK_SECRET_ADMIN_PASSWORD_KEY": "sims_svc_client_password" }, "cssApi": { - "cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", - "cssApiClientId": "service-account-team-1190-4229", - "cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1", - "keycloakSecretCssApiSecretKey": "css_api_client_secret", - "cssApiEnvironment": "prod" + "KEYCLOAK_API_TOKEN_URL": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token", + "KEYCLOAK_API_CLIENT_ID": "service-account-team-1190-4229", + "KEYCLOAK_API_HOST": "https://api.loginproxy.gov.bc.ca/api/v1", + "KEYCLOAK_API_CLIENT_SECRET_KEY": "css_api_client_secret", + "KEYCLOAK_API_ENVIRONMENT": "prod" } } } diff --git a/Makefile b/Makefile index 28fe0a8c4e..8a542e78b7 100644 --- a/Makefile +++ b/Makefile @@ -299,6 +299,34 @@ pipeline-install: ## Runs `npm install` for all projects @echo "===============================================" @cd database/.pipeline && npm install && cd ../.. +pipeline-lint-fix: ## Runs `npm run lint-fix ` for all projects + @echo "===============================================" + @echo "Running /api/.pipeline lint-fix" + @echo "===============================================" + @cd api/.pipeline && npm run lint-fix && cd ../.. + @echo "===============================================" + @echo "Running /app/.pipeline lint-fix" + @echo "===============================================" + @cd app/.pipeline && npm run lint-fix && cd ../.. + @echo "===============================================" + @echo "Running /database/.pipeline lint-fix" + @echo "===============================================" + @cd database/.pipeline && npm run lint-fix && cd ../.. + +pipeline-format-fix: ## Runs `npm run format-fix` for all projects + @echo "===============================================" + @echo "Running /api/.pipeline format-fix" + @echo "===============================================" + @cd api/.pipeline && npm run format-fix && cd ../.. + @echo "===============================================" + @echo "Running /app/.pipeline format-fix" + @echo "===============================================" + @cd app/.pipeline && npm run format-fix && cd ../.. + @echo "===============================================" + @echo "Running /database/.pipeline format-fix" + @echo "===============================================" + @cd database/.pipeline && npm run format-fix && cd ../.. + ## ------------------------------------------------------------------------------ ## Run `docker logs -f` commands for all projects ## - You can include additional parameters by appaending an `args` param diff --git a/api/.pipeline/config.js b/api/.pipeline/config.js index 69f57b6697..506acb37ee 100644 --- a/api/.pipeline/config.js +++ b/api/.pipeline/config.js @@ -22,107 +22,107 @@ const phases = { pr: { build: { ...pipelineConfigMap.api.pr.build, - name: pipelineConfigMap.module.api, - dbName: pipelineConfigMap.module.db, - changeId: changeId, - suffix: `-build-${changeId}`, - instance: `${pipelineConfigMap.module.api}-build-${changeId}`, - version: `${pipelineConfigMap.version}-${changeId}`, - tag: `build-${pipelineConfigMap.version}-${changeId}`, - branch: options.git.ref + NAME: pipelineConfigMap.module.api, + DB_NAME: pipelineConfigMap.module.db, + CHANGE_ID: changeId, + SUFFIX: `-build-${changeId}`, + INSTANCE: `${pipelineConfigMap.module.api}-build-${changeId}`, + VERSION: `${pipelineConfigMap.version}-${changeId}`, + TAG: `build-${pipelineConfigMap.version}-${changeId}`, + BRANCH: options.git.ref }, deploy: { ...pipelineConfigMap.api.pr.deploy, - name: pipelineConfigMap.module.api, - dbName: pipelineConfigMap.module.db, - changeId: changeId, - suffix: `-dev-${changeId}`, - instance: `${pipelineConfigMap.module.api}-pr-${changeId}`, - version: `pr-${changeId}`, - tag: `dev-${pipelineConfigMap.version}-${changeId}`, - host: `${pipelineConfigMap.module.api}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, - appHost: `${pipelineConfigMap.module.app}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, - sso: pipelineConfigMap.sso.pr, - s3KeyPrefix: `${pipelineConfigMap.s3KeyPrefix}/${changeId}` + NAME: pipelineConfigMap.module.api, + DB_NAME: pipelineConfigMap.module.db, + CHANGE_ID: changeId, + SUFFIX: `-dev-${changeId}`, + INSTANCE: `${pipelineConfigMap.module.api}-pr-${changeId}`, + VERSION: `pr-${changeId}`, + TAG: `dev-${pipelineConfigMap.version}-${changeId}`, + API_HOST: `${pipelineConfigMap.module.api}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, + APP_HOST: `${pipelineConfigMap.module.app}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, + SSO: pipelineConfigMap.SSO.pr, + S3_KEY_PREFIX: `${pipelineConfigMap.S3_KEY_PREFIX}/${changeId}` } }, dev: { build: { ...pipelineConfigMap.api.dev.build, - name: pipelineConfigMap.module.api, - dbName: pipelineConfigMap.module.db, - changeId: changeId, - suffix: `-build-${changeId}`, - instance: `${pipelineConfigMap.module.api}-build-${changeId}`, - version: `${pipelineConfigMap.version}-${changeId}`, - tag: `build-${pipelineConfigMap.version}-${changeId}-${branch}`, - branch: branch + NAME: pipelineConfigMap.module.api, + DB_NAME: pipelineConfigMap.module.db, + CHANGE_ID: changeId, + SUFFIX: `-build-${changeId}`, + INSTANCE: `${pipelineConfigMap.module.api}-build-${changeId}`, + VERSION: `${pipelineConfigMap.version}-${changeId}`, + TAG: `build-${pipelineConfigMap.version}-${changeId}-${branch}`, + BRANCH: branch }, deploy: { ...pipelineConfigMap.api.dev.deploy, - name: pipelineConfigMap.module.api, - dbName: pipelineConfigMap.module.db, - changeId: 'deploy', - suffix: '-dev-deploy', - instance: `${pipelineConfigMap.module.api}-dev-deploy`, - version: `deploy-${changeId}`, - tag: `dev-${pipelineConfigMap.version}-deploy`, - host: pipelineConfigMap.api.dev.deploy.staticApiUrl, - appHost: pipelineConfigMap.api.dev.deploy.staticAppUrl, - sso: pipelineConfigMap.sso.dev + NAME: pipelineConfigMap.module.api, + DB_NAME: pipelineConfigMap.module.db, + CHANGE_ID: 'deploy', + SUFFIX: '-dev-deploy', + INSTANCE: `${pipelineConfigMap.module.api}-dev-deploy`, + VERSION: `deploy-${changeId}`, + TAG: `dev-${pipelineConfigMap.version}-deploy`, + API_HOST: pipelineConfigMap.api.dev.deploy.API_HOST, + APP_HOST: pipelineConfigMap.api.dev.deploy.APP_HOST, + SSO: pipelineConfigMap.SSO.dev } }, test: { build: { ...pipelineConfigMap.api.test.build, - name: pipelineConfigMap.module.api, - dbName: pipelineConfigMap.module.db, - changeId: changeId, - suffix: `-build-${changeId}`, - instance: `${pipelineConfigMap.module.api}-build-${changeId}`, - version: `${pipelineConfigMap.version}-${changeId}`, - tag: `build-${pipelineConfigMap.version}-${changeId}-${branch}`, - branch: branch + NAME: pipelineConfigMap.module.api, + DB_NAME: pipelineConfigMap.module.db, + CHANGE_ID: changeId, + SUFFIX: `-build-${changeId}`, + INSTANCE: `${pipelineConfigMap.module.api}-build-${changeId}`, + VERSION: `${pipelineConfigMap.version}-${changeId}`, + TAG: `build-${pipelineConfigMap.version}-${changeId}-${branch}`, + BRANCH: branch }, deploy: { ...pipelineConfigMap.api.test.deploy, - name: pipelineConfigMap.module.api, - dbName: pipelineConfigMap.module.db, - changeId: 'deploy', - suffix: `-test`, - instance: `${pipelineConfigMap.module.api}-test`, - version: `deploy-${changeId}`, - tag: `test-${pipelineConfigMap.version}`, - host: pipelineConfigMap.api.test.deploy.staticApiUrl, - appHost: pipelineConfigMap.api.test.deploy.staticAppUrl, - sso: pipelineConfigMap.sso.test + NAME: pipelineConfigMap.module.api, + DB_NAME: pipelineConfigMap.module.db, + CHANGE_ID: 'deploy', + SUFFIX: `-test`, + INSTANCE: `${pipelineConfigMap.module.api}-test`, + VERSION: `deploy-${changeId}`, + TAG: `test-${pipelineConfigMap.version}`, + API_HOST: pipelineConfigMap.api.test.deploy.API_HOST, + APP_HOST: pipelineConfigMap.api.test.deploy.APP_HOST, + SSO: pipelineConfigMap.SSO.test } }, prod: { build: { ...pipelineConfigMap.api.prod.build, - name: pipelineConfigMap.module.api, - dbName: pipelineConfigMap.module.db, + NAME: pipelineConfigMap.module.api, + DB_NAME: pipelineConfigMap.module.db, - changeId: changeId, - suffix: `-build-${changeId}`, - instance: `${pipelineConfigMap.module.api}-build-${changeId}`, - version: `${pipelineConfigMap.version}-${changeId}`, - tag: `build-${pipelineConfigMap.version}-${changeId}-${branch}`, - branch: branch + CHANGE_ID: changeId, + SUFFIX: `-build-${changeId}`, + INSTANCE: `${pipelineConfigMap.module.api}-build-${changeId}`, + VERSION: `${pipelineConfigMap.version}-${changeId}`, + TAG: `build-${pipelineConfigMap.version}-${changeId}-${branch}`, + BRANCH: branch }, deploy: { ...pipelineConfigMap.api.prod.deploy, - name: pipelineConfigMap.module.api, - dbName: pipelineConfigMap.module.db, - changeId: 'deploy', - suffix: `-prod`, - instance: `${pipelineConfigMap.module.api}-prod`, - version: `deploy-${changeId}`, - tag: `prod-${pipelineConfigMap.version}`, - host: pipelineConfigMap.api.prod.deploy.staticApiUrl, - appHost: pipelineConfigMap.api.prod.deploy.staticAppVanityUrl, - sso: pipelineConfigMap.sso.prod + NAME: pipelineConfigMap.module.api, + DB_NAME: pipelineConfigMap.module.db, + CHANGE_ID: 'deploy', + SUFFIX: `-prod`, + INSTANCE: `${pipelineConfigMap.module.api}-prod`, + VERSION: `deploy-${changeId}`, + TAG: `prod-${pipelineConfigMap.version}`, + API_HOST: pipelineConfigMap.api.prod.deploy.API_HOST, + APP_HOST: pipelineConfigMap.api.prod.deploy.APP_VANITY_URL, + SSO: pipelineConfigMap.SSO.prod } } }; diff --git a/api/.pipeline/lib/api.build.js b/api/.pipeline/lib/api.build.js index d6fb6b61a2..a66ec4b8e3 100644 --- a/api/.pipeline/lib/api.build.js +++ b/api/.pipeline/lib/api.build.js @@ -14,7 +14,7 @@ const apiBuild = (settings) => { const env = settings.options.env; const phase = settings.options.phase; - const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env][phase].namespace }, options)); + const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env][phase].NAMESPACE }, options)); const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, '../templates')); @@ -23,25 +23,25 @@ const apiBuild = (settings) => { objects.push( ...oc.processDeploymentTemplate(`${templatesLocalBaseUrl}/api.bc.yaml`, { param: { - NAME: phases[env][phase].name, - SUFFIX: phases[env][phase].suffix, - VERSION: phases[env][phase].tag, + NAME: phases[env][phase].NAME, + SUFFIX: phases[env][phase].SUFFIX, + VERSION: phases[env][phase].TAG, SOURCE_REPOSITORY_URL: oc.git.http_url, - SOURCE_REPOSITORY_REF: phases[env][phase].branch, - CPU_REQUEST: phases[env][phase].cpuRequest, - CPU_LIMIT: phases[env][phase].cpuLimit, - MEMORY_REQUEST: phases[env][phase].memoryRequest, - MEMORY_LIMIT: phases[env][phase].memoryLimit + SOURCE_REPOSITORY_REF: phases[env][phase].BRANCH, + CPU_REQUEST: phases[env][phase].CPU_REQUEST, + CPU_LIMIT: phases[env][phase].CPU_LIMIT, + MEMORY_REQUEST: phases[env][phase].MEMORY_REQUEST, + MEMORY_LIMIT: phases[env][phase].MEMORY_LIMIT } }) ); oc.applyRecommendedLabels( objects, - phases[env][phase].name, + phases[env][phase].NAME, env, - phases[env][phase].changeId, - phases[env][phase].instance + phases[env][phase].CHANGE_ID, + phases[env][phase].INSTANCE ); oc.applyAndBuild(objects); }; diff --git a/api/.pipeline/lib/api.deploy.js b/api/.pipeline/lib/api.deploy.js index 0327383de0..2abe3890bc 100644 --- a/api/.pipeline/lib/api.deploy.js +++ b/api/.pipeline/lib/api.deploy.js @@ -15,7 +15,7 @@ const apiDeploy = async (settings) => { const env = settings.options.env; const phase = settings.options.phase; - const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env][phase].namespace }, options)); + const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env][phase].NAMESPACE }, options)); const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, '../templates')); @@ -24,70 +24,70 @@ const apiDeploy = async (settings) => { objects.push( ...oc.processDeploymentTemplate(`${templatesLocalBaseUrl}/api.dc.yaml`, { param: { - NAME: phases[env][phase].name, - SUFFIX: phases[env][phase].suffix, - VERSION: phases[env][phase].tag, - HOST: phases[env][phase].host, - APP_HOST: phases[env][phase].appHost, - CHANGE_ID: phases[env].build.changeId || phases[env][phase].changeId, + NAME: phases[env][phase].NAME, + SUFFIX: phases[env][phase].SUFFIX, + VERSION: phases[env][phase].TAG, + API_HOST: phases[env][phase].API_HOST, + APP_HOST: phases[env][phase].APP_HOST, + CHANGE_ID: phases[env].build.CHANGE_ID || phases[env][phase].CHANGE_ID, // Node - NODE_ENV: phases[env][phase].nodeEnv, - NODE_OPTIONS: phases[env][phase].nodeOptions, + NODE_ENV: phases[env][phase].NODE_ENV, + NODE_OPTIONS: phases[env][phase].NODE_OPTIONS, // BioHub Platform (aka: Backbone) - BACKBONE_INTERNAL_API_HOST: phases[env][phase].backboneInternalApiHost, - BACKBONE_INTAKE_PATH: phases[env][phase].backboneIntakePath, - BACKBONE_ARTIFACT_INTAKE_PATH: phases[env][phase].backboneArtifactIntakePath, - BIOHUB_TAXON_PATH: phases[env][phase].biohubTaxonPath, - BIOHUB_TAXON_TSN_PATH: phases[env][phase].biohubTaxonTsnPath, - BACKBONE_INTAKE_ENABLED: phases[env][phase].backboneIntakeEnabled, + BACKBONE_INTERNAL_API_HOST: phases[env][phase].BACKBONE_INTERNAL_API_HOST, + BACKBONE_INTAKE_PATH: phases[env][phase].BACKBONE_INTAKE_PATH, + BACKBONE_ARTIFACT_INTAKE_PATH: phases[env][phase].BACKBONE_ARTIFACT_INTAKE_PATH, + BIOHUB_TAXON_PATH: phases[env][phase].BIOHUB_TAXON_PATH, + BIOHUB_TAXON_TSN_PATH: phases[env][phase].BIOHUB_TAXON_TSN_PATH, + BACKBONE_INTAKE_ENABLED: phases[env][phase].BACKBONE_INTAKE_ENABLED, // BCTW / Critterbase - BCTW_API_HOST: phases[env][phase].bctwApiHost, - CB_API_HOST: phases[env][phase].critterbaseApiHost, + BCTW_API_HOST: phases[env][phase].BCTW_API_HOST, + CB_API_HOST: phases[env][phase].CB_API_HOST, // S3 - S3_KEY_PREFIX: phases[env][phase].s3KeyPrefix, + S3_KEY_PREFIX: phases[env][phase].S3_KEY_PREFIX, // Database - TZ: phases[env][phase].tz, - DB_SERVICE_NAME: `${phases[env][phase].dbName}-postgresql${phases[env][phase].suffix}`, + TZ: phases[env][phase].TZ, + DB_SERVICE_NAME: `${phases[env][phase].DB_NAME}-postgresql${phases[env][phase].SUFFIX}`, // Keycloak - KEYCLOAK_HOST: phases[env][phase].sso.host, - KEYCLOAK_REALM: phases[env][phase].sso.realm, - KEYCLOAK_CLIENT_ID: phases[env][phase].sso.clientId, + KEYCLOAK_HOST: phases[env][phase].SSO.KEYCLOAK_HOST, + KEYCLOAK_REALM: phases[env][phase].SSO.KEYCLOAK_REALM, + KEYCLOAK_CLIENT_ID: phases[env][phase].SSO.KEYCLOAK_CLIENT_ID, // Keycloak secret - KEYCLOAK_SECRET: phases[env][phase].sso.keycloakSecret, + KEYCLOAK_SECRET: phases[env][phase].SSO.KEYCLOAK_SECRET, // Keycloak Service Client - KEYCLOAK_ADMIN_USERNAME: phases[env][phase].sso.serviceClient.serviceClientName, - KEYCLOAK_SECRET_ADMIN_PASSWORD_KEY: phases[env][phase].sso.serviceClient.keycloakSecretServiceClientPasswordKey, + KEYCLOAK_ADMIN_USERNAME: phases[env][phase].SSO.serviceClient.KEYCLOAK_ADMIN_USERNAME, + KEYCLOAK_SECRET_ADMIN_PASSWORD_KEY: phases[env][phase].SSO.serviceClient.KEYCLOAK_SECRET_ADMIN_PASSWORD_KEY, // Keycloak CSS API - KEYCLOAK_API_TOKEN_URL: phases[env][phase].sso.cssApi.cssApiTokenUrl, - KEYCLOAK_API_CLIENT_ID: phases[env][phase].sso.cssApi.cssApiClientId, - KEYCLOAK_API_CLIENT_SECRET_KEY: phases[env][phase].sso.cssApi.keycloakSecretCssApiSecretKey, - KEYCLOAK_API_HOST: phases[env][phase].sso.cssApi.cssApiHost, - KEYCLOAK_API_ENVIRONMENT: phases[env][phase].sso.cssApi.cssApiEnvironment, + KEYCLOAK_API_TOKEN_URL: phases[env][phase].SSO.cssApi.KEYCLOAK_API_TOKEN_URL, + KEYCLOAK_API_CLIENT_ID: phases[env][phase].SSO.cssApi.KEYCLOAK_API_CLIENT_ID, + KEYCLOAK_API_CLIENT_SECRET_KEY: phases[env][phase].SSO.cssApi.KEYCLOAK_API_CLIENT_SECRET_KEY, + KEYCLOAK_API_HOST: phases[env][phase].SSO.cssApi.KEYCLOAK_API_HOST, + KEYCLOAK_API_ENVIRONMENT: phases[env][phase].SSO.cssApi.KEYCLOAK_API_ENVIRONMENT, // Log Level - LOG_LEVEL: phases[env][phase].logLevel, - API_RESPONSE_VALIDATION_ENABLED: phases[env][phase].apiResponseValidationEnabled, - DATABASE_RESPONSE_VALIDATION_ENABLED: phases[env][phase].databaseResponseValidationEnabled, + LOG_LEVEL: phases[env][phase].LOG_LEVEL, + API_RESPONSE_VALIDATION_ENABLED: phases[env][phase].API_RESPONSE_VALIDATION_ENABLED, + DATABASE_RESPONSE_VALIDATION_ENABLED: phases[env][phase].DATABASE_RESPONSE_VALIDATION_ENABLED, // Openshift Resources - CPU_REQUEST: phases[env][phase].cpuRequest, - CPU_LIMIT: phases[env][phase].cpuLimit, - MEMORY_REQUEST: phases[env][phase].memoryRequest, - MEMORY_LIMIT: phases[env][phase].memoryLimit, - REPLICAS: phases[env][phase].replicas, - REPLICAS_MAX: phases[env][phase].replicasMax + CPU_REQUEST: phases[env][phase].CPU_REQUEST, + CPU_LIMIT: phases[env][phase].CPU_LIMIT, + MEMORY_REQUEST: phases[env][phase].MEMORY_REQUEST, + MEMORY_LIMIT: phases[env][phase].MEMORY_LIMIT, + REPLICAS: phases[env][phase].REPLICAS, + REPLICAS_MAX: phases[env][phase].REPLICAS_MAX } }) ); oc.applyRecommendedLabels( objects, - phases[env][phase].name, + phases[env][phase].NAME, env, - phases[env][phase].changeId, - phases[env][phase].instance + phases[env][phase].CHANGE_ID, + phases[env][phase].INSTANCE ); - oc.importImageStreams(objects, phases[env][phase].tag, phases[env].build.namespace, phases[env].build.tag); + oc.importImageStreams(objects, phases[env][phase].TAG, phases[env].build.NAMESPACE, phases[env].build.TAG); - await oc.applyAndDeploy(objects, phases[env][phase].instance); + await oc.applyAndDeploy(objects, phases[env][phase].INSTANCE); }; module.exports = { apiDeploy }; diff --git a/api/.pipeline/lib/clean.js b/api/.pipeline/lib/clean.js index 1cebee2759..35389eca93 100644 --- a/api/.pipeline/lib/clean.js +++ b/api/.pipeline/lib/clean.js @@ -13,7 +13,7 @@ const clean = async (settings) => { const env = settings.options.env; const phase = settings.options.phase; - const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env].build.namespace }, options)); + const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env].build.NAMESPACE }, options)); if (!Object.prototype.hasOwnProperty.call(phases, env)) { // is not a field of phases @@ -27,8 +27,8 @@ const clean = async (settings) => { // Get build configs let buildConfigs = oc.get('bc', { - selector: `app=${phases[env][phase].instance},env-id=${phases[env][phase].changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, - namespace: phases[env][phase].namespace + selector: `app=${phases[env][phase].INSTANCE},env-id=${phases[env][phase].CHANGE_ID},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, + namespace: phases[env][phase].NAMESPACE }); // Clean build configs @@ -37,15 +37,15 @@ const clean = async (settings) => { oc.delete([`ImageStreamTag/${buildConfig.spec.output.to.name}`], { 'ignore-not-found': 'true', wait: 'true', - namespace: phases[env][phase].namespace + namespace: phases[env][phase].NAMESPACE }); } }); // get deployment configs let deploymentConfigs = oc.get('dc', { - selector: `app=${phases[env][phase].instance},env-id=${phases[env][phase].changeId},env-name=${phaseKey},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, - namespace: phases[env][phase].namespace + selector: `app=${phases[env][phase].INSTANCE},env-id=${phases[env][phase].CHANGE_ID},env-name=${env},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, + namespace: phases[env][phase].NAMESPACE }); // Clean deployment configs @@ -55,22 +55,22 @@ const clean = async (settings) => { oc.delete([`ImageStreamTag/${trigger.imageChangeParams.from.name}`], { 'ignore-not-found': 'true', wait: 'true', - namespace: phases[env][phase].namespace + namespace: phases[env][phase].NAMESPACE }); } }); }); oc.raw('delete', ['all'], { - selector: `app=${phases[env][phase].instance},env-id=${phases[env][phase].changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, + selector: `app=${phases[env][phase].INSTANCE},env-id=${phases[env][phase].CHANGE_ID},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, wait: 'true', - namespace: phases[env][phase].namespace + namespace: phases[env][phase].NAMESPACE }); oc.raw('delete', ['all,pvc,secrets,Secrets,secret,configmap,endpoints,Endpoints'], { - selector: `app=${phases[env][phase].instance},env-id=${phases[env][phase].changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, + selector: `app=${phases[env][phase].INSTANCE},env-id=${phases[env][phase].CHANGE_ID},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, wait: 'true', - namespace: phases[env][phase].namespace + namespace: phases[env][phase].NAMESPACE }); }; diff --git a/api/.pipeline/package-lock.json b/api/.pipeline/package-lock.json index 83751a9d58..299ead87cb 100644 --- a/api/.pipeline/package-lock.json +++ b/api/.pipeline/package-lock.json @@ -4,12 +4,1205 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true + }, + "@babel/code-frame": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", + "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "dev": true + }, + "@babel/highlight": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", + "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true + } + } + }, + "@eslint/eslintrc": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", + "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^13.9.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + } + }, + "@humanwhocodes/config-array": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", + "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "dev": true, + "requires": { + "@humanwhocodes/object-schema": "^1.2.0", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + } + }, + "@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true + }, + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true + }, + "acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "array-buffer-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", + "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", + "dev": true, + "requires": { + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" + } + }, + "arraybuffer.prototype.slice": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", + "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", + "dev": true, + "requires": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.2.1", + "get-intrinsic": "^1.2.3", + "is-array-buffer": "^3.0.4", + "is-shared-array-buffer": "^1.0.2" + } + }, + "astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true + }, + "available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "requires": { + "possible-typed-array-names": "^1.0.0" + } + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dev": true, + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + } + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "dev": true, + "requires": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + } + }, + "data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + } + }, + "data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "dev": true, + "requires": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + } + }, "debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "requires": { - "ms": "2.1.2" + "ms": "2.1.2" + } + }, + "deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + } + }, + "define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "requires": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + } + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "enquirer": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", + "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1", + "strip-ansi": "^6.0.1" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.22.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.5.tgz", + "integrity": "sha512-oW69R+4q2wG+Hc3KZePPZxOiisRIqfKBVo/HLx94QcJeWGU/8sZhCvc829rd1kS366vlJbzBfXf9yWwf0+Ko7w==", + "dev": true, + "requires": { + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-set-tostringtag": "^2.0.3", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", + "has-symbols": "^1.0.3", + "hasown": "^2.0.1", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", + "is-callable": "^1.2.7", + "is-negative-zero": "^2.0.3", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.3", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.13", + "is-weakref": "^1.0.2", + "object-inspect": "^1.13.1", + "object-keys": "^1.1.1", + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.0", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.8", + "string.prototype.trimend": "^1.0.7", + "string.prototype.trimstart": "^1.0.7", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.5", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.14" + } + }, + "es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "requires": { + "get-intrinsic": "^1.2.4" + } + }, + "es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true + }, + "es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "requires": { + "es-errors": "^1.3.0" + } + }, + "es-set-tostringtag": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", + "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", + "dev": true, + "requires": { + "get-intrinsic": "^1.2.4", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "eslint": { + "version": "7.32.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", + "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", + "dev": true, + "requires": { + "@babel/code-frame": "7.12.11", + "@eslint/eslintrc": "^0.4.3", + "@humanwhocodes/config-array": "^0.5.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.1", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.1.2", + "globals": "^13.6.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^6.0.9", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + } + }, + "eslint-config-prettier": { + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.15.0.tgz", + "integrity": "sha512-a1+kOYLR8wMGustcgAjdydMsQ2A/2ipRPwRKUmfYaSxc9ZPcrku080Ctl6zrZzZNs/U82MjSv+qKREkoq3bJaw==", + "dev": true, + "requires": { + "get-stdin": "^6.0.0" + } + }, + "eslint-plugin-prettier": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.3.1.tgz", + "integrity": "sha512-Rq3jkcFY8RYeQLgk2cCwuc0P7SEFwDravPhsJZOQ5N4YI4DSg50NyqJ/9gdZHzQlHf8MvafSesbNJCcP/FF6pQ==", + "dev": true, + "requires": { + "prettier-linter-helpers": "^1.0.0" + } + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } + } + }, + "eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true + }, + "espree": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", + "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "dev": true, + "requires": { + "acorn": "^7.4.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^1.3.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + } + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "requires": { + "flat-cache": "^3.0.4" + } + }, + "flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "requires": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + } + }, + "flatted": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "dev": true + }, + "for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "requires": { + "is-callable": "^1.1.3" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true + }, + "function.prototype.name": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" + } + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", + "dev": true + }, + "functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true + }, + "get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + } + }, + "get-stdin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "dev": true + }, + "get-symbol-description": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", + "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", + "dev": true, + "requires": { + "call-bind": "^1.0.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4" + } + }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + } + }, + "globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3" + } + }, + "gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.3" + } + }, + "graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "requires": { + "es-define-property": "^1.0.0" + } + }, + "has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "dev": true + }, + "has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true + }, + "has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "requires": { + "has-symbols": "^1.0.3" + } + }, + "hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "requires": { + "function-bind": "^1.1.2" + } + }, + "hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "internal-slot": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", + "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "hasown": "^2.0.0", + "side-channel": "^1.0.4" + } + }, + "is-array-buffer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", + "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1" + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, + "is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "requires": { + "has-bigints": "^1.0.1" + } + }, + "is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + } + }, + "is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true + }, + "is-core-module": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "dev": true, + "requires": { + "hasown": "^2.0.0" + } + }, + "is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "dev": true, + "requires": { + "is-typed-array": "^1.1.13" + } + }, + "is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-negative-zero": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", + "dev": true + }, + "is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + } + }, + "is-shared-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", + "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", + "dev": true, + "requires": { + "call-bind": "^1.0.7" + } + }, + "is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, + "requires": { + "has-symbols": "^1.0.2" + } + }, + "is-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "dev": true, + "requires": { + "which-typed-array": "^1.1.14" + } + }, + "is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2" + } + }, + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "requires": { + "json-buffer": "3.0.1" + } + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" } }, "lodash.isempty": { @@ -32,11 +1225,269 @@ "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "lodash.truncate": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", + "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", + "dev": true + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", + "dev": true + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true + } + } + }, + "npm-run-all": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz", + "integrity": "sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "chalk": "^2.4.1", + "cross-spawn": "^6.0.5", + "memorystream": "^0.3.1", + "minimatch": "^3.0.4", + "pidtree": "^0.3.0", + "read-pkg": "^3.0.0", + "shell-quote": "^1.6.1", + "string.prototype.padend": "^3.0.0" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "dev": true + }, + "semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "dev": true + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "object-inspect": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "dev": true + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object.assign": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "optionator": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "dev": true, + "requires": { + "@aashutoshrathi/word-wrap": "^1.2.3", + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0" + } + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "pidtree": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.1.tgz", + "integrity": "sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==", + "dev": true + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "dev": true + }, "pipeline-cli": { "version": "git+https://github.com/bcgov/biohubbc-pipeline-cli.git#61b44543041da3697d189beb2472539fe2e099c1", "from": "git+https://github.com/bcgov/biohubbc-pipeline-cli.git", @@ -48,11 +1499,615 @@ "lodash.isstring": "^4.0.1" } }, + "possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "dev": true + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, "prettier": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz", "integrity": "sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==", "dev": true + }, + "prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "requires": { + "fast-diff": "^1.1.2" + } + }, + "prettier-plugin-organize-imports": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-2.3.4.tgz", + "integrity": "sha512-R8o23sf5iVL/U71h9SFUdhdOEPsi3nm42FD/oDYIZ2PQa4TNWWuWecxln6jlIQzpZTDMUeO1NicJP6lLn2TtRw==", + "dev": true + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==", + "dev": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + }, + "regexp.prototype.flags": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", + "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", + "dev": true, + "requires": { + "call-bind": "^1.0.6", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.1" + } + }, + "regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true + }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true + }, + "resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "requires": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "safe-array-concat": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + } + }, + "safe-regex-test": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", + "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", + "dev": true, + "requires": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-regex": "^1.1.4" + } + }, + "semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "requires": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + } + }, + "set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "requires": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "shell-quote": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", + "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", + "dev": true + }, + "side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + } + }, + "slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + } + } + }, + "spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.17.tgz", + "integrity": "sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg==", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "string.prototype.padend": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.5.tgz", + "integrity": "sha512-DOB27b/2UTTD+4myKUFh+/fXWcu/UDyASIXfg+7VzoCNNGOfWvoyU/x5pvVHr++ztyt/oSYI1BcWBBG/hmlNjA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + } + }, + "string.prototype.trim": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" + }, + "dependencies": { + "es-abstract": { + "version": "1.23.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.2.tgz", + "integrity": "sha512-60s3Xv2T2p1ICykc7c+DNDPLDMm9t4QxCOUU0K9JxiLjM3C1zB9YVdN7tjxrFd4+AkZ8CdX1ovUga4P2+1e+/w==", + "dev": true, + "requires": { + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.0.3", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", + "has-symbols": "^1.0.3", + "hasown": "^2.0.2", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.1", + "is-negative-zero": "^2.0.3", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.3", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.13", + "is-weakref": "^1.0.2", + "object-inspect": "^1.13.1", + "object-keys": "^1.1.1", + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.2", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", + "string.prototype.trimstart": "^1.0.7", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.5", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.15" + } + } + } + }, + "string.prototype.trimend": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + } + }, + "string.prototype.trimstart": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz", + "integrity": "sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true + }, + "table": { + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/table/-/table-6.8.1.tgz", + "integrity": "sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==", + "dev": true, + "requires": { + "ajv": "^8.0.1", + "lodash.truncate": "^4.4.2", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1" + }, + "dependencies": { + "ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + } + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true + }, + "typed-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", + "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.13" + } + }, + "typed-array-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", + "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + } + }, + "typed-array-byte-offset": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", + "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + } + }, + "typed-array-length": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.5.tgz", + "integrity": "sha512-yMi0PlwuznKHxKmcpoOdeLwxBoVPkqZxd7q2FgMkmD3bNwvF5VW0+UlUQ1k1vmktTu4Yu13Q0RIxEP8+B+wloA==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0" + } + }, + "unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + } + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "v8-compile-cache": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz", + "integrity": "sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw==", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "requires": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + } + }, + "which-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true } } } diff --git a/api/.pipeline/package.json b/api/.pipeline/package.json index 1f13d26ce9..edff70d363 100644 --- a/api/.pipeline/package.json +++ b/api/.pipeline/package.json @@ -18,7 +18,8 @@ "lint": "eslint . --ignore-pattern 'node_modules' --ext .js,.ts", "lint-fix": "eslint . --fix --ignore-pattern 'node_modules' --ext .js,.ts", "format": "prettier --check \"./**/*.{js,jsx,ts,tsx,css,scss}\"", - "format-fix": "prettier --write \"./**/*.{js,jsx,ts,tsx,json,css,scss}\"" + "format-fix": "prettier --write \"./**/*.{js,jsx,ts,tsx,json,css,scss}\"", + "fix": "npm-run-all -l -s lint-fix format-fix" }, "dependencies": { "debug": "^4.2.0", @@ -29,6 +30,11 @@ "pipeline-cli": "git+https://github.com/bcgov/biohubbc-pipeline-cli.git" }, "devDependencies": { - "prettier": "~2.3.2" + "eslint": "~7.32.0", + "eslint-config-prettier": "~6.15.0", + "eslint-plugin-prettier": "~3.3.1", + "npm-run-all": "~4.1.5", + "prettier": "^2.3.2", + "prettier-plugin-organize-imports": "~2.3.4" } } diff --git a/api/.pipeline/templates/api.dc.yaml b/api/.pipeline/templates/api.dc.yaml index 483ca49f4c..d469245eba 100644 --- a/api/.pipeline/templates/api.dc.yaml +++ b/api/.pipeline/templates/api.dc.yaml @@ -12,7 +12,7 @@ parameters: - name: VERSION description: Version of the application value: '1.0.0' - - name: HOST + - name: API_HOST description: Host name of the application required: true - name: APP_HOST @@ -213,7 +213,7 @@ objects: - name: api env: - name: API_HOST - value: ${HOST} + value: ${API_HOST} - name: API_PORT value: ${API_PORT_DEFAULT} - name: APP_HOST @@ -453,7 +453,7 @@ objects: labels: {} name: ${NAME}${SUFFIX} spec: - host: ${HOST} + host: ${API_HOST} tls: insecureEdgeTerminationPolicy: Redirect termination: edge diff --git a/app/.pipeline/config.js b/app/.pipeline/config.js index 52fe71f358..4e452860c2 100644 --- a/app/.pipeline/config.js +++ b/app/.pipeline/config.js @@ -22,97 +22,97 @@ const phases = { pr: { build: { ...pipelineConfigMap.app.pr.build, - name: pipelineConfigMap.module.app, - changeId: changeId, - suffix: `-build-${changeId}`, - instance: `${pipelineConfigMap.module.app}-build-${changeId}`, - version: `${pipelineConfigMap.version}-${changeId}`, - tag: `build-${pipelineConfigMap.version}-${changeId}`, - branch: options.git.ref + NAME: pipelineConfigMap.module.app, + CHANGE_ID: changeId, + SUFFIX: `-build-${changeId}`, + INSTANCE: `${pipelineConfigMap.module.app}-build-${changeId}`, + VERSION: `${pipelineConfigMap.version}-${changeId}`, + TAG: `build-${pipelineConfigMap.version}-${changeId}`, + BRANCH: options.git.ref }, deploy: { ...pipelineConfigMap.app.pr.deploy, - name: pipelineConfigMap.module.app, - changeId: changeId, - suffix: `-dev-${changeId}`, - instance: `${pipelineConfigMap.module.app}-pr-${changeId}`, - version: `pr-${changeId}`, - tag: `dev-${pipelineConfigMap.version}-${changeId}`, - host: `${pipelineConfigMap.module.app}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, - apiHost: `${pipelineConfigMap.module.api}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, - sso: pipelineConfigMap.sso.pr + NAME: pipelineConfigMap.module.app, + CHANGE_ID: changeId, + SUFFIX: `-dev-${changeId}`, + INSTANCE: `${pipelineConfigMap.module.app}-pr-${changeId}`, + VERSION: `pr-${changeId}`, + TAG: `dev-${pipelineConfigMap.version}-${changeId}`, + APP_HOST: `${pipelineConfigMap.module.app}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, + API_HOST: `${pipelineConfigMap.module.api}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, + SSO: pipelineConfigMap.SSO.pr } }, dev: { build: { ...pipelineConfigMap.app.dev.build, - name: pipelineConfigMap.module.app, - changeId: changeId, - suffix: `-build-${changeId}`, - instance: `${pipelineConfigMap.module.app}-build-${changeId}`, - version: `${pipelineConfigMap.version}-${changeId}`, - tag: `build-${pipelineConfigMap.version}-${changeId}-${branch}`, - branch: branch + NAME: pipelineConfigMap.module.app, + CHANGE_ID: changeId, + SUFFIX: `-build-${changeId}`, + INSTANCE: `${pipelineConfigMap.module.app}-build-${changeId}`, + VERSION: `${pipelineConfigMap.version}-${changeId}`, + TAG: `build-${pipelineConfigMap.version}-${changeId}-${branch}`, + BRANCH: branch }, deploy: { ...pipelineConfigMap.app.dev.deploy, - name: pipelineConfigMap.module.app, - changeId: 'deploy', - suffix: '-dev-deploy', - instance: `${pipelineConfigMap.module.app}-dev-deploy`, - version: `deploy-${changeId}`, - tag: `dev-${pipelineConfigMap.version}-deploy`, - host: pipelineConfigMap.app.dev.deploy.staticAppUrl, - apiHost: pipelineConfigMap.app.dev.deploy.staticApiUrl, - sso: pipelineConfigMap.sso.dev + NAME: pipelineConfigMap.module.app, + CHANGE_ID: 'deploy', + SUFFIX: '-dev-deploy', + INSTANCE: `${pipelineConfigMap.module.app}-dev-deploy`, + VERSION: `deploy-${changeId}`, + TAG: `dev-${pipelineConfigMap.version}-deploy`, + APP_HOST: pipelineConfigMap.app.dev.deploy.APP_HOST, + API_HOST: pipelineConfigMap.app.dev.deploy.API_HOST, + SSO: pipelineConfigMap.SSO.dev } }, test: { build: { ...pipelineConfigMap.app.test.build, - name: pipelineConfigMap.module.app, - changeId: changeId, - suffix: `-build-${changeId}`, - instance: `${pipelineConfigMap.module.app}-build-${changeId}`, - version: `${pipelineConfigMap.version}-${changeId}`, - tag: `build-${pipelineConfigMap.version}-${changeId}-${branch}`, - branch: branch + NAME: pipelineConfigMap.module.app, + CHANGE_ID: changeId, + SUFFIX: `-build-${changeId}`, + INSTANCE: `${pipelineConfigMap.module.app}-build-${changeId}`, + VERSION: `${pipelineConfigMap.version}-${changeId}`, + TAG: `build-${pipelineConfigMap.version}-${changeId}-${branch}`, + BRANCH: branch }, deploy: { ...pipelineConfigMap.app.test.deploy, - name: pipelineConfigMap.module.app, - changeId: 'deploy', - suffix: `-test`, - instance: `${pipelineConfigMap.module.app}-test`, - version: `deploy-${changeId}`, - tag: `test-${pipelineConfigMap.version}`, - host: pipelineConfigMap.app.test.deploy.staticAppUrl, - apiHost: pipelineConfigMap.app.test.deploy.staticApiUrl, - sso: pipelineConfigMap.sso.test + NAME: pipelineConfigMap.module.app, + CHANGE_ID: 'deploy', + SUFFIX: `-test`, + INSTANCE: `${pipelineConfigMap.module.app}-test`, + VERSION: `deploy-${changeId}`, + TAG: `test-${pipelineConfigMap.version}`, + APP_HOST: pipelineConfigMap.app.test.deploy.APP_HOST, + API_HOST: pipelineConfigMap.app.test.deploy.API_HOST, + SSO: pipelineConfigMap.SSO.test } }, prod: { build: { ...pipelineConfigMap.app.prod.build, - name: pipelineConfigMap.module.app, - changeId: changeId, - suffix: `-build-${changeId}`, - instance: `${pipelineConfigMap.module.app}-build-${changeId}`, - version: `${pipelineConfigMap.version}-${changeId}`, - tag: `build-${pipelineConfigMap.version}-${changeId}-${branch}`, - branch: branch + NAME: pipelineConfigMap.module.app, + CHANGE_ID: changeId, + SUFFIX: `-build-${changeId}`, + INSTANCE: `${pipelineConfigMap.module.app}-build-${changeId}`, + VERSION: `${pipelineConfigMap.version}-${changeId}`, + TAG: `build-${pipelineConfigMap.version}-${changeId}-${branch}`, + BRANCH: branch }, deploy: { ...pipelineConfigMap.app.prod.deploy, - name: pipelineConfigMap.module.app, - changeId: 'deploy', - suffix: `-prod`, - instance: `${pipelineConfigMap.module.app}-prod`, - version: `deploy-${changeId}`, - tag: `prod-${pipelineConfigMap.version}`, - host: pipelineConfigMap.app.prod.deploy.staticAppUrl, - apiHost: pipelineConfigMap.app.prod.deploy.staticApiUrl, - sso: pipelineConfigMap.sso.prod + NAME: pipelineConfigMap.module.app, + CHANGE_ID: 'deploy', + SUFFIX: `-prod`, + INSTANCE: `${pipelineConfigMap.module.app}-prod`, + VERSION: `deploy-${changeId}`, + TAG: `prod-${pipelineConfigMap.version}`, + APP_HOST: pipelineConfigMap.app.prod.deploy.APP_HOST, + API_HOST: pipelineConfigMap.app.prod.deploy.API_HOST, + SSO: pipelineConfigMap.SSO.prod } } }; diff --git a/app/.pipeline/lib/app.build.js b/app/.pipeline/lib/app.build.js index 1983b968fc..2cb0a8c2fa 100644 --- a/app/.pipeline/lib/app.build.js +++ b/app/.pipeline/lib/app.build.js @@ -14,7 +14,7 @@ const appBuild = (settings) => { const env = settings.options.env; const phase = settings.options.phase; - const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env][phase].namespace }, options)); + const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env][phase].NAMESPACE }, options)); const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, '../templates')); @@ -23,20 +23,26 @@ const appBuild = (settings) => { objects.push( ...oc.processDeploymentTemplate(`${templatesLocalBaseUrl}/app.bc.yaml`, { param: { - NAME: phases[env][phase].name, - SUFFIX: phases[env][phase].suffix, - VERSION: phases[env][phase].tag, + NAME: phases[env][phase].NAME, + SUFFIX: phases[env][phase].SUFFIX, + VERSION: phases[env][phase].TAG, SOURCE_REPOSITORY_URL: oc.git.http_url, - SOURCE_REPOSITORY_REF: phases[env][phase].branch, - CPU_REQUEST: phases[env][phase].cpuRequest, - CPU_LIMIT: phases[env][phase].cpuLimit, - MEMORY_REQUEST: phases[env][phase].memoryRequest, - MEMORY_LIMIT: phases[env][phase].memoryLimit + SOURCE_REPOSITORY_REF: phases[env][phase].BRANCH, + CPU_REQUEST: phases[env][phase].CPU_REQUEST, + CPU_LIMIT: phases[env][phase].CPU_LIMIT, + MEMORY_REQUEST: phases[env][phase].MEMORY_REQUEST, + MEMORY_LIMIT: phases[env][phase].MEMORY_LIMIT } }) ); - oc.applyRecommendedLabels(objects, phases[env][phase].name, env, phases[env][phase].changeId, phases[env][phase].instance); + oc.applyRecommendedLabels( + objects, + phases[env][phase].NAME, + env, + phases[env][phase].CHANGE_ID, + phases[env][phase].INSTANCE + ); oc.applyAndBuild(objects); }; diff --git a/app/.pipeline/lib/app.deploy.js b/app/.pipeline/lib/app.deploy.js index bb21d4d7c7..e9dbbf0a4a 100644 --- a/app/.pipeline/lib/app.deploy.js +++ b/app/.pipeline/lib/app.deploy.js @@ -9,7 +9,7 @@ const appDeploy = async (settings) => { const env = settings.options.env; const phase = settings.options.phase; - const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env][phase].namespace }, options)); + const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env][phase].NAMESPACE }, options)); const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, '../templates')); @@ -18,49 +18,49 @@ const appDeploy = async (settings) => { objects.push( ...oc.processDeploymentTemplate(`${templatesLocalBaseUrl}/app.dc.yaml`, { param: { - NAME: phases[env][phase].name, - SUFFIX: phases[env][phase].suffix, - VERSION: phases[env][phase].tag, - HOST: phases[env][phase].host, - CHANGE_ID: phases[env].build.changeId || phases[env][phase].changeId, - REACT_APP_API_HOST: phases[env][phase].apiHost, - REACT_APP_SITEMINDER_LOGOUT_URL: phases[env][phase].siteminderLogoutURL, + NAME: phases[env][phase].NAME, + SUFFIX: phases[env][phase].SUFFIX, + VERSION: phases[env][phase].TAG, + APP_HOST: phases[env][phase].APP_HOST, + CHANGE_ID: phases[env].build.CHANGE_ID || phases[env][phase].CHANGE_ID, + REACT_APP_API_HOST: phases[env][phase].API_HOST, + REACT_APP_SITEMINDER_LOGOUT_URL: phases[env][phase].SITEMINDER_LOGOUT_URL, // File Upload Settings - REACT_APP_MAX_UPLOAD_NUM_FILES: phases[env][phase].maxUploadNumFiles, - REACT_APP_MAX_UPLOAD_FILE_SIZE: phases[env][phase].maxUploadFileSize, + REACT_APP_MAX_UPLOAD_NUM_FILES: phases[env][phase].MAX_UPLOAD_NUM_FILES, + REACT_APP_MAX_UPLOAD_FILE_SIZE: phases[env][phase].MAX_UPLOAD_FILE_SIZE, // Node - NODE_ENV: phases[env][phase].nodeEnv, - REACT_APP_NODE_ENV: phases[env][phase].nodeEnv, + NODE_ENV: phases[env][phase].NODE_ENV, + REACT_APP_NODE_ENV: phases[env][phase].NODE_ENV, // Keycloak - REACT_APP_KEYCLOAK_HOST: phases[env][phase].sso.host, - REACT_APP_KEYCLOAK_REALM: phases[env][phase].sso.realm, - REACT_APP_KEYCLOAK_CLIENT_ID: phases[env][phase].sso.clientId, + REACT_APP_KEYCLOAK_HOST: phases[env][phase].SSO.KEYCLOAK_HOST, + REACT_APP_KEYCLOAK_REALM: phases[env][phase].SSO.KEYCLOAK_REALM, + REACT_APP_KEYCLOAK_CLIENT_ID: phases[env][phase].SSO.KEYCLOAK_CLIENT_ID, // BioHub Plastform (aka: Backbone) - REACT_APP_BACKBONE_PUBLIC_API_HOST: phases[env][phase].backbonePublicApiHost, - REACT_APP_BIOHUB_TAXON_PATH: phases[env][phase].biohubTaxonPath, - REACT_APP_BIOHUB_TAXON_TSN_PATH: phases[env][phase].biohubTaxonTsnPath, - REACT_APP_BIOHUB_FEATURE_FLAG: phases[env][phase].biohubFeatureFlag, + REACT_APP_BACKBONE_PUBLIC_API_HOST: phases[env][phase].BACKBONE_PUBLIC_API_HOST, + REACT_APP_BIOHUB_TAXON_PATH: phases[env][phase].BIOHUB_TAXON_PATH, + REACT_APP_BIOHUB_TAXON_TSN_PATH: phases[env][phase].BIOHUB_TAXON_TSN_PATH, + REACT_APP_BIOHUB_FEATURE_FLAG: phases[env][phase].REACT_APP_BIOHUB_FEATURE_FLAG, // Openshift Resources - CPU_REQUEST: phases[env][phase].cpuRequest, - CPU_LIMIT: phases[env][phase].cpuLimit, - MEMORY_REQUEST: phases[env][phase].memoryRequest, - MEMORY_LIMIT: phases[env][phase].memoryLimit, - REPLICAS: phases[env][phase].replicas, - REPLICAS_MAX: phases[env][phase].replicasMax + CPU_REQUEST: phases[env][phase].CPU_REQUEST, + CPU_LIMIT: phases[env][phase].CPU_LIMIT, + MEMORY_REQUEST: phases[env][phase].MEMORY_REQUEST, + MEMORY_LIMIT: phases[env][phase].MEMORY_LIMIT, + REPLICAS: phases[env][phase].REPLICAS, + REPLICAS_MAX: phases[env][phase].REPLICAS_MAX } }) ); oc.applyRecommendedLabels( objects, - phases[env][phase].name, + phases[env][phase].NAME, env, - phases[env][phase].changeId, - phases[env][phase].instance + phases[env][phase].CHANGE_ID, + phases[env][phase].INSTANCE ); - oc.importImageStreams(objects, phases[env][phase].tag, phases[env].build.namespace, phases[env].build.tag); + oc.importImageStreams(objects, phases[env][phase].TAG, phases[env].build.NAMESPACE, phases[env].build.TAG); - await oc.applyAndDeploy(objects, phases[env][phase].instance); + await oc.applyAndDeploy(objects, phases[env][phase].INSTANCE); }; module.exports = { appDeploy }; diff --git a/app/.pipeline/lib/clean.js b/app/.pipeline/lib/clean.js index 1cebee2759..35389eca93 100644 --- a/app/.pipeline/lib/clean.js +++ b/app/.pipeline/lib/clean.js @@ -13,7 +13,7 @@ const clean = async (settings) => { const env = settings.options.env; const phase = settings.options.phase; - const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env].build.namespace }, options)); + const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env].build.NAMESPACE }, options)); if (!Object.prototype.hasOwnProperty.call(phases, env)) { // is not a field of phases @@ -27,8 +27,8 @@ const clean = async (settings) => { // Get build configs let buildConfigs = oc.get('bc', { - selector: `app=${phases[env][phase].instance},env-id=${phases[env][phase].changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, - namespace: phases[env][phase].namespace + selector: `app=${phases[env][phase].INSTANCE},env-id=${phases[env][phase].CHANGE_ID},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, + namespace: phases[env][phase].NAMESPACE }); // Clean build configs @@ -37,15 +37,15 @@ const clean = async (settings) => { oc.delete([`ImageStreamTag/${buildConfig.spec.output.to.name}`], { 'ignore-not-found': 'true', wait: 'true', - namespace: phases[env][phase].namespace + namespace: phases[env][phase].NAMESPACE }); } }); // get deployment configs let deploymentConfigs = oc.get('dc', { - selector: `app=${phases[env][phase].instance},env-id=${phases[env][phase].changeId},env-name=${phaseKey},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, - namespace: phases[env][phase].namespace + selector: `app=${phases[env][phase].INSTANCE},env-id=${phases[env][phase].CHANGE_ID},env-name=${env},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, + namespace: phases[env][phase].NAMESPACE }); // Clean deployment configs @@ -55,22 +55,22 @@ const clean = async (settings) => { oc.delete([`ImageStreamTag/${trigger.imageChangeParams.from.name}`], { 'ignore-not-found': 'true', wait: 'true', - namespace: phases[env][phase].namespace + namespace: phases[env][phase].NAMESPACE }); } }); }); oc.raw('delete', ['all'], { - selector: `app=${phases[env][phase].instance},env-id=${phases[env][phase].changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, + selector: `app=${phases[env][phase].INSTANCE},env-id=${phases[env][phase].CHANGE_ID},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, wait: 'true', - namespace: phases[env][phase].namespace + namespace: phases[env][phase].NAMESPACE }); oc.raw('delete', ['all,pvc,secrets,Secrets,secret,configmap,endpoints,Endpoints'], { - selector: `app=${phases[env][phase].instance},env-id=${phases[env][phase].changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, + selector: `app=${phases[env][phase].INSTANCE},env-id=${phases[env][phase].CHANGE_ID},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, wait: 'true', - namespace: phases[env][phase].namespace + namespace: phases[env][phase].NAMESPACE }); }; diff --git a/app/.pipeline/package-lock.json b/app/.pipeline/package-lock.json index 83751a9d58..299ead87cb 100644 --- a/app/.pipeline/package-lock.json +++ b/app/.pipeline/package-lock.json @@ -4,12 +4,1205 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true + }, + "@babel/code-frame": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", + "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "dev": true + }, + "@babel/highlight": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", + "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true + } + } + }, + "@eslint/eslintrc": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", + "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^13.9.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + } + }, + "@humanwhocodes/config-array": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", + "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "dev": true, + "requires": { + "@humanwhocodes/object-schema": "^1.2.0", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + } + }, + "@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true + }, + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true + }, + "acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "array-buffer-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", + "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", + "dev": true, + "requires": { + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" + } + }, + "arraybuffer.prototype.slice": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", + "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", + "dev": true, + "requires": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.2.1", + "get-intrinsic": "^1.2.3", + "is-array-buffer": "^3.0.4", + "is-shared-array-buffer": "^1.0.2" + } + }, + "astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true + }, + "available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "requires": { + "possible-typed-array-names": "^1.0.0" + } + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dev": true, + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + } + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "dev": true, + "requires": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + } + }, + "data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + } + }, + "data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "dev": true, + "requires": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + } + }, "debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "requires": { - "ms": "2.1.2" + "ms": "2.1.2" + } + }, + "deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + } + }, + "define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "requires": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + } + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "enquirer": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", + "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1", + "strip-ansi": "^6.0.1" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.22.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.5.tgz", + "integrity": "sha512-oW69R+4q2wG+Hc3KZePPZxOiisRIqfKBVo/HLx94QcJeWGU/8sZhCvc829rd1kS366vlJbzBfXf9yWwf0+Ko7w==", + "dev": true, + "requires": { + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-set-tostringtag": "^2.0.3", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", + "has-symbols": "^1.0.3", + "hasown": "^2.0.1", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", + "is-callable": "^1.2.7", + "is-negative-zero": "^2.0.3", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.3", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.13", + "is-weakref": "^1.0.2", + "object-inspect": "^1.13.1", + "object-keys": "^1.1.1", + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.0", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.8", + "string.prototype.trimend": "^1.0.7", + "string.prototype.trimstart": "^1.0.7", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.5", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.14" + } + }, + "es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "requires": { + "get-intrinsic": "^1.2.4" + } + }, + "es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true + }, + "es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "requires": { + "es-errors": "^1.3.0" + } + }, + "es-set-tostringtag": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", + "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", + "dev": true, + "requires": { + "get-intrinsic": "^1.2.4", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "eslint": { + "version": "7.32.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", + "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", + "dev": true, + "requires": { + "@babel/code-frame": "7.12.11", + "@eslint/eslintrc": "^0.4.3", + "@humanwhocodes/config-array": "^0.5.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.1", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.1.2", + "globals": "^13.6.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^6.0.9", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + } + }, + "eslint-config-prettier": { + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.15.0.tgz", + "integrity": "sha512-a1+kOYLR8wMGustcgAjdydMsQ2A/2ipRPwRKUmfYaSxc9ZPcrku080Ctl6zrZzZNs/U82MjSv+qKREkoq3bJaw==", + "dev": true, + "requires": { + "get-stdin": "^6.0.0" + } + }, + "eslint-plugin-prettier": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.3.1.tgz", + "integrity": "sha512-Rq3jkcFY8RYeQLgk2cCwuc0P7SEFwDravPhsJZOQ5N4YI4DSg50NyqJ/9gdZHzQlHf8MvafSesbNJCcP/FF6pQ==", + "dev": true, + "requires": { + "prettier-linter-helpers": "^1.0.0" + } + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } + } + }, + "eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true + }, + "espree": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", + "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "dev": true, + "requires": { + "acorn": "^7.4.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^1.3.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + } + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "requires": { + "flat-cache": "^3.0.4" + } + }, + "flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "requires": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + } + }, + "flatted": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "dev": true + }, + "for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "requires": { + "is-callable": "^1.1.3" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true + }, + "function.prototype.name": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" + } + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", + "dev": true + }, + "functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true + }, + "get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + } + }, + "get-stdin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "dev": true + }, + "get-symbol-description": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", + "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", + "dev": true, + "requires": { + "call-bind": "^1.0.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4" + } + }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + } + }, + "globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3" + } + }, + "gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.3" + } + }, + "graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "requires": { + "es-define-property": "^1.0.0" + } + }, + "has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "dev": true + }, + "has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true + }, + "has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "requires": { + "has-symbols": "^1.0.3" + } + }, + "hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "requires": { + "function-bind": "^1.1.2" + } + }, + "hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "internal-slot": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", + "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "hasown": "^2.0.0", + "side-channel": "^1.0.4" + } + }, + "is-array-buffer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", + "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1" + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, + "is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "requires": { + "has-bigints": "^1.0.1" + } + }, + "is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + } + }, + "is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true + }, + "is-core-module": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "dev": true, + "requires": { + "hasown": "^2.0.0" + } + }, + "is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "dev": true, + "requires": { + "is-typed-array": "^1.1.13" + } + }, + "is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-negative-zero": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", + "dev": true + }, + "is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + } + }, + "is-shared-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", + "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", + "dev": true, + "requires": { + "call-bind": "^1.0.7" + } + }, + "is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, + "requires": { + "has-symbols": "^1.0.2" + } + }, + "is-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "dev": true, + "requires": { + "which-typed-array": "^1.1.14" + } + }, + "is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2" + } + }, + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "requires": { + "json-buffer": "3.0.1" + } + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" } }, "lodash.isempty": { @@ -32,11 +1225,269 @@ "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "lodash.truncate": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", + "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", + "dev": true + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", + "dev": true + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true + } + } + }, + "npm-run-all": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz", + "integrity": "sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "chalk": "^2.4.1", + "cross-spawn": "^6.0.5", + "memorystream": "^0.3.1", + "minimatch": "^3.0.4", + "pidtree": "^0.3.0", + "read-pkg": "^3.0.0", + "shell-quote": "^1.6.1", + "string.prototype.padend": "^3.0.0" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "dev": true + }, + "semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "dev": true + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "object-inspect": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "dev": true + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object.assign": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "optionator": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "dev": true, + "requires": { + "@aashutoshrathi/word-wrap": "^1.2.3", + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0" + } + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "pidtree": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.1.tgz", + "integrity": "sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==", + "dev": true + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "dev": true + }, "pipeline-cli": { "version": "git+https://github.com/bcgov/biohubbc-pipeline-cli.git#61b44543041da3697d189beb2472539fe2e099c1", "from": "git+https://github.com/bcgov/biohubbc-pipeline-cli.git", @@ -48,11 +1499,615 @@ "lodash.isstring": "^4.0.1" } }, + "possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "dev": true + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, "prettier": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz", "integrity": "sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==", "dev": true + }, + "prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "requires": { + "fast-diff": "^1.1.2" + } + }, + "prettier-plugin-organize-imports": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-2.3.4.tgz", + "integrity": "sha512-R8o23sf5iVL/U71h9SFUdhdOEPsi3nm42FD/oDYIZ2PQa4TNWWuWecxln6jlIQzpZTDMUeO1NicJP6lLn2TtRw==", + "dev": true + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==", + "dev": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + }, + "regexp.prototype.flags": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", + "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", + "dev": true, + "requires": { + "call-bind": "^1.0.6", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.1" + } + }, + "regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true + }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true + }, + "resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "requires": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "safe-array-concat": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + } + }, + "safe-regex-test": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", + "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", + "dev": true, + "requires": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-regex": "^1.1.4" + } + }, + "semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "requires": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + } + }, + "set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "requires": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "shell-quote": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", + "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", + "dev": true + }, + "side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + } + }, + "slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + } + } + }, + "spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.17.tgz", + "integrity": "sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg==", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "string.prototype.padend": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.5.tgz", + "integrity": "sha512-DOB27b/2UTTD+4myKUFh+/fXWcu/UDyASIXfg+7VzoCNNGOfWvoyU/x5pvVHr++ztyt/oSYI1BcWBBG/hmlNjA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + } + }, + "string.prototype.trim": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" + }, + "dependencies": { + "es-abstract": { + "version": "1.23.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.2.tgz", + "integrity": "sha512-60s3Xv2T2p1ICykc7c+DNDPLDMm9t4QxCOUU0K9JxiLjM3C1zB9YVdN7tjxrFd4+AkZ8CdX1ovUga4P2+1e+/w==", + "dev": true, + "requires": { + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.0.3", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", + "has-symbols": "^1.0.3", + "hasown": "^2.0.2", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.1", + "is-negative-zero": "^2.0.3", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.3", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.13", + "is-weakref": "^1.0.2", + "object-inspect": "^1.13.1", + "object-keys": "^1.1.1", + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.2", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", + "string.prototype.trimstart": "^1.0.7", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.5", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.15" + } + } + } + }, + "string.prototype.trimend": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + } + }, + "string.prototype.trimstart": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz", + "integrity": "sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true + }, + "table": { + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/table/-/table-6.8.1.tgz", + "integrity": "sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==", + "dev": true, + "requires": { + "ajv": "^8.0.1", + "lodash.truncate": "^4.4.2", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1" + }, + "dependencies": { + "ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + } + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true + }, + "typed-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", + "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.13" + } + }, + "typed-array-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", + "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + } + }, + "typed-array-byte-offset": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", + "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + } + }, + "typed-array-length": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.5.tgz", + "integrity": "sha512-yMi0PlwuznKHxKmcpoOdeLwxBoVPkqZxd7q2FgMkmD3bNwvF5VW0+UlUQ1k1vmktTu4Yu13Q0RIxEP8+B+wloA==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0" + } + }, + "unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + } + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "v8-compile-cache": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz", + "integrity": "sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw==", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "requires": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + } + }, + "which-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true } } } diff --git a/app/.pipeline/package.json b/app/.pipeline/package.json index 3e805fbba6..841134fef5 100644 --- a/app/.pipeline/package.json +++ b/app/.pipeline/package.json @@ -18,7 +18,8 @@ "lint": "eslint . --ignore-pattern 'node_modules' --ext .js,.ts", "lint-fix": "eslint . --fix --ignore-pattern 'node_modules' --ext .js,.ts", "format": "prettier --check \"./**/*.{js,jsx,ts,tsx,css,scss}\"", - "format-fix": "prettier --write \"./**/*.{js,jsx,ts,tsx,json,css,scss}\"" + "format-fix": "prettier --write \"./**/*.{js,jsx,ts,tsx,json,css,scss}\"", + "fix": "npm-run-all -l -s lint-fix format-fix" }, "dependencies": { "debug": "^4.2.0", @@ -29,6 +30,11 @@ "pipeline-cli": "git+https://github.com/bcgov/biohubbc-pipeline-cli.git" }, "devDependencies": { - "prettier": "~2.3.2" + "eslint": "~7.32.0", + "eslint-config-prettier": "~6.15.0", + "eslint-plugin-prettier": "~3.3.1", + "npm-run-all": "~4.1.5", + "prettier": "^2.3.2", + "prettier-plugin-organize-imports": "~2.3.4" } } diff --git a/app/.pipeline/templates/app.dc.yaml b/app/.pipeline/templates/app.dc.yaml index 6bc31cf023..766e04deaa 100644 --- a/app/.pipeline/templates/app.dc.yaml +++ b/app/.pipeline/templates/app.dc.yaml @@ -11,7 +11,7 @@ parameters: value: 'dev' - name: VERSION value: '1.0' - - name: HOST + - name: APP_HOST - name: CHANGE_ID value: '0' - name: REACT_APP_BIOHUB_FEATURE_FLAG @@ -250,7 +250,7 @@ objects: labels: {} name: ${NAME}${SUFFIX} spec: - host: ${HOST} + host: ${APP_HOST} tls: insecureEdgeTerminationPolicy: Redirect termination: edge diff --git a/database/.pipeline/config.js b/database/.pipeline/config.js index 1fb27d1cc8..cab204e318 100644 --- a/database/.pipeline/config.js +++ b/database/.pipeline/config.js @@ -22,85 +22,85 @@ const phases = { pr: { build: { ...pipelineConfigMap.database.pr.build, - name: pipelineConfigMap.module.db, - changeId: changeId, - suffix: `-build-${changeId}`, - instance: `${pipelineConfigMap.module.db}-build-${changeId}`, - version: `${pipelineConfigMap.version}-${changeId}`, - tag: `build-${pipelineConfigMap.version}-${changeId}`, - branch: options.git.ref + NAME: pipelineConfigMap.module.db, + CHANGE_ID: changeId, + SUFFIX: `-build-${changeId}`, + INSTANCE: `${pipelineConfigMap.module.db}-build-${changeId}`, + VERSION: `${pipelineConfigMap.version}-${changeId}`, + TAG: `build-${pipelineConfigMap.version}-${changeId}`, + BRANCH: options.git.ref }, deploy: { ...pipelineConfigMap.database.pr.deploy, - name: pipelineConfigMap.module.db, - changeId: changeId, - suffix: `-dev-${changeId}`, - instance: `${pipelineConfigMap.module.db}-pr-${changeId}`, - version: `pr-${changeId}`, - tag: `dev-${pipelineConfigMap.version}-${changeId}` + NAME: pipelineConfigMap.module.db, + CHANGE_ID: changeId, + SUFFIX: `-dev-${changeId}`, + INSTANCE: `${pipelineConfigMap.module.db}-pr-${changeId}`, + VERSION: `pr-${changeId}`, + TAG: `dev-${pipelineConfigMap.version}-${changeId}` } }, dev: { build: { ...pipelineConfigMap.database.dev.build, - name: pipelineConfigMap.module.db, - changeId: changeId, - suffix: `-build-${changeId}`, - instance: `${pipelineConfigMap.module.db}-build-${changeId}`, - version: `${pipelineConfigMap.version}-${changeId}`, - tag: `build-${pipelineConfigMap.version}-${changeId}-${branch}`, - branch: branch + NAME: pipelineConfigMap.module.db, + CHANGE_ID: changeId, + SUFFIX: `-build-${changeId}`, + INSTANCE: `${pipelineConfigMap.module.db}-build-${changeId}`, + VERSION: `${pipelineConfigMap.version}-${changeId}`, + TAG: `build-${pipelineConfigMap.version}-${changeId}-${branch}`, + BRANCH: branch }, deploy: { ...pipelineConfigMap.database.dev.deploy, - name: pipelineConfigMap.module.db, - changeId: 'deploy', - suffix: `-dev-deploy`, - instance: `${pipelineConfigMap.module.db}-dev-deploy`, - version: `deploy-${changeId}`, - tag: `dev-${pipelineConfigMap.version}-deploy` + NAME: pipelineConfigMap.module.db, + CHANGE_ID: 'deploy', + SUFFIX: `-dev-deploy`, + INSTANCE: `${pipelineConfigMap.module.db}-dev-deploy`, + VERSION: `deploy-${changeId}`, + TAG: `dev-${pipelineConfigMap.version}-deploy` } }, test: { build: { ...pipelineConfigMap.database.test.build, - name: pipelineConfigMap.module.db, - changeId: changeId, - suffix: `-build-${changeId}`, - instance: `${pipelineConfigMap.module.db}-build-${changeId}`, - version: `${pipelineConfigMap.version}-${changeId}`, - tag: `build-${pipelineConfigMap.version}-${changeId}-${branch}`, - branch: branch + NAME: pipelineConfigMap.module.db, + CHANGE_ID: changeId, + SUFFIX: `-build-${changeId}`, + INSTANCE: `${pipelineConfigMap.module.db}-build-${changeId}`, + VERSION: `${pipelineConfigMap.version}-${changeId}`, + TAG: `build-${pipelineConfigMap.version}-${changeId}-${branch}`, + BRANCH: branch }, deploy: { ...pipelineConfigMap.database.test.deploy, - name: pipelineConfigMap.module.db, - changeId: 'deploy', - suffix: `-test`, - instance: `${pipelineConfigMap.module.db}-test`, - version: `deploy-${changeId}`, - tag: `test-${pipelineConfigMap.version}` + NAME: pipelineConfigMap.module.db, + CHANGE_ID: 'deploy', + SUFFIX: `-test`, + INSTANCE: `${pipelineConfigMap.module.db}-test`, + VERSION: `deploy-${changeId}`, + TAG: `test-${pipelineConfigMap.version}` } }, prod: { build: { ...pipelineConfigMap.database.prod.build, - name: pipelineConfigMap.module.db, - changeId: changeId, - suffix: `-build-${changeId}`, - instance: `${pipelineConfigMap.module.db}-build-${changeId}`, - version: `${pipelineConfigMap.version}-${changeId}`, - tag: `build-${pipelineConfigMap.version}-${changeId}-${branch}`, - branch: branch + NAME: pipelineConfigMap.module.db, + CHANGE_ID: changeId, + SUFFIX: `-build-${changeId}`, + INSTANCE: `${pipelineConfigMap.module.db}-build-${changeId}`, + VERSION: `${pipelineConfigMap.version}-${changeId}`, + TAG: `build-${pipelineConfigMap.version}-${changeId}-${branch}`, + BRANCH: branch }, deploy: { ...pipelineConfigMap.database.prod.deploy, - name: pipelineConfigMap.module.db, - changeId: 'deploy', - suffix: `-prod`, - instance: `${pipelineConfigMap.module.db}-prod`, - version: `deploy-${changeId}`, - tag: `prod-${pipelineConfigMap.version}` + NAME: pipelineConfigMap.module.db, + CHANGE_ID: 'deploy', + SUFFIX: `-prod`, + INSTANCE: `${pipelineConfigMap.module.db}-prod`, + VERSION: `deploy-${changeId}`, + TAG: `prod-${pipelineConfigMap.version}` } } }; diff --git a/database/.pipeline/lib/clean.js b/database/.pipeline/lib/clean.js index 78b87a80d3..2383dff20e 100644 --- a/database/.pipeline/lib/clean.js +++ b/database/.pipeline/lib/clean.js @@ -14,7 +14,7 @@ const clean = async (settings) => { const env = settings.options.env; const phase = settings.options.phase; - const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env].build.namespace }, options)); + const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env].build.NAMESPACE }, options)); if (!Object.prototype.hasOwnProperty.call(phases, env)) { // is not a field of phases @@ -28,8 +28,8 @@ const clean = async (settings) => { // Get build configs let buildConfigs = oc.get('bc', { - selector: `app=${phases[env][phase].instance},env-id=${phases[env][phase].changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, - namespace: phases[env][phase].namespace + selector: `app=${phases[env][phase].INSTANCE},env-id=${phases[env][phase].CHANGE_ID},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, + namespace: phases[env][phase].NAMESPACE }); // Clean build configs @@ -38,15 +38,15 @@ const clean = async (settings) => { oc.delete([`ImageStreamTag/${buildConfig.spec.output.to.name}`], { 'ignore-not-found': 'true', wait: 'true', - namespace: phases[env][phase].namespace + namespace: phases[env][phase].NAMESPACE }); } }); // get deployment configs let deploymentConfigs = oc.get('dc', { - selector: `app=${phases[env][phase].instance},env-id=${phases[env][phase].changeId},env-name=${env},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, - namespace: phases[env][phase].namespace + selector: `app=${phases[env][phase].INSTANCE},env-id=${phases[env][phase].CHANGE_ID},env-name=${env},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, + namespace: phases[env][phase].NAMESPACE }); // Clean deployment configs @@ -56,7 +56,7 @@ const clean = async (settings) => { oc.delete([`ImageStreamTag/${trigger.imageChangeParams.from.name}`], { 'ignore-not-found': 'true', wait: 'true', - namespace: phases[env][phase].namespace + namespace: phases[env][phase].NAMESPACE }); } }); @@ -64,23 +64,23 @@ const clean = async (settings) => { // Cleaning other pods if (phase !== 'build') { - const newOC = new OpenShiftClientX(Object.assign({ namespace: phases[env][phase].namespace }, options)); - const setupPod = `${phases[env][phase].name}-setup${phases[env][phase].suffix}`; + const newOC = new OpenShiftClientX(Object.assign({ namespace: phases[env][phase].NAMESPACE }, options)); + const setupPod = `${phases[env][phase].NAME}-setup${phases[env][phase].SUFFIX}`; await checkAndClean(`pod/${setupPod}`, 10, 5, 0, newOC).catch(() => { // Ignore errors, nothing to clean }); } oc.raw('delete', ['all'], { - selector: `app=${phases[env][phase].instance},env-id=${phases[env][phase].changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, + selector: `app=${phases[env][phase].INSTANCE},env-id=${phases[env][phase].CHANGE_ID},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, wait: 'true', - namespace: phases[env][phase].namespace + namespace: phases[env][phase].NAMESPACE }); oc.raw('delete', ['all,pvc,secrets,Secrets,secret,configmap,endpoints,Endpoints'], { - selector: `app=${phases[env][phase].instance},env-id=${phases[env][phase].changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, + selector: `app=${phases[env][phase].INSTANCE},env-id=${phases[env][phase].CHANGE_ID},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, wait: 'true', - namespace: phases[env][phase].namespace + namespace: phases[env][phase].NAMESPACE }); }; diff --git a/database/.pipeline/lib/db.build.js b/database/.pipeline/lib/db.build.js index 0dc99f86de..0b4373f9ef 100644 --- a/database/.pipeline/lib/db.build.js +++ b/database/.pipeline/lib/db.build.js @@ -14,7 +14,7 @@ const dbBuild = (settings) => { const env = settings.options.env; const phase = settings.options.phase; - const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env][phase].namespace }, options)); + const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env][phase].NAMESPACE }, options)); const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, '../templates')); @@ -23,14 +23,20 @@ const dbBuild = (settings) => { objects.push( ...oc.processDeploymentTemplate(`${templatesLocalBaseUrl}/db.bc.yaml`, { param: { - NAME: phases[env][phase].name, - SUFFIX: phases[env][phase].suffix, - TAG_NAME: phases[env][phase].tag + NAME: phases[env][phase].NAME, + SUFFIX: phases[env][phase].SUFFIX, + TAG_NAME: phases[env][phase].TAG } }) ); - oc.applyRecommendedLabels(objects, phases[env][phase].name, env, phases[env][phase].changeId, phases[env][phase].instance); + oc.applyRecommendedLabels( + objects, + phases[env][phase].NAME, + env, + phases[env][phase].CHANGE_ID, + phases[env][phase].INSTANCE + ); oc.applyAndBuild(objects); }; diff --git a/database/.pipeline/lib/db.deploy.js b/database/.pipeline/lib/db.deploy.js index 05626d2aec..4cf7697d97 100644 --- a/database/.pipeline/lib/db.deploy.js +++ b/database/.pipeline/lib/db.deploy.js @@ -15,41 +15,41 @@ const dbDeploy = async (settings) => { const env = settings.options.env; const phase = settings.options.phase; - const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env][phase].namespace }, options)); + const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env][phase].NAMESPACE }, options)); const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, '../templates')); - const name = `${phases[env][phase].name}`; - const instance = `${phases[env][phase].instance}`; - const changeId = `${phases[env][phase].changeId}`; + const NAME = `${phases[env][phase].NAME}`; + const INSTANCE = `${phases[env][phase].INSTANCE}`; + const CHANGE_ID = `${phases[env][phase].CHANGE_ID}`; const objects = []; objects.push( ...oc.processDeploymentTemplate(`${templatesLocalBaseUrl}/db.dc.yaml`, { param: { - NAME: name, - DATABASE_SERVICE_NAME: `${name}-postgresql${phases[env][phase].suffix}`, - IMAGE_STREAM_NAME: name, - IMAGE_STREAM_VERSION: phases[env].build.tag, + NAME: NAME, + DATABASE_SERVICE_NAME: `${NAME}-postgresql${phases[env][phase].SUFFIX}`, + IMAGE_STREAM_NAME: NAME, + IMAGE_STREAM_VERSION: phases[env].build.TAG, POSTGRESQL_DATABASE: 'biohubbc', - TZ: phases[env][phase].tz, - IMAGE_STREAM_NAMESPACE: phases[env].build.namespace, - VOLUME_CAPACITY: phases[env][phase].volumeCapacity, + TZ: phases[env][phase].TZ, + IMAGE_STREAM_NAMESPACE: phases[env].build.NAMESPACE, + VOLUME_CAPACITY: phases[env][phase].VOLUME_CAPACITY, // Openshift Resources - CPU_REQUEST: phases[env][phase].cpuRequest, - CPU_LIMIT: phases[env][phase].cpuLimit, - MEMORY_REQUEST: phases[env][phase].memoryRequest, - MEMORY_LIMIT: phases[env][phase].memoryLimit, - REPLICAS: phases[env][phase].replicas + CPU_REQUEST: phases[env][phase].CPU_REQUEST, + CPU_LIMIT: phases[env][phase].CPU_LIMIT, + MEMORY_REQUEST: phases[env][phase].MEMORY_REQUEST, + MEMORY_LIMIT: phases[env][phase].MEMORY_LIMIT, + REPLICAS: phases[env][phase].REPLICAS } }) ); - oc.applyRecommendedLabels(objects, name, env, changeId, instance); - oc.importImageStreams(objects, phases[env][phase].tag, phases[env].build.namespace, phases[env].build.tag); + oc.applyRecommendedLabels(objects, NAME, env, CHANGE_ID, INSTANCE); + oc.importImageStreams(objects, phases[env][phase].TAG, phases[env].build.NAMESPACE, phases[env].build.TAG); - await oc.applyAndDeploy(objects, instance); + await oc.applyAndDeploy(objects, INSTANCE); }; module.exports = { dbDeploy }; diff --git a/database/.pipeline/lib/db.setup.build.js b/database/.pipeline/lib/db.setup.build.js index e5dae3f890..d287f5baa2 100644 --- a/database/.pipeline/lib/db.setup.build.js +++ b/database/.pipeline/lib/db.setup.build.js @@ -14,33 +14,33 @@ const dbSetupBuild = (settings) => { const env = settings.options.env; const phase = settings.options.phase; - const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env][phase].namespace }, options)); + const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env][phase].NAMESPACE }, options)); const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, '../templates')); - const name = `${phases[env][phase].name}-setup`; + const NAME = `${phases[env][phase].NAME}-setup`; const objects = []; objects.push( ...oc.processDeploymentTemplate(`${templatesLocalBaseUrl}/db.setup.bc.yaml`, { param: { - NAME: name, - SUFFIX: phases[env][phase].suffix, - VERSION: phases[env][phase].tag, - // SOURCE_CONTEXT_DIR: phases[env][phase].sourceContextDir, - DB_SETUP_DOCKERFILE_PATH: phases[env][phase].dbSetupDockerfilePath, + NAME: NAME, + SUFFIX: phases[env][phase].SUFFIX, + VERSION: phases[env][phase].TAG, + SOURCE_CONTEXT_DIR: phases[env][phase].SOURCE_CONTEXT_DIR, + DB_SETUP_DOCKERFILE_PATH: phases[env][phase].DB_SETUP_DOCKERFILE_PATH, SOURCE_REPOSITORY_URL: oc.git.http_url, - SOURCE_REPOSITORY_REF: phases[env][phase].branch, - CPU_REQUEST: phases[env][phase].cpuRequest, - CPU_LIMIT: phases[env][phase].cpuLimit, - MEMORY_REQUEST: phases[env][phase].memoryRequest, - MEMORY_LIMIT: phases[env][phase].memoryLimit + SOURCE_REPOSITORY_REF: phases[env][phase].BRANCH, + CPU_REQUEST: phases[env][phase].CPU_REQUEST, + CPU_LIMIT: phases[env][phase].CPU_LIMIT, + MEMORY_REQUEST: phases[env][phase].MEMORY_REQUEST, + MEMORY_LIMIT: phases[env][phase].MEMORY_LIMIT } }) ); - oc.applyRecommendedLabels(objects, name, env, phases[env][phase].changeId, phases[env][phase].instance); + oc.applyRecommendedLabels(objects, NAME, env, phases[env][phase].CHANGE_ID, phases[env][phase].INSTANCE); oc.applyAndBuild(objects); }; diff --git a/database/.pipeline/lib/db.setup.deploy.js b/database/.pipeline/lib/db.setup.deploy.js index ae40e31313..956c9d11f8 100644 --- a/database/.pipeline/lib/db.setup.deploy.js +++ b/database/.pipeline/lib/db.setup.deploy.js @@ -17,16 +17,16 @@ const dbSetupDeploy = async (settings) => { const env = settings.options.env; const phase = settings.options.phase; - const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env][phase].namespace }, options)); + const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env][phase].NAMESPACE }, options)); const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, '../templates')); - const changeId = phases[env][phase].changeId; - const isName = `${phases[env][phase].name}-setup`; - const instance = `${isName}-${changeId}`; - const isVersion = `${phases[env][phase].tag}-setup`; + const CHANGE_ID = phases[env][phase].CHANGE_ID; + const isName = `${phases[env][phase].NAME}-setup`; + const INSTANCE = `${isName}-${CHANGE_ID}`; + const isVersion = `${phases[env][phase].TAG}-setup`; const imageStreamName = `${isName}:${isVersion}`; - const dbName = `${phases[env][phase].name}-postgresql${phases[env][phase].suffix}`; + const DB_NAME = `${phases[env][phase].NAME}-postgresql${phases[env][phase].SUFFIX}`; const objects = []; const imageStreamObjects = []; @@ -45,8 +45,8 @@ const dbSetupDeploy = async (settings) => { }) ); - oc.applyRecommendedLabels(imageStreamObjects, isName, env, changeId, instance); - oc.importImageStreams(imageStreamObjects, isVersion, phases[env].build.namespace, phases[env].build.tag); + oc.applyRecommendedLabels(imageStreamObjects, isName, env, CHANGE_ID, INSTANCE); + oc.importImageStreams(imageStreamObjects, isVersion, phases[env].build.NAMESPACE, phases[env].build.TAG); // Get database setup image stream const fetchedImageStreams = oc.get(`istag/${imageStreamName}`) || []; @@ -58,41 +58,41 @@ const dbSetupDeploy = async (settings) => { const dbSetupImageStream = fetchedImageStreams[0]; - const name = `${isName}${phases[env][phase].suffix}`; + const NAME = `${isName}${phases[env][phase].SUFFIX}`; objects.push( ...oc.processDeploymentTemplate(`${templatesLocalBaseUrl}/db.setup.dc.yaml`, { param: { - NAME: name, - SUFFIX: phases[env][phase].suffix, - VERSION: phases[env][phase].tag, - CHANGE_ID: changeId, - NODE_ENV: phases[env][phase].nodeEnv, - DB_SERVICE_NAME: dbName, + NAME: NAME, + SUFFIX: phases[env][phase].SUFFIX, + VERSION: phases[env][phase].TAG, + CHANGE_ID: CHANGE_ID, + NODE_ENV: phases[env][phase].NODE_ENV, + DB_SERVICE_NAME: DB_NAME, DB_SCHEMA: 'biohub', DB_SCHEMA_DAPI_V1: 'biohub_dapi_v1', IMAGE: dbSetupImageStream.image.dockerImageReference, // Development Seeding - PROJECT_SEEDER_USER_IDENTIFIER: phases[env][phase].projectSeederUserIdentifier, - NUM_SEED_PROJECTS: phases[env][phase].numSeedProjects, - NUM_SEED_SURVEYS_PER_PROJECT: phases[env][phase].numSeedSurveysPerProject, + PROJECT_SEEDER_USER_IDENTIFIER: phases[env][phase].PROJECT_SEEDER_USER_IDENTIFIER, + NUM_SEED_PROJECTS: phases[env][phase].NUM_SEED_PROJECTS, + NUM_SEED_SURVEYS_PER_PROJECT: phases[env][phase].NUM_SEED_SURVEYS_PER_PROJECT, // Openshift Resources - CPU_REQUEST: phases[env][phase].cpuRequest, - CPU_LIMIT: phases[env][phase].cpuLimit, - MEMORY_REQUEST: phases[env][phase].memoryRequest, - MEMORY_LIMIT: phases[env][phase].memoryLimit + CPU_REQUEST: phases[env][phase].CPU_REQUEST, + CPU_LIMIT: phases[env][phase].CPU_LIMIT, + MEMORY_REQUEST: phases[env][phase].MEMORY_REQUEST, + MEMORY_LIMIT: phases[env][phase].MEMORY_LIMIT } }) ); // Clean existing setup pod - await checkAndClean(`pod/${name}`, 10, 5, 0, oc).catch(() => { + await checkAndClean(`pod/${NAME}`, 10, 5, 0, oc).catch(() => { // Ignore errors, nothing to clean }); // Wait to confirm if the db pod deployed successfully await waitForResourceToMeetCondition( - () => getResourceByRaw(`name=${dbName}`, 'pod', settings, oc), + () => getResourceByRaw(`name=${DB_NAME}`, 'pod', settings, oc), isResourceRunning, 30, 5, @@ -100,11 +100,11 @@ const dbSetupDeploy = async (settings) => { ); // Deploy the db setup pod - oc.applyRecommendedLabels(objects, isName, env, changeId, instance); - await oc.applyAndDeploy(objects, phases[env][phase].instance); + oc.applyRecommendedLabels(objects, isName, env, CHANGE_ID, INSTANCE); + await oc.applyAndDeploy(objects, phases[env][phase].INSTANCE); // Wait to confirm if the db setup pod deployed successfully - await waitForResourceToMeetCondition(() => getResourceByName(`pod/${name}`, oc), isResourceComplete, 30, 5, 0); + await waitForResourceToMeetCondition(() => getResourceByName(`pod/${NAME}`, oc), isResourceComplete, 30, 5, 0); }; module.exports = { dbSetupDeploy }; diff --git a/database/.pipeline/package-lock.json b/database/.pipeline/package-lock.json index 83751a9d58..299ead87cb 100644 --- a/database/.pipeline/package-lock.json +++ b/database/.pipeline/package-lock.json @@ -4,12 +4,1205 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true + }, + "@babel/code-frame": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", + "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "dev": true + }, + "@babel/highlight": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", + "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true + } + } + }, + "@eslint/eslintrc": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", + "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^13.9.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + } + }, + "@humanwhocodes/config-array": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", + "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "dev": true, + "requires": { + "@humanwhocodes/object-schema": "^1.2.0", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + } + }, + "@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true + }, + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true + }, + "acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "array-buffer-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", + "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", + "dev": true, + "requires": { + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" + } + }, + "arraybuffer.prototype.slice": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", + "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", + "dev": true, + "requires": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.2.1", + "get-intrinsic": "^1.2.3", + "is-array-buffer": "^3.0.4", + "is-shared-array-buffer": "^1.0.2" + } + }, + "astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true + }, + "available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "requires": { + "possible-typed-array-names": "^1.0.0" + } + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dev": true, + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + } + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "dev": true, + "requires": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + } + }, + "data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + } + }, + "data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "dev": true, + "requires": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + } + }, "debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "requires": { - "ms": "2.1.2" + "ms": "2.1.2" + } + }, + "deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + } + }, + "define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "requires": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + } + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "enquirer": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", + "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1", + "strip-ansi": "^6.0.1" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.22.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.5.tgz", + "integrity": "sha512-oW69R+4q2wG+Hc3KZePPZxOiisRIqfKBVo/HLx94QcJeWGU/8sZhCvc829rd1kS366vlJbzBfXf9yWwf0+Ko7w==", + "dev": true, + "requires": { + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-set-tostringtag": "^2.0.3", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", + "has-symbols": "^1.0.3", + "hasown": "^2.0.1", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", + "is-callable": "^1.2.7", + "is-negative-zero": "^2.0.3", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.3", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.13", + "is-weakref": "^1.0.2", + "object-inspect": "^1.13.1", + "object-keys": "^1.1.1", + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.0", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.8", + "string.prototype.trimend": "^1.0.7", + "string.prototype.trimstart": "^1.0.7", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.5", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.14" + } + }, + "es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "requires": { + "get-intrinsic": "^1.2.4" + } + }, + "es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true + }, + "es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "requires": { + "es-errors": "^1.3.0" + } + }, + "es-set-tostringtag": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", + "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", + "dev": true, + "requires": { + "get-intrinsic": "^1.2.4", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "eslint": { + "version": "7.32.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", + "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", + "dev": true, + "requires": { + "@babel/code-frame": "7.12.11", + "@eslint/eslintrc": "^0.4.3", + "@humanwhocodes/config-array": "^0.5.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.1", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.1.2", + "globals": "^13.6.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^6.0.9", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + } + }, + "eslint-config-prettier": { + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.15.0.tgz", + "integrity": "sha512-a1+kOYLR8wMGustcgAjdydMsQ2A/2ipRPwRKUmfYaSxc9ZPcrku080Ctl6zrZzZNs/U82MjSv+qKREkoq3bJaw==", + "dev": true, + "requires": { + "get-stdin": "^6.0.0" + } + }, + "eslint-plugin-prettier": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.3.1.tgz", + "integrity": "sha512-Rq3jkcFY8RYeQLgk2cCwuc0P7SEFwDravPhsJZOQ5N4YI4DSg50NyqJ/9gdZHzQlHf8MvafSesbNJCcP/FF6pQ==", + "dev": true, + "requires": { + "prettier-linter-helpers": "^1.0.0" + } + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } + } + }, + "eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true + }, + "espree": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", + "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "dev": true, + "requires": { + "acorn": "^7.4.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^1.3.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + } + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "requires": { + "flat-cache": "^3.0.4" + } + }, + "flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "requires": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + } + }, + "flatted": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "dev": true + }, + "for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "requires": { + "is-callable": "^1.1.3" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true + }, + "function.prototype.name": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" + } + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", + "dev": true + }, + "functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true + }, + "get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + } + }, + "get-stdin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "dev": true + }, + "get-symbol-description": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", + "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", + "dev": true, + "requires": { + "call-bind": "^1.0.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4" + } + }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + } + }, + "globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3" + } + }, + "gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.3" + } + }, + "graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "requires": { + "es-define-property": "^1.0.0" + } + }, + "has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "dev": true + }, + "has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true + }, + "has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "requires": { + "has-symbols": "^1.0.3" + } + }, + "hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "requires": { + "function-bind": "^1.1.2" + } + }, + "hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "internal-slot": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", + "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "hasown": "^2.0.0", + "side-channel": "^1.0.4" + } + }, + "is-array-buffer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", + "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1" + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, + "is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "requires": { + "has-bigints": "^1.0.1" + } + }, + "is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + } + }, + "is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true + }, + "is-core-module": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "dev": true, + "requires": { + "hasown": "^2.0.0" + } + }, + "is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "dev": true, + "requires": { + "is-typed-array": "^1.1.13" + } + }, + "is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-negative-zero": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", + "dev": true + }, + "is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + } + }, + "is-shared-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", + "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", + "dev": true, + "requires": { + "call-bind": "^1.0.7" + } + }, + "is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, + "requires": { + "has-symbols": "^1.0.2" + } + }, + "is-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "dev": true, + "requires": { + "which-typed-array": "^1.1.14" + } + }, + "is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2" + } + }, + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "requires": { + "json-buffer": "3.0.1" + } + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" } }, "lodash.isempty": { @@ -32,11 +1225,269 @@ "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "lodash.truncate": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", + "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", + "dev": true + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", + "dev": true + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true + } + } + }, + "npm-run-all": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz", + "integrity": "sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "chalk": "^2.4.1", + "cross-spawn": "^6.0.5", + "memorystream": "^0.3.1", + "minimatch": "^3.0.4", + "pidtree": "^0.3.0", + "read-pkg": "^3.0.0", + "shell-quote": "^1.6.1", + "string.prototype.padend": "^3.0.0" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "dev": true + }, + "semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "dev": true + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "object-inspect": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "dev": true + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object.assign": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "optionator": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "dev": true, + "requires": { + "@aashutoshrathi/word-wrap": "^1.2.3", + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0" + } + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "pidtree": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.1.tgz", + "integrity": "sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==", + "dev": true + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "dev": true + }, "pipeline-cli": { "version": "git+https://github.com/bcgov/biohubbc-pipeline-cli.git#61b44543041da3697d189beb2472539fe2e099c1", "from": "git+https://github.com/bcgov/biohubbc-pipeline-cli.git", @@ -48,11 +1499,615 @@ "lodash.isstring": "^4.0.1" } }, + "possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "dev": true + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, "prettier": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz", "integrity": "sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==", "dev": true + }, + "prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "requires": { + "fast-diff": "^1.1.2" + } + }, + "prettier-plugin-organize-imports": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-2.3.4.tgz", + "integrity": "sha512-R8o23sf5iVL/U71h9SFUdhdOEPsi3nm42FD/oDYIZ2PQa4TNWWuWecxln6jlIQzpZTDMUeO1NicJP6lLn2TtRw==", + "dev": true + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==", + "dev": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + }, + "regexp.prototype.flags": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", + "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", + "dev": true, + "requires": { + "call-bind": "^1.0.6", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.1" + } + }, + "regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true + }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true + }, + "resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "requires": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "safe-array-concat": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + } + }, + "safe-regex-test": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", + "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", + "dev": true, + "requires": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-regex": "^1.1.4" + } + }, + "semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "requires": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + } + }, + "set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "requires": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "shell-quote": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", + "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", + "dev": true + }, + "side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + } + }, + "slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + } + } + }, + "spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.17.tgz", + "integrity": "sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg==", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "string.prototype.padend": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.5.tgz", + "integrity": "sha512-DOB27b/2UTTD+4myKUFh+/fXWcu/UDyASIXfg+7VzoCNNGOfWvoyU/x5pvVHr++ztyt/oSYI1BcWBBG/hmlNjA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + } + }, + "string.prototype.trim": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" + }, + "dependencies": { + "es-abstract": { + "version": "1.23.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.2.tgz", + "integrity": "sha512-60s3Xv2T2p1ICykc7c+DNDPLDMm9t4QxCOUU0K9JxiLjM3C1zB9YVdN7tjxrFd4+AkZ8CdX1ovUga4P2+1e+/w==", + "dev": true, + "requires": { + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.0.3", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", + "has-symbols": "^1.0.3", + "hasown": "^2.0.2", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.1", + "is-negative-zero": "^2.0.3", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.3", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.13", + "is-weakref": "^1.0.2", + "object-inspect": "^1.13.1", + "object-keys": "^1.1.1", + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.2", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", + "string.prototype.trimstart": "^1.0.7", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.5", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.15" + } + } + } + }, + "string.prototype.trimend": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + } + }, + "string.prototype.trimstart": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz", + "integrity": "sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true + }, + "table": { + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/table/-/table-6.8.1.tgz", + "integrity": "sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==", + "dev": true, + "requires": { + "ajv": "^8.0.1", + "lodash.truncate": "^4.4.2", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1" + }, + "dependencies": { + "ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + } + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true + }, + "typed-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", + "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.13" + } + }, + "typed-array-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", + "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + } + }, + "typed-array-byte-offset": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", + "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + } + }, + "typed-array-length": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.5.tgz", + "integrity": "sha512-yMi0PlwuznKHxKmcpoOdeLwxBoVPkqZxd7q2FgMkmD3bNwvF5VW0+UlUQ1k1vmktTu4Yu13Q0RIxEP8+B+wloA==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0" + } + }, + "unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + } + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "v8-compile-cache": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz", + "integrity": "sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw==", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "requires": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + } + }, + "which-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true } } } diff --git a/database/.pipeline/package.json b/database/.pipeline/package.json index 2f88bbbd01..da182b9607 100644 --- a/database/.pipeline/package.json +++ b/database/.pipeline/package.json @@ -20,7 +20,8 @@ "lint": "eslint . --ignore-pattern 'node_modules' --ext .js,.ts", "lint-fix": "eslint . --fix --ignore-pattern 'node_modules' --ext .js,.ts", "format": "prettier --check \"./**/*.{js,jsx,ts,tsx,css,scss}\"", - "format-fix": "prettier --write \"./**/*.{js,jsx,ts,tsx,json,css,scss}\"" + "format-fix": "prettier --write \"./**/*.{js,jsx,ts,tsx,json,css,scss}\"", + "fix": "npm-run-all -l -s lint-fix format-fix" }, "dependencies": { "debug": "^4.2.0", @@ -31,6 +32,11 @@ "pipeline-cli": "git+https://github.com/bcgov/biohubbc-pipeline-cli.git" }, "devDependencies": { - "prettier": "~2.3.2" + "eslint": "~7.32.0", + "eslint-config-prettier": "~6.15.0", + "eslint-plugin-prettier": "~3.3.1", + "npm-run-all": "~4.1.5", + "prettier": "^2.3.2", + "prettier-plugin-organize-imports": "~2.3.4" } } diff --git a/database/.pipeline/utils/utils.js b/database/.pipeline/utils/utils.js index 9dc831e507..33ef2a2343 100644 --- a/database/.pipeline/utils/utils.js +++ b/database/.pipeline/utils/utils.js @@ -86,7 +86,7 @@ const getResourceByRaw = (selector, type, settings, oc) => { const result = oc.raw('get', [type], { selector: selector, output: 'json', - namespace: phases[env][phase].namespace + namespace: phases[env][phase].NAMESPACE }); if (!result.stdout || !result.stdout.trim()) { @@ -280,23 +280,23 @@ const waitForResourceToMeetCondition = async ( try { resource = getResourceFunction(); - } catch { + } catch (_) { console.debug(`2 - waitForResourceToMeetCondition - Resource was not found`); return retry(); } - if (!resource) { - console.debug(`3 - waitForResourceToMeetCondition - Resource was not found`); - return retry(); - } - try { + if (!resource) { + console.debug(`3 - waitForResourceToMeetCondition - Resource was not found`); + return retry(); + } + const isConditionMet = resourceConditionFunction(resource); if (!isConditionMet) { return retry(); } - } catch { + } catch (_) { console.error(`6 - waitForResourceToMeetCondition - Error: waiting for resource failed`); throw new Error(`6 - waitForResourceToMeetCondition - Error: waiting for resource failed`); } @@ -336,16 +336,16 @@ const checkAndClean = async (resourceName, numberOfRetries, timeoutBetweenRetrie const check = async () => { console.debug(`1 - checkAndClean - Waiting for resource begin`); - try { - let resource; + let resource; - try { - resource = getResourceByName(resourceName, oc); - } catch { - console.debug(`2 - checkAndClean - Resource was not found`); - return retry(); - } + try { + resource = getResourceByName(resourceName, oc); + } catch (_) { + console.debug(`2 - checkAndClean - Resource was not found`); + return retry(); + } + try { if (!resource) { console.debug(`3 - checkAndClean - Resource was not found`); return retry(); @@ -353,7 +353,7 @@ const checkAndClean = async (resourceName, numberOfRetries, timeoutBetweenRetrie console.debug(`4 - checkAndClean - Deleting resource: ${resourceName}`); deleteResourceByName(resourceName, oc); - } catch { + } catch (_) { console.error(`7 - checkAndClean - Error: waiting for resource failed`); throw new Error(`7 - checkAndClean - Error: waiting for resource failed`); } From fa2c414bf51c1e2c524f26bce17d8bd187c9c8ac Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Mon, 18 Mar 2024 13:16:35 -0700 Subject: [PATCH 53/62] ignore-skip From 4ec9e8b465b083692a685b2c85bdb544e254886e Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Mon, 18 Mar 2024 13:16:59 -0700 Subject: [PATCH 54/62] Minor cleanup. ignore-skip --- api/.pipeline/lib/api.deploy.js | 4 ++-- api/.pipeline/lib/clean.js | 2 +- app/.pipeline/lib/app.deploy.js | 4 ++-- app/.pipeline/lib/clean.js | 2 +- database/.pipeline/lib/clean.js | 2 +- database/.pipeline/lib/db.deploy.js | 6 +++--- database/.pipeline/lib/db.setup.deploy.js | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/api/.pipeline/lib/api.deploy.js b/api/.pipeline/lib/api.deploy.js index 2abe3890bc..e05d92a7e7 100644 --- a/api/.pipeline/lib/api.deploy.js +++ b/api/.pipeline/lib/api.deploy.js @@ -29,7 +29,7 @@ const apiDeploy = async (settings) => { VERSION: phases[env][phase].TAG, API_HOST: phases[env][phase].API_HOST, APP_HOST: phases[env][phase].APP_HOST, - CHANGE_ID: phases[env].build.CHANGE_ID || phases[env][phase].CHANGE_ID, + CHANGE_ID: phases[env]['build'].CHANGE_ID, // Node NODE_ENV: phases[env][phase].NODE_ENV, NODE_OPTIONS: phases[env][phase].NODE_OPTIONS, @@ -85,7 +85,7 @@ const apiDeploy = async (settings) => { phases[env][phase].CHANGE_ID, phases[env][phase].INSTANCE ); - oc.importImageStreams(objects, phases[env][phase].TAG, phases[env].build.NAMESPACE, phases[env].build.TAG); + oc.importImageStreams(objects, phases[env][phase].TAG, phases[env]['build'].NAMESPACE, phases[env]['build'].TAG); await oc.applyAndDeploy(objects, phases[env][phase].INSTANCE); }; diff --git a/api/.pipeline/lib/clean.js b/api/.pipeline/lib/clean.js index 35389eca93..7e42b13768 100644 --- a/api/.pipeline/lib/clean.js +++ b/api/.pipeline/lib/clean.js @@ -13,7 +13,7 @@ const clean = async (settings) => { const env = settings.options.env; const phase = settings.options.phase; - const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env].build.NAMESPACE }, options)); + const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env]['build'].NAMESPACE }, options)); if (!Object.prototype.hasOwnProperty.call(phases, env)) { // is not a field of phases diff --git a/app/.pipeline/lib/app.deploy.js b/app/.pipeline/lib/app.deploy.js index e9dbbf0a4a..c5380277ec 100644 --- a/app/.pipeline/lib/app.deploy.js +++ b/app/.pipeline/lib/app.deploy.js @@ -22,7 +22,7 @@ const appDeploy = async (settings) => { SUFFIX: phases[env][phase].SUFFIX, VERSION: phases[env][phase].TAG, APP_HOST: phases[env][phase].APP_HOST, - CHANGE_ID: phases[env].build.CHANGE_ID || phases[env][phase].CHANGE_ID, + CHANGE_ID: phases[env]['build'].CHANGE_ID, REACT_APP_API_HOST: phases[env][phase].API_HOST, REACT_APP_SITEMINDER_LOGOUT_URL: phases[env][phase].SITEMINDER_LOGOUT_URL, // File Upload Settings @@ -58,7 +58,7 @@ const appDeploy = async (settings) => { phases[env][phase].CHANGE_ID, phases[env][phase].INSTANCE ); - oc.importImageStreams(objects, phases[env][phase].TAG, phases[env].build.NAMESPACE, phases[env].build.TAG); + oc.importImageStreams(objects, phases[env][phase].TAG, phases[env]['build'].NAMESPACE, phases[env]['build'].TAG); await oc.applyAndDeploy(objects, phases[env][phase].INSTANCE); }; diff --git a/app/.pipeline/lib/clean.js b/app/.pipeline/lib/clean.js index 35389eca93..7e42b13768 100644 --- a/app/.pipeline/lib/clean.js +++ b/app/.pipeline/lib/clean.js @@ -13,7 +13,7 @@ const clean = async (settings) => { const env = settings.options.env; const phase = settings.options.phase; - const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env].build.NAMESPACE }, options)); + const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env]['build'].NAMESPACE }, options)); if (!Object.prototype.hasOwnProperty.call(phases, env)) { // is not a field of phases diff --git a/database/.pipeline/lib/clean.js b/database/.pipeline/lib/clean.js index 2383dff20e..69eb1768f5 100644 --- a/database/.pipeline/lib/clean.js +++ b/database/.pipeline/lib/clean.js @@ -14,7 +14,7 @@ const clean = async (settings) => { const env = settings.options.env; const phase = settings.options.phase; - const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env].build.NAMESPACE }, options)); + const oc = new OpenShiftClientX(Object.assign({ namespace: phases[env]['build'].NAMESPACE }, options)); if (!Object.prototype.hasOwnProperty.call(phases, env)) { // is not a field of phases diff --git a/database/.pipeline/lib/db.deploy.js b/database/.pipeline/lib/db.deploy.js index 4cf7697d97..98a174af7e 100644 --- a/database/.pipeline/lib/db.deploy.js +++ b/database/.pipeline/lib/db.deploy.js @@ -31,10 +31,10 @@ const dbDeploy = async (settings) => { NAME: NAME, DATABASE_SERVICE_NAME: `${NAME}-postgresql${phases[env][phase].SUFFIX}`, IMAGE_STREAM_NAME: NAME, - IMAGE_STREAM_VERSION: phases[env].build.TAG, + IMAGE_STREAM_VERSION: phases[env]['build'].TAG, POSTGRESQL_DATABASE: 'biohubbc', TZ: phases[env][phase].TZ, - IMAGE_STREAM_NAMESPACE: phases[env].build.NAMESPACE, + IMAGE_STREAM_NAMESPACE: phases[env]['build'].NAMESPACE, VOLUME_CAPACITY: phases[env][phase].VOLUME_CAPACITY, // Openshift Resources CPU_REQUEST: phases[env][phase].CPU_REQUEST, @@ -47,7 +47,7 @@ const dbDeploy = async (settings) => { ); oc.applyRecommendedLabels(objects, NAME, env, CHANGE_ID, INSTANCE); - oc.importImageStreams(objects, phases[env][phase].TAG, phases[env].build.NAMESPACE, phases[env].build.TAG); + oc.importImageStreams(objects, phases[env][phase].TAG, phases[env]['build'].NAMESPACE, phases[env]['build'].TAG); await oc.applyAndDeploy(objects, INSTANCE); }; diff --git a/database/.pipeline/lib/db.setup.deploy.js b/database/.pipeline/lib/db.setup.deploy.js index 956c9d11f8..aeceff6ca3 100644 --- a/database/.pipeline/lib/db.setup.deploy.js +++ b/database/.pipeline/lib/db.setup.deploy.js @@ -46,7 +46,7 @@ const dbSetupDeploy = async (settings) => { ); oc.applyRecommendedLabels(imageStreamObjects, isName, env, CHANGE_ID, INSTANCE); - oc.importImageStreams(imageStreamObjects, isVersion, phases[env].build.NAMESPACE, phases[env].build.TAG); + oc.importImageStreams(imageStreamObjects, isVersion, phases[env]['build'].NAMESPACE, phases[env]['build'].TAG); // Get database setup image stream const fetchedImageStreams = oc.get(`istag/${imageStreamName}`) || []; From c7ef3389ff273f7d82e4b75c25aa700b8e398aec Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Mon, 18 Mar 2024 14:12:22 -0700 Subject: [PATCH 55/62] Fix typo --- api/.pipeline/config.js | 8 ++++---- app/.pipeline/config.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/api/.pipeline/config.js b/api/.pipeline/config.js index 506acb37ee..7029bbd1c4 100644 --- a/api/.pipeline/config.js +++ b/api/.pipeline/config.js @@ -42,7 +42,7 @@ const phases = { TAG: `dev-${pipelineConfigMap.version}-${changeId}`, API_HOST: `${pipelineConfigMap.module.api}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, APP_HOST: `${pipelineConfigMap.module.app}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, - SSO: pipelineConfigMap.SSO.pr, + SSO: pipelineConfigMap.sso.pr, S3_KEY_PREFIX: `${pipelineConfigMap.S3_KEY_PREFIX}/${changeId}` } }, @@ -69,7 +69,7 @@ const phases = { TAG: `dev-${pipelineConfigMap.version}-deploy`, API_HOST: pipelineConfigMap.api.dev.deploy.API_HOST, APP_HOST: pipelineConfigMap.api.dev.deploy.APP_HOST, - SSO: pipelineConfigMap.SSO.dev + SSO: pipelineConfigMap.sso.dev } }, test: { @@ -95,7 +95,7 @@ const phases = { TAG: `test-${pipelineConfigMap.version}`, API_HOST: pipelineConfigMap.api.test.deploy.API_HOST, APP_HOST: pipelineConfigMap.api.test.deploy.APP_HOST, - SSO: pipelineConfigMap.SSO.test + SSO: pipelineConfigMap.sso.test } }, prod: { @@ -122,7 +122,7 @@ const phases = { TAG: `prod-${pipelineConfigMap.version}`, API_HOST: pipelineConfigMap.api.prod.deploy.API_HOST, APP_HOST: pipelineConfigMap.api.prod.deploy.APP_VANITY_URL, - SSO: pipelineConfigMap.SSO.prod + SSO: pipelineConfigMap.sso.prod } } }; diff --git a/app/.pipeline/config.js b/app/.pipeline/config.js index 4e452860c2..ffae133486 100644 --- a/app/.pipeline/config.js +++ b/app/.pipeline/config.js @@ -40,7 +40,7 @@ const phases = { TAG: `dev-${pipelineConfigMap.version}-${changeId}`, APP_HOST: `${pipelineConfigMap.module.app}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, API_HOST: `${pipelineConfigMap.module.api}-${changeId}-af2668-dev.apps.silver.devops.gov.bc.ca`, - SSO: pipelineConfigMap.SSO.pr + SSO: pipelineConfigMap.sso.pr } }, dev: { @@ -64,7 +64,7 @@ const phases = { TAG: `dev-${pipelineConfigMap.version}-deploy`, APP_HOST: pipelineConfigMap.app.dev.deploy.APP_HOST, API_HOST: pipelineConfigMap.app.dev.deploy.API_HOST, - SSO: pipelineConfigMap.SSO.dev + SSO: pipelineConfigMap.sso.dev } }, test: { @@ -88,7 +88,7 @@ const phases = { TAG: `test-${pipelineConfigMap.version}`, APP_HOST: pipelineConfigMap.app.test.deploy.APP_HOST, API_HOST: pipelineConfigMap.app.test.deploy.API_HOST, - SSO: pipelineConfigMap.SSO.test + SSO: pipelineConfigMap.sso.test } }, prod: { @@ -112,7 +112,7 @@ const phases = { TAG: `prod-${pipelineConfigMap.version}`, APP_HOST: pipelineConfigMap.app.prod.deploy.APP_HOST, API_HOST: pipelineConfigMap.app.prod.deploy.API_HOST, - SSO: pipelineConfigMap.SSO.prod + SSO: pipelineConfigMap.sso.prod } } }; From bdd2b7b53900a2eaac080c0b06ae3990f2224958 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Mon, 18 Mar 2024 15:23:59 -0700 Subject: [PATCH 56/62] Add more env vars to pipeline, rename some env vars. --- .pipeline/configMaps/sims.configmap.yaml | 64 +++++++++++++++---- api/.pipeline/lib/api.deploy.js | 9 +++ api/.pipeline/templates/api.dc.yaml | 16 ++--- app/.pipeline/lib/app.deploy.js | 3 +- app/.pipeline/templates/app.dc.yaml | 8 +-- .../templates/backup/backup-deploy.yaml | 12 ++-- database/.pipeline/lib/db.setup.deploy.js | 8 ++- database/.pipeline/templates/db.setup.dc.yaml | 26 +++++--- .../seeds/03_basic_project_survey_setup.ts | 24 +++---- docker-compose.yml | 21 +++--- env_config/env.docker | 10 +-- 11 files changed, 133 insertions(+), 68 deletions(-) diff --git a/.pipeline/configMaps/sims.configmap.yaml b/.pipeline/configMaps/sims.configmap.yaml index c146763c43..fbfcfe5b2f 100644 --- a/.pipeline/configMaps/sims.configmap.yaml +++ b/.pipeline/configMaps/sims.configmap.yaml @@ -41,10 +41,17 @@ data: "BACKBONE_INTAKE_ENABLED": true, "BCTW_API_HOST": "https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca", "CB_API_HOST": "https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api", + "OBJECT_STORE_SECRET": "biohubbc-object-store", + "MAX_REQ_BODY_SIZE": "52428800", + "MAX_UPLOAD_NUM_FILES": "10", + "MAX_UPLOAD_FILE_SIZE": "52428800", "S3_KEY_PREFIX": "sims-pr", "LOG_LEVEL": "debug", "API_RESPONSE_VALIDATION_ENABLED": true, "DATABASE_RESPONSE_VALIDATION_ENABLED": true, + "ENABLE_FILE_VIRUS_SCAN": true, + "CLAMAV_HOST": "clamav", + "CLAMAV_PORT": "3310", "NODE_OPTIONS": "--max_old_space_size=2250", "CPU_REQUEST": "50m", "CPU_LIMIT": "400m", @@ -77,10 +84,17 @@ data: "BACKBONE_INTAKE_ENABLED": true, "BCTW_API_HOST": "https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca", "CB_API_HOST": "https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api", + "OBJECT_STORE_SECRET": "biohubbc-object-store", + "MAX_REQ_BODY_SIZE": "52428800", + "MAX_UPLOAD_NUM_FILES": "10", + "MAX_UPLOAD_FILE_SIZE": "52428800", "S3_KEY_PREFIX": "sims", "LOG_LEVEL": "debug", "API_RESPONSE_VALIDATION_ENABLED": true, "DATABASE_RESPONSE_VALIDATION_ENABLED": true, + "ENABLE_FILE_VIRUS_SCAN": true, + "CLAMAV_HOST": "clamav", + "CLAMAV_PORT": "3310", "NODE_OPTIONS": "--max_old_space_size=2250", "CPU_REQUEST": "50m", "CPU_LIMIT": "600m", @@ -113,10 +127,17 @@ data: "BACKBONE_INTAKE_ENABLED": false, "BCTW_API_HOST": "https://moe-bctw-api-test.apps.silver.devops.gov.bc.ca", "CB_API_HOST": "https://moe-critterbase-api-test.apps.silver.devops.gov.bc.ca/api", + "OBJECT_STORE_SECRET": "biohubbc-object-store", + "MAX_REQ_BODY_SIZE": "52428800", + "MAX_UPLOAD_NUM_FILES": "10", + "MAX_UPLOAD_FILE_SIZE": "52428800", "S3_KEY_PREFIX": "sims", "LOG_LEVEL": "info", "API_RESPONSE_VALIDATION_ENABLED": true, "DATABASE_RESPONSE_VALIDATION_ENABLED": true, + "ENABLE_FILE_VIRUS_SCAN": true, + "CLAMAV_HOST": "clamav", + "CLAMAV_PORT": "3310", "NODE_OPTIONS": "--max_old_space_size=2250", "CPU_REQUEST": "50m", "CPU_LIMIT": "1000m", @@ -150,10 +171,17 @@ data: "BACKBONE_INTAKE_ENABLED": false, "BCTW_API_HOST": "https://moe-bctw-api-prod.apps.silver.devops.gov.bc.ca", "CB_API_HOST": "https://moe-critterbase-api-prod.apps.silver.devops.gov.bc.ca/api", + "OBJECT_STORE_SECRET": "biohubbc-object-store", + "MAX_REQ_BODY_SIZE": "52428800", + "MAX_UPLOAD_NUM_FILES": "10", + "MAX_UPLOAD_FILE_SIZE": "52428800", "S3_KEY_PREFIX": "sims", "LOG_LEVEL": "warn", "API_RESPONSE_VALIDATION_ENABLED": true, "DATABASE_RESPONSE_VALIDATION_ENABLED": true, + "ENABLE_FILE_VIRUS_SCAN": true, + "CLAMAV_HOST": "clamav", + "CLAMAV_PORT": "3310", "NODE_OPTIONS": "--max_old_space_size=2250", "CPU_REQUEST": "50m", "CPU_LIMIT": "1000m", @@ -177,6 +205,7 @@ data: "NAMESPACE": "af2668-dev", "NODE_ENV": "development", "SITEMINDER_LOGOUT_URL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", + "OBJECT_STORE_SECRET": "biohubbc-object-store", "MAX_UPLOAD_NUM_FILES": 10, "MAX_UPLOAD_FILE_SIZE": 52428800, "REACT_APP_BIOHUB_FEATURE_FLAG": "true", @@ -205,6 +234,7 @@ data: "API_HOST": "api-dev-biohubbc.apps.silver.devops.gov.bc.ca", "APP_HOST": "dev-biohubbc.apps.silver.devops.gov.bc.ca", "SITEMINDER_LOGOUT_URL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", + "OBJECT_STORE_SECRET": "biohubbc-object-store", "MAX_UPLOAD_NUM_FILES": 10, "MAX_UPLOAD_FILE_SIZE": 52428800, "REACT_APP_BIOHUB_FEATURE_FLAG": "true", @@ -233,6 +263,7 @@ data: "API_HOST": "api-test-biohubbc.apps.silver.devops.gov.bc.ca", "APP_HOST": "test-biohubbc.apps.silver.devops.gov.bc.ca", "SITEMINDER_LOGOUT_URL": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi", + "OBJECT_STORE_SECRET": "biohubbc-object-store", "MAX_UPLOAD_NUM_FILES": 10, "MAX_UPLOAD_FILE_SIZE": 52428800, "REACT_APP_BIOHUB_FEATURE_FLAG": "false", @@ -262,6 +293,7 @@ data: "APP_HOST": "biohubbc.apps.silver.devops.gov.bc.ca", "APP_VANITY_URL": "biohubbc.nrs.gov.bc.ca", "SITEMINDER_LOGOUT_URL": "https://logon7.gov.bc.ca/clp-cgi/logoff.cgi", + "OBJECT_STORE_SECRET": "biohubbc-object-store", "MAX_UPLOAD_NUM_FILES": 10, "MAX_UPLOAD_FILE_SIZE": 52428800, "REACT_APP_BIOHUB_FEATURE_FLAG": "false", @@ -293,9 +325,11 @@ data: "NAMESPACE": "af2668-dev", "NODE_ENV": "development", "TZ": "America/Vancouver", - "PROJECT_SEEDER_USER_IDENTIFIER": "1", - "NUM_SEED_PROJECTS": "2", - "NUM_SEED_SURVEYS_PER_PROJECT": "2", + "SEED_PROJECT_USER_IDENTIFIER": "1", + "SEED_NUM_PROJECTS": "2", + "SEED_NUM_SURVEYS_PER_PROJECT": "2", + "SEED_NUM_OBSERVATIONS_PER_SURVEY": "2", + "SEED_NUM_SUBCOUNTS_PER_OBSERVATION": "1", "VOLUME_CAPACITY": "500Mi", "CPU_REQUEST": "50m", "CPU_LIMIT": "400m", @@ -319,9 +353,11 @@ data: "NAMESPACE": "af2668-dev", "NODE_ENV": "development", "TZ": "America/Vancouver", - "PROJECT_SEEDER_USER_IDENTIFIER": "1", - "NUM_SEED_PROJECTS": "2", - "NUM_SEED_SURVEYS_PER_PROJECT": "2", + "SEED_PROJECT_USER_IDENTIFIER": "1", + "SEED_NUM_PROJECTS": "2", + "SEED_NUM_SURVEYS_PER_PROJECT": "2", + "SEED_NUM_OBSERVATIONS_PER_SURVEY": "2", + "SEED_NUM_SUBCOUNTS_PER_OBSERVATION": "1", "VOLUME_CAPACITY": "3Gi", "CPU_REQUEST": "50m", "CPU_LIMIT": "600m", @@ -345,9 +381,11 @@ data: "NAMESPACE": "af2668-test", "NODE_ENV": "production", "TZ": "America/Vancouver", - "PROJECT_SEEDER_USER_IDENTIFIER": "1", - "NUM_SEED_PROJECTS": "0", - "NUM_SEED_SURVEYS_PER_PROJECT": "0", + "SEED_PROJECT_USER_IDENTIFIER": "1", + "SEED_NUM_PROJECTS": "0", + "SEED_NUM_SURVEYS_PER_PROJECT": "0", + "SEED_NUM_OBSERVATIONS_PER_SURVEY": "0", + "SEED_NUM_SUBCOUNTS_PER_OBSERVATION": "0", "VOLUME_CAPACITY": "20Gi", "CPU_REQUEST": "50m", "CPU_LIMIT": "1000m", @@ -371,9 +409,11 @@ data: "NAMESPACE": "af2668-prod", "NODE_ENV": "production", "TZ": "America/Vancouver", - "PROJECT_SEEDER_USER_IDENTIFIER": "1", - "NUM_SEED_PROJECTS": "0", - "NUM_SEED_SURVEYS_PER_PROJECT": "0", + "SEED_PROJECT_USER_IDENTIFIER": "1", + "SEED_NUM_PROJECTS": "0", + "SEED_NUM_SURVEYS_PER_PROJECT": "0", + "SEED_NUM_OBSERVATIONS_PER_SURVEY": "0", + "SEED_NUM_SUBCOUNTS_PER_OBSERVATION": "0", "VOLUME_CAPACITY": "20Gi", "CPU_REQUEST": "50m", "CPU_LIMIT": "1000m", diff --git a/api/.pipeline/lib/api.deploy.js b/api/.pipeline/lib/api.deploy.js index e05d92a7e7..cedc9ad4d3 100644 --- a/api/.pipeline/lib/api.deploy.js +++ b/api/.pipeline/lib/api.deploy.js @@ -33,6 +33,10 @@ const apiDeploy = async (settings) => { // Node NODE_ENV: phases[env][phase].NODE_ENV, NODE_OPTIONS: phases[env][phase].NODE_OPTIONS, + // Clamav + ENABLE_FILE_VIRUS_SCAN: phases[env][phase].ENABLE_FILE_VIRUS_SCAN, + CLAMAV_HOST: phases[env][phase].CLAMAV_HOST, + CLAMAV_PORT: phases[env][phase].CLAMAV_PORT, // BioHub Platform (aka: Backbone) BACKBONE_INTERNAL_API_HOST: phases[env][phase].BACKBONE_INTERNAL_API_HOST, BACKBONE_INTAKE_PATH: phases[env][phase].BACKBONE_INTAKE_PATH, @@ -63,6 +67,11 @@ const apiDeploy = async (settings) => { KEYCLOAK_API_CLIENT_SECRET_KEY: phases[env][phase].SSO.cssApi.KEYCLOAK_API_CLIENT_SECRET_KEY, KEYCLOAK_API_HOST: phases[env][phase].SSO.cssApi.KEYCLOAK_API_HOST, KEYCLOAK_API_ENVIRONMENT: phases[env][phase].SSO.cssApi.KEYCLOAK_API_ENVIRONMENT, + // Object Store + OBJECT_STORE_SECRET: phases[env][phase].OBJECT_STORE_SECRET, + MAX_REQ_BODY_SIZE: phases[env][phase].MAX_REQ_BODY_SIZE, + MAX_UPLOAD_NUM_FILES: phases[env][phase].MAX_UPLOAD_NUM_FILES, + MAX_UPLOAD_FILE_SIZE: phases[env][phase].MAX_UPLOAD_FILE_SIZE, // Log Level LOG_LEVEL: phases[env][phase].LOG_LEVEL, API_RESPONSE_VALIDATION_ENABLED: phases[env][phase].API_RESPONSE_VALIDATION_ENABLED, diff --git a/api/.pipeline/templates/api.dc.yaml b/api/.pipeline/templates/api.dc.yaml index d469245eba..79bde3db51 100644 --- a/api/.pipeline/templates/api.dc.yaml +++ b/api/.pipeline/templates/api.dc.yaml @@ -87,14 +87,14 @@ parameters: required: true # Keycloak secret - name: KEYCLOAK_SECRET - description: The name of the keycloak secret + description: The name of the Openshift secret which contains the keycloak credentials. required: true # Keycloak Service Client - name: KEYCLOAK_ADMIN_USERNAME description: keycloak host admin username required: true - name: KEYCLOAK_SECRET_ADMIN_PASSWORD_KEY - description: The key of the admin password in the keycloak secret + description: The key of the admin password field in the Openshift keycloak secret required: true # Keycloak CSS API - name: KEYCLOAK_API_TOKEN_URL @@ -113,8 +113,8 @@ parameters: description: The css api environment to query (dev, test, prod) required: true # Object Store (S3) - - name: OBJECT_STORE_SECRETS - description: Secrets used to read and write to the S3 storage + - name: OBJECT_STORE_SECRET + description: The name of the Openshift secret which contains the object store credentials. value: 'biohubbc-object-store' - name: S3_KEY_PREFIX description: S3 key optional prefix @@ -308,22 +308,22 @@ objects: valueFrom: secretKeyRef: key: object_store_url - name: ${OBJECT_STORE_SECRETS} + name: ${OBJECT_STORE_SECRET} - name: OBJECT_STORE_ACCESS_KEY_ID valueFrom: secretKeyRef: key: object_store_access_key_id - name: ${OBJECT_STORE_SECRETS} + name: ${OBJECT_STORE_SECRET} - name: OBJECT_STORE_SECRET_KEY_ID valueFrom: secretKeyRef: key: object_store_secret_key_id - name: ${OBJECT_STORE_SECRETS} + name: ${OBJECT_STORE_SECRET} - name: OBJECT_STORE_BUCKET_NAME valueFrom: secretKeyRef: key: object_store_bucket_name - name: ${OBJECT_STORE_SECRETS} + name: ${OBJECT_STORE_SECRET} # Logging and Validation - name: LOG_LEVEL value: ${LOG_LEVEL} diff --git a/app/.pipeline/lib/app.deploy.js b/app/.pipeline/lib/app.deploy.js index c5380277ec..dcc6724205 100644 --- a/app/.pipeline/lib/app.deploy.js +++ b/app/.pipeline/lib/app.deploy.js @@ -25,7 +25,8 @@ const appDeploy = async (settings) => { CHANGE_ID: phases[env]['build'].CHANGE_ID, REACT_APP_API_HOST: phases[env][phase].API_HOST, REACT_APP_SITEMINDER_LOGOUT_URL: phases[env][phase].SITEMINDER_LOGOUT_URL, - // File Upload Settings + // Object Store + OBJECT_STORE_SECRET: phases[env][phase].OBJECT_STORE_SECRET, REACT_APP_MAX_UPLOAD_NUM_FILES: phases[env][phase].MAX_UPLOAD_NUM_FILES, REACT_APP_MAX_UPLOAD_FILE_SIZE: phases[env][phase].MAX_UPLOAD_FILE_SIZE, // Node diff --git a/app/.pipeline/templates/app.dc.yaml b/app/.pipeline/templates/app.dc.yaml index 766e04deaa..b417475d13 100644 --- a/app/.pipeline/templates/app.dc.yaml +++ b/app/.pipeline/templates/app.dc.yaml @@ -35,8 +35,8 @@ parameters: - name: REACT_APP_NODE_ENV description: NODE_ENV specification variable for React app value: 'development' - - name: OBJECT_STORE_SECRETS - description: Secrets used to read and write to the S3 storage + - name: OBJECT_STORE_SECRET + description: The name of the Openshift secret which contains the object store credentials. value: 'biohubbc-object-store' - name: APP_PORT_DEFAULT description: Application default port @@ -137,12 +137,12 @@ objects: valueFrom: secretKeyRef: key: object_store_url - name: ${OBJECT_STORE_SECRETS} + name: ${OBJECT_STORE_SECRET} - name: OBJECT_STORE_BUCKET_NAME valueFrom: secretKeyRef: key: object_store_bucket_name - name: ${OBJECT_STORE_SECRETS} + name: ${OBJECT_STORE_SECRET} - name: NODE_ENV value: ${NODE_ENV} - name: REACT_APP_BIOHUB_FEATURE_FLAG diff --git a/containers/backup/templates/backup/backup-deploy.yaml b/containers/backup/templates/backup/backup-deploy.yaml index 2765663636..0ffb879b40 100644 --- a/containers/backup/templates/backup/backup-deploy.yaml +++ b/containers/backup/templates/backup/backup-deploy.yaml @@ -207,6 +207,10 @@ parameters: description: The path on which to mount the verification volume. This is used by the database server to contain the database configuration and data files. For Mongo, please use /var/lib/mongodb/data . For MSSQL, please use /var/opt/mssql/data. For MariaDB, please use /var/lib/mysql/data required: true value: /var/lib/pgsql/data + - name: OBJECT_STORE_SECRET + displayName: Object Store Secret + description: The name of the secret containing the object store credentials. + value: biohubbc-object-store - name: OBJECT_STORE_URL displayName: Object Store URL description: URL for the object store @@ -446,22 +450,22 @@ objects: - name: OBJECT_STORE_URL valueFrom: secretKeyRef: - name: biohubbc-object-store + name: ${OBJECT_STORE_SECRET} key: object_store_url - name: OBJECT_STORE_ACCESS_KEY_ID valueFrom: secretKeyRef: - name: biohubbc-object-store + name: ${OBJECT_STORE_SECRET} key: object_store_access_key_id - name: OBJECT_STORE_SECRET_KEY_ID valueFrom: secretKeyRef: - name: biohubbc-object-store + name: ${OBJECT_STORE_SECRET} key: object_store_secret_key_id - name: OBJECT_STORE_BUCKET_NAME valueFrom: secretKeyRef: - name: biohubbc-object-store + name: ${OBJECT_STORE_SECRET} key: object_store_bucket_name resources: requests: diff --git a/database/.pipeline/lib/db.setup.deploy.js b/database/.pipeline/lib/db.setup.deploy.js index aeceff6ca3..ccb1fe5be6 100644 --- a/database/.pipeline/lib/db.setup.deploy.js +++ b/database/.pipeline/lib/db.setup.deploy.js @@ -73,9 +73,11 @@ const dbSetupDeploy = async (settings) => { DB_SCHEMA_DAPI_V1: 'biohub_dapi_v1', IMAGE: dbSetupImageStream.image.dockerImageReference, // Development Seeding - PROJECT_SEEDER_USER_IDENTIFIER: phases[env][phase].PROJECT_SEEDER_USER_IDENTIFIER, - NUM_SEED_PROJECTS: phases[env][phase].NUM_SEED_PROJECTS, - NUM_SEED_SURVEYS_PER_PROJECT: phases[env][phase].NUM_SEED_SURVEYS_PER_PROJECT, + SEED_PROJECT_USER_IDENTIFIER: phases[env][phase].SEED_PROJECT_USER_IDENTIFIER, + SEED_NUM_PROJECTS: phases[env][phase].SEED_NUM_PROJECTS, + SEED_NUM_SURVEYS_PER_PROJECT: phases[env][phase].SEED_NUM_SURVEYS_PER_PROJECT, + SEED_NUM_OBSERVATIONS_PER_SURVEY: phases[env][phase].SEED_NUM_OBSERVATIONS_PER_SURVEY, + SEED_NUM_SUBCOUNTS_PER_OBSERVATION: phases[env][phase].SEED_NUM_SUBCOUNTS_PER_OBSERVATION, // Openshift Resources CPU_REQUEST: phases[env][phase].CPU_REQUEST, CPU_LIMIT: phases[env][phase].CPU_LIMIT, diff --git a/database/.pipeline/templates/db.setup.dc.yaml b/database/.pipeline/templates/db.setup.dc.yaml index 39f354dd40..c7d80ad771 100644 --- a/database/.pipeline/templates/db.setup.dc.yaml +++ b/database/.pipeline/templates/db.setup.dc.yaml @@ -33,11 +33,15 @@ parameters: required: true value: 'development' # Development Seeding - - name: PROJECT_SEEDER_USER_IDENTIFIER + - name: SEED_PROJECT_USER_IDENTIFIER value: '1' - - name: NUM_SEED_PROJECTS + - name: SEED_NUM_PROJECTS value: '0' - - name: NUM_SEED_SURVEYS_PER_PROJECT + - name: SEED_NUM_SURVEYS_PER_PROJECT + value: '0' + - name: SEED_NUM_OBSERVATIONS_PER_SURVEY + value: '0' + - name: SEED_NUM_SUBCOUNTS_PER_OBSERVATION value: '0' # Openshift Resources - name: CPU_REQUEST @@ -98,12 +102,16 @@ objects: value: ${DB_SCHEMA} - name: DB_SCHEMA_DAPI_V1 value: ${DB_SCHEMA_DAPI_V1} - - name: PROJECT_SEEDER_USER_IDENTIFIER - value: ${PROJECT_SEEDER_USER_IDENTIFIER} - - name: NUM_SEED_PROJECTS - value: ${NUM_SEED_PROJECTS} - - name: NUM_SEED_SURVEYS_PER_PROJECT - value: ${NUM_SEED_SURVEYS_PER_PROJECT} + - name: SEED_PROJECT_USER_IDENTIFIER + value: ${SEED_PROJECT_USER_IDENTIFIER} + - name: SEED_NUM_PROJECTS + value: ${SEED_NUM_PROJECTS} + - name: SEED_NUM_SURVEYS_PER_PROJECT + value: ${SEED_NUM_SURVEYS_PER_PROJECT} + - name: SEED_NUM_OBSERVATIONS_PER_SURVEY + value: ${SEED_NUM_OBSERVATIONS_PER_SURVEY} + - name: SEED_NUM_SUBCOUNTS_PER_OBSERVATION + value: ${SEED_NUM_SUBCOUNTS_PER_OBSERVATION} image: '${IMAGE}' imagePullPolicy: Always resources: diff --git a/database/src/seeds/03_basic_project_survey_setup.ts b/database/src/seeds/03_basic_project_survey_setup.ts index 9518473569..79bc8fdeac 100644 --- a/database/src/seeds/03_basic_project_survey_setup.ts +++ b/database/src/seeds/03_basic_project_survey_setup.ts @@ -3,13 +3,13 @@ import { Knex } from 'knex'; const DB_SCHEMA = process.env.DB_SCHEMA; const DB_SCHEMA_DAPI_V1 = process.env.DB_SCHEMA_DAPI_V1; -const PROJECT_SEEDER_USER_IDENTIFIER = process.env.PROJECT_SEEDER_USER_IDENTIFIER; +const SEED_PROJECT_USER_IDENTIFIER = process.env.SEED_PROJECT_USER_IDENTIFIER; -const NUM_SEED_PROJECTS = Number(process.env.NUM_SEED_PROJECTS ?? 2); -const NUM_SEED_SURVEYS_PER_PROJECT = Number(process.env.NUM_SEED_SURVEYS_PER_PROJECT ?? 2); +const SEED_NUM_PROJECTS = Number(process.env.SEED_NUM_PROJECTS ?? 2); +const SEED_NUM_SURVEYS_PER_PROJECT = Number(process.env.SEED_NUM_SURVEYS_PER_PROJECT ?? 2); -const NUM_SEED_OBSERVATIONS_PER_SURVEY = Number(process.env.NUM_SEED_OBSERVATIONS_PER_SURVEY ?? 3); -const NUM_SEED_SUBCOUNTS_PER_OBSERVATION = Number(process.env.NUM_SEED_SUBCOUNTS_PER_OBSERVATION ?? 1); +const SEED_NUM_OBSERVATIONS_PER_SURVEY = Number(process.env.SEED_NUM_OBSERVATIONS_PER_SURVEY ?? 3); +const SEED_NUM_SUBCOUNTS_PER_OBSERVATION = Number(process.env.SEED_NUM_SUBCOUNTS_PER_OBSERVATION ?? 1); const focalTaxonIdOptions = [ { itis_tsn: 180703, itis_scientific_name: 'Alces alces' }, // Moose @@ -52,7 +52,7 @@ export async function seed(knex: Knex): Promise { const checkProjectsResponse = await knex.raw(checkAnyProjectExists()); if (!checkProjectsResponse.rows.length) { - for (let i = 0; i < NUM_SEED_PROJECTS; i++) { + for (let i = 0; i < SEED_NUM_PROJECTS; i++) { // Insert project data const createProjectResponse = await knex.raw(insertProjectData(`Seed Project ${i + 1}`)); const projectId = createProjectResponse.rows[0].project_id; @@ -65,7 +65,7 @@ export async function seed(knex: Knex): Promise { `); // Insert survey data - for (let j = 0; j < NUM_SEED_SURVEYS_PER_PROJECT; j++) { + for (let j = 0; j < SEED_NUM_SURVEYS_PER_PROJECT; j++) { const createSurveyResponse = await knex.raw(insertSurveyData(projectId, `Seed Survey ${j + 1}`)); const surveyId = createSurveyResponse.rows[0].survey_id; @@ -88,17 +88,17 @@ export async function seed(knex: Knex): Promise { ${insertSurveySamplePeriodData(surveyId)} `); - for (let k = 0; k < NUM_SEED_OBSERVATIONS_PER_SURVEY; k++) { + for (let k = 0; k < SEED_NUM_OBSERVATIONS_PER_SURVEY; k++) { const createObservationResponse = await knex.raw( // set the number of observations to minimum 20 times the number of subcounts (which are set to a number // between 1 and 20) to ensure the sum of all subcounts is at least <= the observation count (to avoid // constraint violations) insertSurveyObservationData( surveyId, - NUM_SEED_SUBCOUNTS_PER_OBSERVATION * 20 + faker.number.int({ min: 1, max: 20 }) + SEED_NUM_SUBCOUNTS_PER_OBSERVATION * 20 + faker.number.int({ min: 1, max: 20 }) ) ); - for (let l = 0; l < NUM_SEED_SUBCOUNTS_PER_OBSERVATION; l++) { + for (let l = 0; l < SEED_NUM_SUBCOUNTS_PER_OBSERVATION; l++) { await knex.raw(insertObservationSubCount(createObservationResponse.rows[0].survey_observation_id)); } } @@ -162,7 +162,7 @@ const insertSurveyParticipationData = (surveyId: number) => ` FROM system_user su WHERE - su.user_identifier = '${PROJECT_SEEDER_USER_IDENTIFIER}' + su.user_identifier = '${SEED_PROJECT_USER_IDENTIFIER}' ), 1) ), 1 @@ -414,7 +414,7 @@ const insertProjectParticipationData = (projectId: number) => ` FROM system_user su WHERE - su.user_identifier = '${PROJECT_SEEDER_USER_IDENTIFIER}' + su.user_identifier = '${SEED_PROJECT_USER_IDENTIFIER}' ), 1) ), (SELECT project_role_id FROM project_role WHERE name = 'Coordinator' LIMIT 1) diff --git a/docker-compose.yml b/docker-compose.yml index bbcc8c466c..1a2b12b646 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -53,11 +53,11 @@ services: - DB_DATABASE=${DB_DATABASE} - DB_SCHEMA=${DB_SCHEMA} # Seed - - PROJECT_SEEDER_USER_IDENTIFIER=${PROJECT_SEEDER_USER_IDENTIFIER} - - NUM_SEED_PROJECTS=${NUM_SEED_PROJECTS} - - NUM_SEED_SURVEYS_PER_PROJECT=${NUM_SEED_SURVEYS_PER_PROJECT} - - NUM_SEED_OBSERVATIONS_PER_SURVEY=${NUM_SEED_OBSERVATIONS_PER_SURVEY} - - NUM_SEED_SUBCOUNTS_PER_OBSERVATION=${NUM_SEED_SUBCOUNTS_PER_OBSERVATION} + - SEED_PROJECT_USER_IDENTIFIER=${SEED_PROJECT_USER_IDENTIFIER} + - SEED_NUM_PROJECTS=${SEED_NUM_PROJECTS} + - SEED_NUM_SURVEYS_PER_PROJECT=${SEED_NUM_SURVEYS_PER_PROJECT} + - SEED_NUM_OBSERVATIONS_PER_SURVEY=${SEED_NUM_OBSERVATIONS_PER_SURVEY} + - SEED_NUM_SUBCOUNTS_PER_OBSERVATION=${SEED_NUM_SUBCOUNTS_PER_OBSERVATION} # Keycloak - KEYCLOAK_HOST=${KEYCLOAK_HOST} - KEYCLOAK_REALM=${KEYCLOAK_REALM} @@ -181,11 +181,12 @@ services: - DB_USER_API=${DB_USER_API} - DB_USER_API_PASS=${DB_USER_API_PASS} - DB_SCHEMA_DAPI_V1=${DB_SCHEMA_DAPI_V1} - - PROJECT_SEEDER_USER_IDENTIFIER=${PROJECT_SEEDER_USER_IDENTIFIER} - - NUM_SEED_PROJECTS=${NUM_SEED_PROJECTS} - - NUM_SEED_SURVEYS_PER_PROJECT=${NUM_SEED_SURVEYS_PER_PROJECT} - - NUM_SEED_OBSERVATIONS_PER_SURVEY=${NUM_SEED_OBSERVATIONS_PER_SURVEY} - - NUM_SEED_SUBCOUNTS_PER_OBSERVATION=${NUM_SEED_SUBCOUNTS_PER_OBSERVATION} + # Seed + - SEED_PROJECT_USER_IDENTIFIER=${SEED_PROJECT_USER_IDENTIFIER} + - SEED_NUM_PROJECTS=${SEED_NUM_PROJECTS} + - SEED_NUM_SURVEYS_PER_PROJECT=${SEED_NUM_SURVEYS_PER_PROJECT} + - SEED_NUM_OBSERVATIONS_PER_SURVEY=${SEED_NUM_OBSERVATIONS_PER_SURVEY} + - SEED_NUM_SUBCOUNTS_PER_OBSERVATION=${SEED_NUM_SUBCOUNTS_PER_OBSERVATION} volumes: - /opt/app-root/src/node_modules # prevents local node_modules overriding container node_modules networks: diff --git a/env_config/env.docker b/env_config/env.docker index 4e31d0fa73..5da4ed84bd 100644 --- a/env_config/env.docker +++ b/env_config/env.docker @@ -197,16 +197,16 @@ GCNOTIFY_SMS_URL=https://api.notification.canada.ca/v2/notifications/sms # Project Seeder User Identifier - Sets the project participant for the deafult # project to match the given user identifier. If left blank, defaults to the # user with system user ID 1. -PROJECT_SEEDER_USER_IDENTIFIER= +SEED_PROJECT_USER_IDENTIFIER= # Sets the number of desired seed projects to generate. Defaults to 2. -NUM_SEED_PROJECTS=2 +SEED_NUM_PROJECTS=2 # Sets the number of desired seed surveys to generate per project. Defaults to 2. -NUM_SEED_SURVEYS_PER_PROJECT=2 +SEED_NUM_SURVEYS_PER_PROJECT=2 # Sets the number of desired seed observations to generate per survey. defaults to 3. -NUM_SEED_OBSERVATIONS_PER_SURVEY=3 +SEED_NUM_OBSERVATIONS_PER_SURVEY=3 # Sets the number of desired seed subcounts to generate per observation. defaults to 1. -NUM_SEED_SUBCOUNTS_PER_OBSERVATION=1 \ No newline at end of file +SEED_NUM_SUBCOUNTS_PER_OBSERVATION=1 \ No newline at end of file From 1a95f777acbba390ddbfd53c07a1caf6109c160f Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Mon, 18 Mar 2024 16:07:20 -0700 Subject: [PATCH 57/62] Add missing env vars to deploy yaml --- .pipeline/configMaps/sims.configmap.yaml | 8 ++++---- api/.pipeline/lib/api.deploy.js | 5 ++--- api/.pipeline/templates/api.dc.yaml | 20 ++++++++++++++++++++ 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/.pipeline/configMaps/sims.configmap.yaml b/.pipeline/configMaps/sims.configmap.yaml index fbfcfe5b2f..90baa4d38d 100644 --- a/.pipeline/configMaps/sims.configmap.yaml +++ b/.pipeline/configMaps/sims.configmap.yaml @@ -32,6 +32,7 @@ data: "deploy": { "NAMESPACE": "af2668-dev", "NODE_ENV": "development", + "MAX_REQ_BODY_SIZE": "52428800", "TZ": "America/Vancouver", "BACKBONE_INTERNAL_API_HOST": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", "BACKBONE_INTAKE_PATH": "/api/dwc/submission/queue", @@ -42,7 +43,6 @@ data: "BCTW_API_HOST": "https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca", "CB_API_HOST": "https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api", "OBJECT_STORE_SECRET": "biohubbc-object-store", - "MAX_REQ_BODY_SIZE": "52428800", "MAX_UPLOAD_NUM_FILES": "10", "MAX_UPLOAD_FILE_SIZE": "52428800", "S3_KEY_PREFIX": "sims-pr", @@ -75,6 +75,7 @@ data: "NODE_ENV": "development", "API_HOST": "api-dev-biohubbc.apps.silver.devops.gov.bc.ca", "APP_HOST": "dev-biohubbc.apps.silver.devops.gov.bc.ca", + "MAX_REQ_BODY_SIZE": "52428800", "TZ": "America/Vancouver", "BACKBONE_INTERNAL_API_HOST": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", "BACKBONE_INTAKE_PATH": "/api/dwc/submission/queue", @@ -85,7 +86,6 @@ data: "BCTW_API_HOST": "https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca", "CB_API_HOST": "https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api", "OBJECT_STORE_SECRET": "biohubbc-object-store", - "MAX_REQ_BODY_SIZE": "52428800", "MAX_UPLOAD_NUM_FILES": "10", "MAX_UPLOAD_FILE_SIZE": "52428800", "S3_KEY_PREFIX": "sims", @@ -118,6 +118,7 @@ data: "NODE_ENV": "production", "API_HOST": "api-test-biohubbc.apps.silver.devops.gov.bc.ca", "APP_HOST": "test-biohubbc.apps.silver.devops.gov.bc.ca", + "MAX_REQ_BODY_SIZE": "52428800", "TZ": "America/Vancouver", "BACKBONE_INTERNAL_API_HOST": "https://api-test-biohub-platform.apps.silver.devops.gov.bc.ca", "BACKBONE_INTAKE_PATH": "/api/dwc/submission/queue", @@ -128,7 +129,6 @@ data: "BCTW_API_HOST": "https://moe-bctw-api-test.apps.silver.devops.gov.bc.ca", "CB_API_HOST": "https://moe-critterbase-api-test.apps.silver.devops.gov.bc.ca/api", "OBJECT_STORE_SECRET": "biohubbc-object-store", - "MAX_REQ_BODY_SIZE": "52428800", "MAX_UPLOAD_NUM_FILES": "10", "MAX_UPLOAD_FILE_SIZE": "52428800", "S3_KEY_PREFIX": "sims", @@ -162,6 +162,7 @@ data: "API_HOST": "api-biohubbc.apps.silver.devops.gov.bc.ca", "APP_HOST": "biohubbc.apps.silver.devops.gov.bc.ca", "APP_VANITY_URL": "biohubbc.nrs.gov.bc.ca", + "MAX_REQ_BODY_SIZE": "52428800", "TZ": "America/Vancouver", "BACKBONE_INTERNAL_API_HOST": "https://api-biohub-platform.apps.silver.devops.gov.bc.ca", "BACKBONE_INTAKE_PATH": "/api/dwc/submission/queue", @@ -172,7 +173,6 @@ data: "BCTW_API_HOST": "https://moe-bctw-api-prod.apps.silver.devops.gov.bc.ca", "CB_API_HOST": "https://moe-critterbase-api-prod.apps.silver.devops.gov.bc.ca/api", "OBJECT_STORE_SECRET": "biohubbc-object-store", - "MAX_REQ_BODY_SIZE": "52428800", "MAX_UPLOAD_NUM_FILES": "10", "MAX_UPLOAD_FILE_SIZE": "52428800", "S3_KEY_PREFIX": "sims", diff --git a/api/.pipeline/lib/api.deploy.js b/api/.pipeline/lib/api.deploy.js index cedc9ad4d3..d7891ff1d8 100644 --- a/api/.pipeline/lib/api.deploy.js +++ b/api/.pipeline/lib/api.deploy.js @@ -30,6 +30,7 @@ const apiDeploy = async (settings) => { API_HOST: phases[env][phase].API_HOST, APP_HOST: phases[env][phase].APP_HOST, CHANGE_ID: phases[env]['build'].CHANGE_ID, + MAX_REQ_BODY_SIZE: phases[env][phase].MAX_REQ_BODY_SIZE, // Node NODE_ENV: phases[env][phase].NODE_ENV, NODE_OPTIONS: phases[env][phase].NODE_OPTIONS, @@ -47,8 +48,6 @@ const apiDeploy = async (settings) => { // BCTW / Critterbase BCTW_API_HOST: phases[env][phase].BCTW_API_HOST, CB_API_HOST: phases[env][phase].CB_API_HOST, - // S3 - S3_KEY_PREFIX: phases[env][phase].S3_KEY_PREFIX, // Database TZ: phases[env][phase].TZ, DB_SERVICE_NAME: `${phases[env][phase].DB_NAME}-postgresql${phases[env][phase].SUFFIX}`, @@ -69,9 +68,9 @@ const apiDeploy = async (settings) => { KEYCLOAK_API_ENVIRONMENT: phases[env][phase].SSO.cssApi.KEYCLOAK_API_ENVIRONMENT, // Object Store OBJECT_STORE_SECRET: phases[env][phase].OBJECT_STORE_SECRET, - MAX_REQ_BODY_SIZE: phases[env][phase].MAX_REQ_BODY_SIZE, MAX_UPLOAD_NUM_FILES: phases[env][phase].MAX_UPLOAD_NUM_FILES, MAX_UPLOAD_FILE_SIZE: phases[env][phase].MAX_UPLOAD_FILE_SIZE, + S3_KEY_PREFIX: phases[env][phase].S3_KEY_PREFIX, // Log Level LOG_LEVEL: phases[env][phase].LOG_LEVEL, API_RESPONSE_VALIDATION_ENABLED: phases[env][phase].API_RESPONSE_VALIDATION_ENABLED, diff --git a/api/.pipeline/templates/api.dc.yaml b/api/.pipeline/templates/api.dc.yaml index 79bde3db51..713fe4cc56 100644 --- a/api/.pipeline/templates/api.dc.yaml +++ b/api/.pipeline/templates/api.dc.yaml @@ -34,6 +34,10 @@ parameters: - name: API_PORT_DEFAULT_NAME description: Api default port name value: '6100-tcp' + - name: MAX_REQ_BODY_SIZE + description: The maximum request body size in bytes + required: false + value: '52428800' # Clamav - name: ENABLE_FILE_VIRUS_SCAN value: 'true' @@ -116,6 +120,14 @@ parameters: - name: OBJECT_STORE_SECRET description: The name of the Openshift secret which contains the object store credentials. value: 'biohubbc-object-store' + - name: MAX_UPLOAD_NUM_FILES + description: The maximum number of files that can be uploaded at once + required: false + value: '10' + - name: MAX_UPLOAD_FILE_SIZE + description: The maximum file size in bytes + required: false + value: '52428800' - name: S3_KEY_PREFIX description: S3 key optional prefix required: false @@ -222,6 +234,8 @@ objects: value: ${VERSION} - name: CHANGE_VERSION value: ${CHANGE_ID} + - name: MAX_REQ_BODY_SIZE + value: ${MAX_REQ_BODY_SIZE} # Node - name: NODE_ENV value: ${NODE_ENV} @@ -324,6 +338,12 @@ objects: secretKeyRef: key: object_store_bucket_name name: ${OBJECT_STORE_SECRET} + - name: MAX_UPLOAD_NUM_FILES + value: ${MAX_UPLOAD_NUM_FILES} + - name: MAX_UPLOAD_FILE_SIZE + value: ${MAX_UPLOAD_FILE_SIZE} + - name: S3_KEY_PREFIX + value: ${S3_KEY_PREFIX} # Logging and Validation - name: LOG_LEVEL value: ${LOG_LEVEL} From 7383f789eb7b89f5c790be1e1e0072541f9c39ad Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Mon, 18 Mar 2024 16:09:47 -0700 Subject: [PATCH 58/62] ignore-skip From 4eff567ad0b7e3b981acc5ce9c3d0a33b3793910 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Mon, 18 Mar 2024 16:46:28 -0700 Subject: [PATCH 59/62] Update database env vars --- .pipeline/configMaps/sims.configmap.yaml | 8 ++++++ api/.pipeline/config.js | 25 ++++++++++------ api/.pipeline/lib/api.deploy.js | 2 +- database/.pipeline/lib/db.setup.deploy.js | 35 +++++++++++------------ 4 files changed, 43 insertions(+), 27 deletions(-) diff --git a/.pipeline/configMaps/sims.configmap.yaml b/.pipeline/configMaps/sims.configmap.yaml index 90baa4d38d..193403bed2 100644 --- a/.pipeline/configMaps/sims.configmap.yaml +++ b/.pipeline/configMaps/sims.configmap.yaml @@ -325,6 +325,8 @@ data: "NAMESPACE": "af2668-dev", "NODE_ENV": "development", "TZ": "America/Vancouver", + "DB_SCHEMA": "biohub", + "DB_SCHEMA_DAPI_V1": "biohub_dapi_v1", "SEED_PROJECT_USER_IDENTIFIER": "1", "SEED_NUM_PROJECTS": "2", "SEED_NUM_SURVEYS_PER_PROJECT": "2", @@ -353,6 +355,8 @@ data: "NAMESPACE": "af2668-dev", "NODE_ENV": "development", "TZ": "America/Vancouver", + "DB_SCHEMA": "biohub", + "DB_SCHEMA_DAPI_V1": "biohub_dapi_v1", "SEED_PROJECT_USER_IDENTIFIER": "1", "SEED_NUM_PROJECTS": "2", "SEED_NUM_SURVEYS_PER_PROJECT": "2", @@ -381,6 +385,8 @@ data: "NAMESPACE": "af2668-test", "NODE_ENV": "production", "TZ": "America/Vancouver", + "DB_SCHEMA": "biohub", + "DB_SCHEMA_DAPI_V1": "biohub_dapi_v1", "SEED_PROJECT_USER_IDENTIFIER": "1", "SEED_NUM_PROJECTS": "0", "SEED_NUM_SURVEYS_PER_PROJECT": "0", @@ -409,6 +415,8 @@ data: "NAMESPACE": "af2668-prod", "NODE_ENV": "production", "TZ": "America/Vancouver", + "DB_SCHEMA": "biohub", + "DB_SCHEMA_DAPI_V1": "biohub_dapi_v1", "SEED_PROJECT_USER_IDENTIFIER": "1", "SEED_NUM_PROJECTS": "0", "SEED_NUM_SURVEYS_PER_PROJECT": "0", diff --git a/api/.pipeline/config.js b/api/.pipeline/config.js index 7029bbd1c4..b62614e67c 100644 --- a/api/.pipeline/config.js +++ b/api/.pipeline/config.js @@ -18,12 +18,21 @@ const branch = options.branch || null; const pipelineConfigMapString = options.config; const pipelineConfigMap = JSON.parse(pipelineConfigMapString); +/** + * The pipeline settings. + * + * The top-level keys are the pipeline environments (e.g. pr, dev, test, prod). + * - This is specified by setting the '--env' arg in the git action. + * + * The second-level keys are the pipeline phases (e.g. build, deploy). + * - This is specified by setting the '--phase' arg in the git action. + */ const phases = { pr: { build: { ...pipelineConfigMap.api.pr.build, NAME: pipelineConfigMap.module.api, - DB_NAME: pipelineConfigMap.module.db, + DB_SERVICE_NAME: `${pipelineConfigMap.module.db}-postgresql${phases[env][phase].SUFFIX}`, CHANGE_ID: changeId, SUFFIX: `-build-${changeId}`, INSTANCE: `${pipelineConfigMap.module.api}-build-${changeId}`, @@ -34,7 +43,7 @@ const phases = { deploy: { ...pipelineConfigMap.api.pr.deploy, NAME: pipelineConfigMap.module.api, - DB_NAME: pipelineConfigMap.module.db, + DB_SERVICE_NAME: `${pipelineConfigMap.module.db}-postgresql${phases[env][phase].SUFFIX}`, CHANGE_ID: changeId, SUFFIX: `-dev-${changeId}`, INSTANCE: `${pipelineConfigMap.module.api}-pr-${changeId}`, @@ -50,7 +59,7 @@ const phases = { build: { ...pipelineConfigMap.api.dev.build, NAME: pipelineConfigMap.module.api, - DB_NAME: pipelineConfigMap.module.db, + DB_SERVICE_NAME: `${pipelineConfigMap.module.db}-postgresql${phases[env][phase].SUFFIX}`, CHANGE_ID: changeId, SUFFIX: `-build-${changeId}`, INSTANCE: `${pipelineConfigMap.module.api}-build-${changeId}`, @@ -61,7 +70,7 @@ const phases = { deploy: { ...pipelineConfigMap.api.dev.deploy, NAME: pipelineConfigMap.module.api, - DB_NAME: pipelineConfigMap.module.db, + DB_SERVICE_NAME: `${pipelineConfigMap.module.db}-postgresql${phases[env][phase].SUFFIX}`, CHANGE_ID: 'deploy', SUFFIX: '-dev-deploy', INSTANCE: `${pipelineConfigMap.module.api}-dev-deploy`, @@ -76,7 +85,7 @@ const phases = { build: { ...pipelineConfigMap.api.test.build, NAME: pipelineConfigMap.module.api, - DB_NAME: pipelineConfigMap.module.db, + DB_SERVICE_NAME: `${pipelineConfigMap.module.db}-postgresql${phases[env][phase].SUFFIX}`, CHANGE_ID: changeId, SUFFIX: `-build-${changeId}`, INSTANCE: `${pipelineConfigMap.module.api}-build-${changeId}`, @@ -87,7 +96,7 @@ const phases = { deploy: { ...pipelineConfigMap.api.test.deploy, NAME: pipelineConfigMap.module.api, - DB_NAME: pipelineConfigMap.module.db, + DB_SERVICE_NAME: `${pipelineConfigMap.module.db}-postgresql${phases[env][phase].SUFFIX}`, CHANGE_ID: 'deploy', SUFFIX: `-test`, INSTANCE: `${pipelineConfigMap.module.api}-test`, @@ -102,7 +111,7 @@ const phases = { build: { ...pipelineConfigMap.api.prod.build, NAME: pipelineConfigMap.module.api, - DB_NAME: pipelineConfigMap.module.db, + DB_SERVICE_NAME: `${pipelineConfigMap.module.db}-postgresql${phases[env][phase].SUFFIX}`, CHANGE_ID: changeId, SUFFIX: `-build-${changeId}`, @@ -114,7 +123,7 @@ const phases = { deploy: { ...pipelineConfigMap.api.prod.deploy, NAME: pipelineConfigMap.module.api, - DB_NAME: pipelineConfigMap.module.db, + DB_SERVICE_NAME: `${pipelineConfigMap.module.db}-postgresql${phases[env][phase].SUFFIX}`, CHANGE_ID: 'deploy', SUFFIX: `-prod`, INSTANCE: `${pipelineConfigMap.module.api}-prod`, diff --git a/api/.pipeline/lib/api.deploy.js b/api/.pipeline/lib/api.deploy.js index d7891ff1d8..5e6de34691 100644 --- a/api/.pipeline/lib/api.deploy.js +++ b/api/.pipeline/lib/api.deploy.js @@ -50,7 +50,7 @@ const apiDeploy = async (settings) => { CB_API_HOST: phases[env][phase].CB_API_HOST, // Database TZ: phases[env][phase].TZ, - DB_SERVICE_NAME: `${phases[env][phase].DB_NAME}-postgresql${phases[env][phase].SUFFIX}`, + DB_SERVICE_NAME: phases[env][phase].DB_SERVICE_NAME, // Keycloak KEYCLOAK_HOST: phases[env][phase].SSO.KEYCLOAK_HOST, KEYCLOAK_REALM: phases[env][phase].SSO.KEYCLOAK_REALM, diff --git a/database/.pipeline/lib/db.setup.deploy.js b/database/.pipeline/lib/db.setup.deploy.js index ccb1fe5be6..15e43b908e 100644 --- a/database/.pipeline/lib/db.setup.deploy.js +++ b/database/.pipeline/lib/db.setup.deploy.js @@ -21,18 +21,17 @@ const dbSetupDeploy = async (settings) => { const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, '../templates')); - const CHANGE_ID = phases[env][phase].CHANGE_ID; - const isName = `${phases[env][phase].NAME}-setup`; - const INSTANCE = `${isName}-${CHANGE_ID}`; - const isVersion = `${phases[env][phase].TAG}-setup`; - const imageStreamName = `${isName}:${isVersion}`; - const DB_NAME = `${phases[env][phase].NAME}-postgresql${phases[env][phase].SUFFIX}`; + const IMAGE_NAME = `${phases[env][phase].NAME}-setup`; + const INSTANCE = `${IMAGE_NAME}-${phases[env][phase].CHANGE_ID}`; + const IMAGE_VERSION = `${phases[env][phase].TAG}-setup`; + const IMAGESTREAM_NAME = `${IMAGE_NAME}:${IMAGE_VERSION}`; + const DB_SERVICE_NAME = `${phases[env][phase].NAME}-postgresql${phases[env][phase].SUFFIX}`; const objects = []; const imageStreamObjects = []; // Clean existing image - await checkAndClean(`istag/${imageStreamName}`, 10, 5, 0, oc).catch(() => { + await checkAndClean(`istag/${IMAGESTREAM_NAME}`, 10, 5, 0, oc).catch(() => { // Ignore errors, nothing to clean }); @@ -40,16 +39,16 @@ const dbSetupDeploy = async (settings) => { imageStreamObjects.push( ...oc.processDeploymentTemplate(`${templatesLocalBaseUrl}/db.setup.is.yaml`, { param: { - NAME: `${isName}` + NAME: `${IMAGE_NAME}` } }) ); - oc.applyRecommendedLabels(imageStreamObjects, isName, env, CHANGE_ID, INSTANCE); - oc.importImageStreams(imageStreamObjects, isVersion, phases[env]['build'].NAMESPACE, phases[env]['build'].TAG); + oc.applyRecommendedLabels(imageStreamObjects, IMAGE_NAME, env, phases[env][phase].CHANGE_ID, INSTANCE); + oc.importImageStreams(imageStreamObjects, IMAGE_VERSION, phases[env]['build'].NAMESPACE, phases[env]['build'].TAG); // Get database setup image stream - const fetchedImageStreams = oc.get(`istag/${imageStreamName}`) || []; + const fetchedImageStreams = oc.get(`istag/${IMAGESTREAM_NAME}`) || []; if (!fetchedImageStreams.length) { console.debug('Unable to fetch Database image reference for use in database setup deployment'); @@ -58,7 +57,7 @@ const dbSetupDeploy = async (settings) => { const dbSetupImageStream = fetchedImageStreams[0]; - const NAME = `${isName}${phases[env][phase].SUFFIX}`; + const NAME = `${IMAGE_NAME}${phases[env][phase].SUFFIX}`; objects.push( ...oc.processDeploymentTemplate(`${templatesLocalBaseUrl}/db.setup.dc.yaml`, { @@ -66,11 +65,11 @@ const dbSetupDeploy = async (settings) => { NAME: NAME, SUFFIX: phases[env][phase].SUFFIX, VERSION: phases[env][phase].TAG, - CHANGE_ID: CHANGE_ID, + CHANGE_ID: phases[env][phase].CHANGE_ID, NODE_ENV: phases[env][phase].NODE_ENV, - DB_SERVICE_NAME: DB_NAME, - DB_SCHEMA: 'biohub', - DB_SCHEMA_DAPI_V1: 'biohub_dapi_v1', + DB_SERVICE_NAME: DB_SERVICE_NAME, + DB_SCHEMA: phases[env][phase].DB_SCHEMA, + DB_SCHEMA_DAPI_V1: phases[env][phase].DB_SCHEMA_DAPI_V1, IMAGE: dbSetupImageStream.image.dockerImageReference, // Development Seeding SEED_PROJECT_USER_IDENTIFIER: phases[env][phase].SEED_PROJECT_USER_IDENTIFIER, @@ -94,7 +93,7 @@ const dbSetupDeploy = async (settings) => { // Wait to confirm if the db pod deployed successfully await waitForResourceToMeetCondition( - () => getResourceByRaw(`name=${DB_NAME}`, 'pod', settings, oc), + () => getResourceByRaw(`name=${DB_SERVICE_NAME}`, 'pod', settings, oc), isResourceRunning, 30, 5, @@ -102,7 +101,7 @@ const dbSetupDeploy = async (settings) => { ); // Deploy the db setup pod - oc.applyRecommendedLabels(objects, isName, env, CHANGE_ID, INSTANCE); + oc.applyRecommendedLabels(objects, IMAGE_NAME, env, phases[env][phase].CHANGE_ID, INSTANCE); await oc.applyAndDeploy(objects, phases[env][phase].INSTANCE); // Wait to confirm if the db setup pod deployed successfully From da7620f43f12dc9a54a75353fc153813dcc62d0c Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Mon, 18 Mar 2024 16:54:35 -0700 Subject: [PATCH 60/62] Fixes --- api/.pipeline/config.js | 18 +++++++++--------- api/.pipeline/lib/api.deploy.js | 4 +++- app/.pipeline/config.js | 9 +++++++++ database/.pipeline/config.js | 9 +++++++++ 4 files changed, 30 insertions(+), 10 deletions(-) diff --git a/api/.pipeline/config.js b/api/.pipeline/config.js index b62614e67c..8d2f8ab61b 100644 --- a/api/.pipeline/config.js +++ b/api/.pipeline/config.js @@ -19,7 +19,7 @@ const pipelineConfigMapString = options.config; const pipelineConfigMap = JSON.parse(pipelineConfigMapString); /** - * The pipeline settings. + * The pipeline settings for the API. * * The top-level keys are the pipeline environments (e.g. pr, dev, test, prod). * - This is specified by setting the '--env' arg in the git action. @@ -32,7 +32,7 @@ const phases = { build: { ...pipelineConfigMap.api.pr.build, NAME: pipelineConfigMap.module.api, - DB_SERVICE_NAME: `${pipelineConfigMap.module.db}-postgresql${phases[env][phase].SUFFIX}`, + DB_NAME: pipelineConfigMap.module.db, CHANGE_ID: changeId, SUFFIX: `-build-${changeId}`, INSTANCE: `${pipelineConfigMap.module.api}-build-${changeId}`, @@ -43,7 +43,7 @@ const phases = { deploy: { ...pipelineConfigMap.api.pr.deploy, NAME: pipelineConfigMap.module.api, - DB_SERVICE_NAME: `${pipelineConfigMap.module.db}-postgresql${phases[env][phase].SUFFIX}`, + DB_NAME: pipelineConfigMap.module.db, CHANGE_ID: changeId, SUFFIX: `-dev-${changeId}`, INSTANCE: `${pipelineConfigMap.module.api}-pr-${changeId}`, @@ -59,7 +59,7 @@ const phases = { build: { ...pipelineConfigMap.api.dev.build, NAME: pipelineConfigMap.module.api, - DB_SERVICE_NAME: `${pipelineConfigMap.module.db}-postgresql${phases[env][phase].SUFFIX}`, + DB_NAME: pipelineConfigMap.module.db, CHANGE_ID: changeId, SUFFIX: `-build-${changeId}`, INSTANCE: `${pipelineConfigMap.module.api}-build-${changeId}`, @@ -70,7 +70,7 @@ const phases = { deploy: { ...pipelineConfigMap.api.dev.deploy, NAME: pipelineConfigMap.module.api, - DB_SERVICE_NAME: `${pipelineConfigMap.module.db}-postgresql${phases[env][phase].SUFFIX}`, + DB_NAME: pipelineConfigMap.module.db, CHANGE_ID: 'deploy', SUFFIX: '-dev-deploy', INSTANCE: `${pipelineConfigMap.module.api}-dev-deploy`, @@ -85,7 +85,7 @@ const phases = { build: { ...pipelineConfigMap.api.test.build, NAME: pipelineConfigMap.module.api, - DB_SERVICE_NAME: `${pipelineConfigMap.module.db}-postgresql${phases[env][phase].SUFFIX}`, + DB_NAME: pipelineConfigMap.module.db, CHANGE_ID: changeId, SUFFIX: `-build-${changeId}`, INSTANCE: `${pipelineConfigMap.module.api}-build-${changeId}`, @@ -96,7 +96,7 @@ const phases = { deploy: { ...pipelineConfigMap.api.test.deploy, NAME: pipelineConfigMap.module.api, - DB_SERVICE_NAME: `${pipelineConfigMap.module.db}-postgresql${phases[env][phase].SUFFIX}`, + DB_NAME: pipelineConfigMap.module.db, CHANGE_ID: 'deploy', SUFFIX: `-test`, INSTANCE: `${pipelineConfigMap.module.api}-test`, @@ -111,7 +111,7 @@ const phases = { build: { ...pipelineConfigMap.api.prod.build, NAME: pipelineConfigMap.module.api, - DB_SERVICE_NAME: `${pipelineConfigMap.module.db}-postgresql${phases[env][phase].SUFFIX}`, + DB_NAME: pipelineConfigMap.module.db, CHANGE_ID: changeId, SUFFIX: `-build-${changeId}`, @@ -123,7 +123,7 @@ const phases = { deploy: { ...pipelineConfigMap.api.prod.deploy, NAME: pipelineConfigMap.module.api, - DB_SERVICE_NAME: `${pipelineConfigMap.module.db}-postgresql${phases[env][phase].SUFFIX}`, + DB_NAME: pipelineConfigMap.module.db, CHANGE_ID: 'deploy', SUFFIX: `-prod`, INSTANCE: `${pipelineConfigMap.module.api}-prod`, diff --git a/api/.pipeline/lib/api.deploy.js b/api/.pipeline/lib/api.deploy.js index 5e6de34691..f841c5cd02 100644 --- a/api/.pipeline/lib/api.deploy.js +++ b/api/.pipeline/lib/api.deploy.js @@ -19,6 +19,8 @@ const apiDeploy = async (settings) => { const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, '../templates')); + const DB_SERVICE_NAME = `${phases[env][phase].NAME}-postgresql${phases[env][phase].SUFFIX}`; + let objects = []; objects.push( @@ -50,7 +52,7 @@ const apiDeploy = async (settings) => { CB_API_HOST: phases[env][phase].CB_API_HOST, // Database TZ: phases[env][phase].TZ, - DB_SERVICE_NAME: phases[env][phase].DB_SERVICE_NAME, + DB_SERVICE_NAME: DB_SERVICE_NAME, // Keycloak KEYCLOAK_HOST: phases[env][phase].SSO.KEYCLOAK_HOST, KEYCLOAK_REALM: phases[env][phase].SSO.KEYCLOAK_REALM, diff --git a/app/.pipeline/config.js b/app/.pipeline/config.js index ffae133486..505456596c 100644 --- a/app/.pipeline/config.js +++ b/app/.pipeline/config.js @@ -18,6 +18,15 @@ const branch = options.branch || null; const pipelineConfigMapString = options.config; const pipelineConfigMap = JSON.parse(pipelineConfigMapString); +/** + * The pipeline settings for the APP. + * + * The top-level keys are the pipeline environments (e.g. pr, dev, test, prod). + * - This is specified by setting the '--env' arg in the git action. + * + * The second-level keys are the pipeline phases (e.g. build, deploy). + * - This is specified by setting the '--phase' arg in the git action. + */ const phases = { pr: { build: { diff --git a/database/.pipeline/config.js b/database/.pipeline/config.js index cab204e318..e914434787 100644 --- a/database/.pipeline/config.js +++ b/database/.pipeline/config.js @@ -18,6 +18,15 @@ const branch = options.branch || null; const pipelineConfigMapString = options.config; const pipelineConfigMap = JSON.parse(pipelineConfigMapString); +/** + * The pipeline settings for the Database and Database Setup. + * + * The top-level keys are the pipeline environments (e.g. pr, dev, test, prod). + * - This is specified by setting the '--env' arg in the git action. + * + * The second-level keys are the pipeline phases (e.g. build, deploy). + * - This is specified by setting the '--phase' arg in the git action. + */ const phases = { pr: { build: { From fff534d89972b20c53e41d9e340f2ebec8434fd2 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Mon, 18 Mar 2024 17:23:08 -0700 Subject: [PATCH 61/62] Fix db_name --- api/.pipeline/lib/api.deploy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/.pipeline/lib/api.deploy.js b/api/.pipeline/lib/api.deploy.js index f841c5cd02..c2fb0feef1 100644 --- a/api/.pipeline/lib/api.deploy.js +++ b/api/.pipeline/lib/api.deploy.js @@ -19,7 +19,7 @@ const apiDeploy = async (settings) => { const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, '../templates')); - const DB_SERVICE_NAME = `${phases[env][phase].NAME}-postgresql${phases[env][phase].SUFFIX}`; + const DB_SERVICE_NAME = `${phases[env][phase].DB_NAME}-postgresql${phases[env][phase].SUFFIX}`; let objects = []; From 59e71139a7788d5d11c243f08d4360f130a36f8f Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Thu, 21 Mar 2024 17:30:55 -0700 Subject: [PATCH 62/62] Updates --- .pipeline/configMaps/sims.configmap.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.pipeline/configMaps/sims.configmap.yaml b/.pipeline/configMaps/sims.configmap.yaml index 7871cc811a..ad9b0d48cf 100644 --- a/.pipeline/configMaps/sims.configmap.yaml +++ b/.pipeline/configMaps/sims.configmap.yaml @@ -35,7 +35,7 @@ data: "MAX_REQ_BODY_SIZE": "52428800", "TZ": "America/Vancouver", "BACKBONE_INTERNAL_API_HOST": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", - "BACKBONE_INTAKE_PATH": "/api/dwc/submission/queue", + "BACKBONE_INTAKE_PATH": "/api/submission/intake", "BACKBONE_ARTIFACT_INTAKE_PATH": "/api/artifact/intake", "BIOHUB_TAXON_TSN_PATH": "/api/taxonomy/taxon/tsn", "BIOHUB_TAXON_PATH": "/api/taxonomy/taxon", @@ -78,7 +78,7 @@ data: "MAX_REQ_BODY_SIZE": "52428800", "TZ": "America/Vancouver", "BACKBONE_INTERNAL_API_HOST": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", - "BACKBONE_INTAKE_PATH": "/api/dwc/submission/queue", + "BACKBONE_INTAKE_PATH": "/api/submission/intake", "BACKBONE_ARTIFACT_INTAKE_PATH": "/api/artifact/intake", "BIOHUB_TAXON_TSN_PATH": "/api/taxonomy/taxon/tsn", "BIOHUB_TAXON_PATH": "/api/taxonomy/taxon", @@ -121,11 +121,11 @@ data: "MAX_REQ_BODY_SIZE": "52428800", "TZ": "America/Vancouver", "BACKBONE_INTERNAL_API_HOST": "https://api-test-biohub-platform.apps.silver.devops.gov.bc.ca", - "BACKBONE_INTAKE_PATH": "/api/dwc/submission/queue", + "BACKBONE_INTAKE_PATH": "/api/submission/intake", "BACKBONE_ARTIFACT_INTAKE_PATH": "/api/artifact/intake", "BIOHUB_TAXON_TSN_PATH": "/api/taxonomy/taxon/tsn", "BIOHUB_TAXON_PATH": "/api/taxonomy/taxon", - "BACKBONE_INTAKE_ENABLED": false, + "BACKBONE_INTAKE_ENABLED": true, "BCTW_API_HOST": "https://moe-bctw-api-test.apps.silver.devops.gov.bc.ca", "CB_API_HOST": "https://moe-critterbase-api-test.apps.silver.devops.gov.bc.ca/api", "OBJECT_STORE_SECRET": "biohubbc-object-store", @@ -165,7 +165,7 @@ data: "MAX_REQ_BODY_SIZE": "52428800", "TZ": "America/Vancouver", "BACKBONE_INTERNAL_API_HOST": "https://api-biohub-platform.apps.silver.devops.gov.bc.ca", - "BACKBONE_INTAKE_PATH": "/api/dwc/submission/queue", + "BACKBONE_INTAKE_PATH": "/api/submission/intake", "BACKBONE_ARTIFACT_INTAKE_PATH": "/api/artifact/intake", "BIOHUB_TAXON_TSN_PATH": "/api/taxonomy/taxon/tsn", "BIOHUB_TAXON_PATH": "/api/taxonomy/taxon", @@ -177,8 +177,8 @@ data: "MAX_UPLOAD_FILE_SIZE": "52428800", "S3_KEY_PREFIX": "sims", "LOG_LEVEL": "warn", - "API_RESPONSE_VALIDATION_ENABLED": true, - "DATABASE_RESPONSE_VALIDATION_ENABLED": true, + "API_RESPONSE_VALIDATION_ENABLED": false, + "DATABASE_RESPONSE_VALIDATION_ENABLED": false, "ENABLE_FILE_VIRUS_SCAN": true, "CLAMAV_HOST": "clamav", "CLAMAV_PORT": "3310", @@ -266,7 +266,7 @@ data: "OBJECT_STORE_SECRET": "biohubbc-object-store", "MAX_UPLOAD_NUM_FILES": 10, "MAX_UPLOAD_FILE_SIZE": 52428800, - "REACT_APP_BIOHUB_FEATURE_FLAG": "false", + "REACT_APP_BIOHUB_FEATURE_FLAG": "true", "BACKBONE_PUBLIC_API_HOST": "https://api-dev-biohub-platform.apps.silver.devops.gov.bc.ca", "BIOHUB_TAXON_PATH": "/api/taxonomy/taxon", "BIOHUB_TAXON_TSN_PATH": "/api/taxonomy/taxon/tsn",