@catladder/pipeline 4.6.4 → 4.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants.js +1 -1
- package/dist/context/getEnvironmentVariables.js +6 -5
- package/dist/deploy/cloudRun/index.js +14 -2
- package/dist/deploy/cloudRun/utils/database.d.ts +6 -5
- package/dist/deploy/cloudRun/utils/database.js +22 -15
- package/dist/deploy/index.d.ts +7 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/pipeline/createJobsForComponent.js +5 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/config.d.ts +8 -0
- package/dist/variables/VariableValueContainingReferences.d.ts +6 -0
- package/dist/variables/VariableValueContainingReferences.js +21 -0
- package/dist/variables/resolveAllReferences.d.ts +1 -2
- package/dist/variables/resolveAllReferences.js +7 -8
- package/dist/variables/resolveAllReferencesOnce.d.ts +1 -4
- package/dist/variables/resolveAllReferencesOnce.js +3 -3
- package/dist/verify/createVerifyJobs.d.ts +4 -0
- package/dist/verify/createVerifyJobs.js +229 -0
- package/dist/verify/index.d.ts +2 -0
- package/dist/verify/index.js +26 -0
- package/dist/verify/types.d.ts +16 -0
- package/dist/verify/types.js +5 -0
- package/examples/__snapshots__/cloud-run-verify.test.ts.snap +3061 -0
- package/examples/__snapshots__/cloud-run-with-sql-multiple-dbs.test.ts.snap +35 -35
- package/examples/__snapshots__/cloud-run-with-sql-reuse-db.test.ts.snap +64 -64
- package/examples/cloud-run-verify.test.ts +12 -0
- package/examples/cloud-run-verify.ts +50 -0
- package/examples/cloud-run-with-sql-reuse-db.ts +4 -0
- package/package.json +1 -1
- package/src/context/getEnvironmentVariables.ts +19 -10
- package/src/deploy/cloudRun/index.ts +25 -1
- package/src/deploy/cloudRun/utils/database.ts +54 -22
- package/src/deploy/index.ts +7 -2
- package/src/index.ts +1 -0
- package/src/pipeline/createJobsForComponent.ts +4 -2
- package/src/types/config.ts +9 -0
- package/src/variables/VariableValueContainingReferences.ts +11 -0
- package/src/variables/__tests__/resolveAllReferences.test.ts +49 -0
- package/src/variables/resolveAllReferences.ts +18 -14
- package/src/variables/resolveAllReferencesOnce.ts +17 -12
- package/src/verify/createVerifyJobs.ts +81 -0
- package/src/verify/index.ts +2 -0
- package/src/verify/types.ts +18 -0
|
@@ -228,8 +228,8 @@ before_script:
|
|
|
228
228
|
- export DB_NAME="pan-test-app-dev-api"
|
|
229
229
|
- export DB_USER="my-user"
|
|
230
230
|
- export DB_PASSWORD="$CL_dev_api_DB_PASSWORD"
|
|
231
|
-
- export DATABASE_URL="postgresql
|
|
232
|
-
- export DATABASE_JDBC_URL="jdbc:postgresql
|
|
231
|
+
- export DATABASE_URL="postgresql://my-user:$CL_dev_api_DB_PASSWORD@localhost/pan-test-app-dev-api?host=/cloudsql/projectId:region:instancename"
|
|
232
|
+
- export DATABASE_JDBC_URL="jdbc:postgresql:///pan-test-app-dev-api?cloudSqlInstance=projectId:region:instancename&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=my-user&password=$CL_dev_api_DB_PASSWORD"
|
|
233
233
|
- export DEPLOY_CLOUD_RUN_SERVICE_NAME="pan-test-app-dev-api"
|
|
234
234
|
- export DEPLOY_CLOUD_RUN_PROJECT_ID="google-project-id"
|
|
235
235
|
- export DEPLOY_CLOUD_RUN_REGION="europe-west6"
|
|
@@ -251,8 +251,8 @@ before_script:
|
|
|
251
251
|
DB_NAME=pan-test-app-dev-api
|
|
252
252
|
DB_USER=my-user
|
|
253
253
|
DB_PASSWORD=$(printf %s "$CL_dev_api_DB_PASSWORD" | escapeForDotEnv)
|
|
254
|
-
DATABASE_URL
|
|
255
|
-
DATABASE_JDBC_URL
|
|
254
|
+
DATABASE_URL=$(printf %s "postgresql://my-user:$CL_dev_api_DB_PASSWORD@localhost/pan-test-app-dev-api?host=/cloudsql/projectId:region:instancename" | escapeForDotEnv)
|
|
255
|
+
DATABASE_JDBC_URL=$(printf %s "jdbc:postgresql:///pan-test-app-dev-api?cloudSqlInstance=projectId:region:instancename&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=my-user&password=$CL_dev_api_DB_PASSWORD" | escapeForDotEnv)
|
|
256
256
|
DEPLOY_CLOUD_RUN_SERVICE_NAME=pan-test-app-dev-api
|
|
257
257
|
DEPLOY_CLOUD_RUN_PROJECT_ID=google-project-id
|
|
258
258
|
DEPLOY_CLOUD_RUN_REGION=europe-west6
|
|
@@ -388,8 +388,8 @@ before_script:
|
|
|
388
388
|
- export DB_NAME="pan-test-app-dev-api"
|
|
389
389
|
- export DB_USER="my-user"
|
|
390
390
|
- export DB_PASSWORD="$CL_dev_api_DB_PASSWORD"
|
|
391
|
-
- export DATABASE_URL="postgresql
|
|
392
|
-
- export DATABASE_JDBC_URL="jdbc:postgresql
|
|
391
|
+
- export DATABASE_URL="postgresql://my-user:$CL_dev_api_DB_PASSWORD@localhost/pan-test-app-dev-api?host=/cloudsql/projectId:region:instancename"
|
|
392
|
+
- export DATABASE_JDBC_URL="jdbc:postgresql:///pan-test-app-dev-api?cloudSqlInstance=projectId:region:instancename&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=my-user&password=$CL_dev_api_DB_PASSWORD"
|
|
393
393
|
- export DEPLOY_CLOUD_RUN_SERVICE_NAME="pan-test-app-dev-api"
|
|
394
394
|
- export DEPLOY_CLOUD_RUN_PROJECT_ID="google-project-id"
|
|
395
395
|
- export DEPLOY_CLOUD_RUN_REGION="europe-west6"
|
|
@@ -439,9 +439,9 @@ before_script:
|
|
|
439
439
|
DB_PASSWORD: |-
|
|
440
440
|
$(printf %s "$CL_dev_api_DB_PASSWORD" | sed '1!s/^/ /')
|
|
441
441
|
DATABASE_URL: |-
|
|
442
|
-
postgresql
|
|
442
|
+
postgresql://my-user:$(printf %s "$CL_dev_api_DB_PASSWORD" | sed '1!s/^/ /')@localhost/pan-test-app-dev-api?host=/cloudsql/projectId:region:instancename
|
|
443
443
|
DATABASE_JDBC_URL: |-
|
|
444
|
-
jdbc:postgresql
|
|
444
|
+
jdbc:postgresql:///pan-test-app-dev-api?cloudSqlInstance=projectId:region:instancename&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=my-user&password=$(printf %s "$CL_dev_api_DB_PASSWORD" | sed '1!s/^/ /')
|
|
445
445
|
DEPLOY_CLOUD_RUN_SERVICE_NAME: |-
|
|
446
446
|
pan-test-app-dev-api
|
|
447
447
|
DEPLOY_CLOUD_RUN_PROJECT_ID: |-
|
|
@@ -659,8 +659,8 @@ before_script:
|
|
|
659
659
|
- export DB_NAME="pan-test-app-review-$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })-api"
|
|
660
660
|
- export DB_USER="my-user"
|
|
661
661
|
- export DB_PASSWORD="$CL_review_api_DB_PASSWORD"
|
|
662
|
-
- export DATABASE_URL="postgresql
|
|
663
|
-
- export DATABASE_JDBC_URL="jdbc:postgresql
|
|
662
|
+
- export DATABASE_URL="postgresql://my-user:$CL_review_api_DB_PASSWORD@localhost/pan-test-app-review-$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })-api?host=/cloudsql/projectId:region:instancename"
|
|
663
|
+
- export DATABASE_JDBC_URL="jdbc:postgresql:///pan-test-app-review-$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })-api?cloudSqlInstance=projectId:region:instancename&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=my-user&password=$CL_review_api_DB_PASSWORD"
|
|
664
664
|
- export DEPLOY_CLOUD_RUN_SERVICE_NAME="$(printf %s "pan-test-app-review-$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })-api" | awk '{print tolower($0)}')"
|
|
665
665
|
- export DEPLOY_CLOUD_RUN_PROJECT_ID="google-project-id"
|
|
666
666
|
- export DEPLOY_CLOUD_RUN_REGION="europe-west6"
|
|
@@ -682,8 +682,8 @@ before_script:
|
|
|
682
682
|
DB_NAME=$(printf %s "pan-test-app-review-$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })-api" | escapeForDotEnv)
|
|
683
683
|
DB_USER=my-user
|
|
684
684
|
DB_PASSWORD=$(printf %s "$CL_review_api_DB_PASSWORD" | escapeForDotEnv)
|
|
685
|
-
DATABASE_URL
|
|
686
|
-
DATABASE_JDBC_URL
|
|
685
|
+
DATABASE_URL=$(printf %s "postgresql://my-user:$CL_review_api_DB_PASSWORD@localhost/pan-test-app-review-$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })-api?host=/cloudsql/projectId:region:instancename" | escapeForDotEnv)
|
|
686
|
+
DATABASE_JDBC_URL=$(printf %s "jdbc:postgresql:///pan-test-app-review-$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })-api?cloudSqlInstance=projectId:region:instancename&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=my-user&password=$CL_review_api_DB_PASSWORD" | escapeForDotEnv)
|
|
687
687
|
DEPLOY_CLOUD_RUN_SERVICE_NAME=$(printf %s "$(printf %s "pan-test-app-review-$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })-api" | awk '{print tolower($0)}')" | escapeForDotEnv)
|
|
688
688
|
DEPLOY_CLOUD_RUN_PROJECT_ID=google-project-id
|
|
689
689
|
DEPLOY_CLOUD_RUN_REGION=europe-west6
|
|
@@ -825,8 +825,8 @@ before_script:
|
|
|
825
825
|
- export DB_NAME="pan-test-app-review-$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })-api"
|
|
826
826
|
- export DB_USER="my-user"
|
|
827
827
|
- export DB_PASSWORD="$CL_review_api_DB_PASSWORD"
|
|
828
|
-
- export DATABASE_URL="postgresql
|
|
829
|
-
- export DATABASE_JDBC_URL="jdbc:postgresql
|
|
828
|
+
- export DATABASE_URL="postgresql://my-user:$CL_review_api_DB_PASSWORD@localhost/pan-test-app-review-$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })-api?host=/cloudsql/projectId:region:instancename"
|
|
829
|
+
- export DATABASE_JDBC_URL="jdbc:postgresql:///pan-test-app-review-$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })-api?cloudSqlInstance=projectId:region:instancename&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=my-user&password=$CL_review_api_DB_PASSWORD"
|
|
830
830
|
- export DEPLOY_CLOUD_RUN_SERVICE_NAME="$(printf %s "pan-test-app-review-$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })-api" | awk '{print tolower($0)}')"
|
|
831
831
|
- export DEPLOY_CLOUD_RUN_PROJECT_ID="google-project-id"
|
|
832
832
|
- export DEPLOY_CLOUD_RUN_REGION="europe-west6"
|
|
@@ -876,9 +876,9 @@ before_script:
|
|
|
876
876
|
DB_PASSWORD: |-
|
|
877
877
|
$(printf %s "$CL_review_api_DB_PASSWORD" | sed '1!s/^/ /')
|
|
878
878
|
DATABASE_URL: |-
|
|
879
|
-
postgresql
|
|
879
|
+
postgresql://my-user:$(printf %s "$CL_review_api_DB_PASSWORD" | sed '1!s/^/ /')@localhost/$(printf %s "pan-test-app-review-$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })-api" | sed '1!s/^/ /')?host=/cloudsql/projectId:region:instancename
|
|
880
880
|
DATABASE_JDBC_URL: |-
|
|
881
|
-
jdbc:postgresql:///$
|
|
881
|
+
jdbc:postgresql:///$(printf %s "pan-test-app-review-$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })-api" | sed '1!s/^/ /')?cloudSqlInstance=projectId:region:instancename&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=my-user&password=$(printf %s "$CL_review_api_DB_PASSWORD" | sed '1!s/^/ /')
|
|
882
882
|
DEPLOY_CLOUD_RUN_SERVICE_NAME: |-
|
|
883
883
|
$(printf %s "$(printf %s "pan-test-app-review-$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })-api" | awk '{print tolower($0)}')" | sed '1!s/^/ /')
|
|
884
884
|
DEPLOY_CLOUD_RUN_PROJECT_ID: |-
|
|
@@ -996,8 +996,8 @@ before_script:
|
|
|
996
996
|
- export DB_NAME="pan-test-app-stage-api"
|
|
997
997
|
- export DB_USER="my-user"
|
|
998
998
|
- export DB_PASSWORD="$CL_stage_api_DB_PASSWORD"
|
|
999
|
-
- export DATABASE_URL="postgresql
|
|
1000
|
-
- export DATABASE_JDBC_URL="jdbc:postgresql
|
|
999
|
+
- export DATABASE_URL="postgresql://my-user:$CL_stage_api_DB_PASSWORD@localhost/pan-test-app-stage-api?host=/cloudsql/projectId:region:instancename"
|
|
1000
|
+
- export DATABASE_JDBC_URL="jdbc:postgresql:///pan-test-app-stage-api?cloudSqlInstance=projectId:region:instancename&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=my-user&password=$CL_stage_api_DB_PASSWORD"
|
|
1001
1001
|
- export DEPLOY_CLOUD_RUN_SERVICE_NAME="pan-test-app-stage-api"
|
|
1002
1002
|
- export DEPLOY_CLOUD_RUN_PROJECT_ID="google-project-id"
|
|
1003
1003
|
- export DEPLOY_CLOUD_RUN_REGION="europe-west6"
|
|
@@ -1019,8 +1019,8 @@ before_script:
|
|
|
1019
1019
|
DB_NAME=pan-test-app-stage-api
|
|
1020
1020
|
DB_USER=my-user
|
|
1021
1021
|
DB_PASSWORD=$(printf %s "$CL_stage_api_DB_PASSWORD" | escapeForDotEnv)
|
|
1022
|
-
DATABASE_URL
|
|
1023
|
-
DATABASE_JDBC_URL
|
|
1022
|
+
DATABASE_URL=$(printf %s "postgresql://my-user:$CL_stage_api_DB_PASSWORD@localhost/pan-test-app-stage-api?host=/cloudsql/projectId:region:instancename" | escapeForDotEnv)
|
|
1023
|
+
DATABASE_JDBC_URL=$(printf %s "jdbc:postgresql:///pan-test-app-stage-api?cloudSqlInstance=projectId:region:instancename&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=my-user&password=$CL_stage_api_DB_PASSWORD" | escapeForDotEnv)
|
|
1024
1024
|
DEPLOY_CLOUD_RUN_SERVICE_NAME=pan-test-app-stage-api
|
|
1025
1025
|
DEPLOY_CLOUD_RUN_PROJECT_ID=google-project-id
|
|
1026
1026
|
DEPLOY_CLOUD_RUN_REGION=europe-west6
|
|
@@ -1156,8 +1156,8 @@ before_script:
|
|
|
1156
1156
|
- export DB_NAME="pan-test-app-stage-api"
|
|
1157
1157
|
- export DB_USER="my-user"
|
|
1158
1158
|
- export DB_PASSWORD="$CL_stage_api_DB_PASSWORD"
|
|
1159
|
-
- export DATABASE_URL="postgresql
|
|
1160
|
-
- export DATABASE_JDBC_URL="jdbc:postgresql
|
|
1159
|
+
- export DATABASE_URL="postgresql://my-user:$CL_stage_api_DB_PASSWORD@localhost/pan-test-app-stage-api?host=/cloudsql/projectId:region:instancename"
|
|
1160
|
+
- export DATABASE_JDBC_URL="jdbc:postgresql:///pan-test-app-stage-api?cloudSqlInstance=projectId:region:instancename&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=my-user&password=$CL_stage_api_DB_PASSWORD"
|
|
1161
1161
|
- export DEPLOY_CLOUD_RUN_SERVICE_NAME="pan-test-app-stage-api"
|
|
1162
1162
|
- export DEPLOY_CLOUD_RUN_PROJECT_ID="google-project-id"
|
|
1163
1163
|
- export DEPLOY_CLOUD_RUN_REGION="europe-west6"
|
|
@@ -1207,9 +1207,9 @@ before_script:
|
|
|
1207
1207
|
DB_PASSWORD: |-
|
|
1208
1208
|
$(printf %s "$CL_stage_api_DB_PASSWORD" | sed '1!s/^/ /')
|
|
1209
1209
|
DATABASE_URL: |-
|
|
1210
|
-
postgresql
|
|
1210
|
+
postgresql://my-user:$(printf %s "$CL_stage_api_DB_PASSWORD" | sed '1!s/^/ /')@localhost/pan-test-app-stage-api?host=/cloudsql/projectId:region:instancename
|
|
1211
1211
|
DATABASE_JDBC_URL: |-
|
|
1212
|
-
jdbc:postgresql
|
|
1212
|
+
jdbc:postgresql:///pan-test-app-stage-api?cloudSqlInstance=projectId:region:instancename&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=my-user&password=$(printf %s "$CL_stage_api_DB_PASSWORD" | sed '1!s/^/ /')
|
|
1213
1213
|
DEPLOY_CLOUD_RUN_SERVICE_NAME: |-
|
|
1214
1214
|
pan-test-app-stage-api
|
|
1215
1215
|
DEPLOY_CLOUD_RUN_PROJECT_ID: |-
|
|
@@ -1311,8 +1311,8 @@ before_script:
|
|
|
1311
1311
|
- export DB_NAME="pan-test-app-prod-api"
|
|
1312
1312
|
- export DB_USER="my-user"
|
|
1313
1313
|
- export DB_PASSWORD="$CL_prod_api_DB_PASSWORD"
|
|
1314
|
-
- export DATABASE_URL="postgresql
|
|
1315
|
-
- export DATABASE_JDBC_URL="jdbc:postgresql
|
|
1314
|
+
- export DATABASE_URL="postgresql://my-user:$CL_prod_api_DB_PASSWORD@localhost/pan-test-app-prod-api?host=/cloudsql/projectId:region:instancename"
|
|
1315
|
+
- export DATABASE_JDBC_URL="jdbc:postgresql:///pan-test-app-prod-api?cloudSqlInstance=projectId:region:instancename&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=my-user&password=$CL_prod_api_DB_PASSWORD"
|
|
1316
1316
|
- export DEPLOY_CLOUD_RUN_SERVICE_NAME="pan-test-app-prod-api"
|
|
1317
1317
|
- export DEPLOY_CLOUD_RUN_PROJECT_ID="google-project-id"
|
|
1318
1318
|
- export DEPLOY_CLOUD_RUN_REGION="europe-west6"
|
|
@@ -1334,8 +1334,8 @@ before_script:
|
|
|
1334
1334
|
DB_NAME=pan-test-app-prod-api
|
|
1335
1335
|
DB_USER=my-user
|
|
1336
1336
|
DB_PASSWORD=$(printf %s "$CL_prod_api_DB_PASSWORD" | escapeForDotEnv)
|
|
1337
|
-
DATABASE_URL
|
|
1338
|
-
DATABASE_JDBC_URL
|
|
1337
|
+
DATABASE_URL=$(printf %s "postgresql://my-user:$CL_prod_api_DB_PASSWORD@localhost/pan-test-app-prod-api?host=/cloudsql/projectId:region:instancename" | escapeForDotEnv)
|
|
1338
|
+
DATABASE_JDBC_URL=$(printf %s "jdbc:postgresql:///pan-test-app-prod-api?cloudSqlInstance=projectId:region:instancename&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=my-user&password=$CL_prod_api_DB_PASSWORD" | escapeForDotEnv)
|
|
1339
1339
|
DEPLOY_CLOUD_RUN_SERVICE_NAME=pan-test-app-prod-api
|
|
1340
1340
|
DEPLOY_CLOUD_RUN_PROJECT_ID=google-project-id
|
|
1341
1341
|
DEPLOY_CLOUD_RUN_REGION=europe-west6
|
|
@@ -1471,8 +1471,8 @@ before_script:
|
|
|
1471
1471
|
- export DB_NAME="pan-test-app-prod-api"
|
|
1472
1472
|
- export DB_USER="my-user"
|
|
1473
1473
|
- export DB_PASSWORD="$CL_prod_api_DB_PASSWORD"
|
|
1474
|
-
- export DATABASE_URL="postgresql
|
|
1475
|
-
- export DATABASE_JDBC_URL="jdbc:postgresql
|
|
1474
|
+
- export DATABASE_URL="postgresql://my-user:$CL_prod_api_DB_PASSWORD@localhost/pan-test-app-prod-api?host=/cloudsql/projectId:region:instancename"
|
|
1475
|
+
- export DATABASE_JDBC_URL="jdbc:postgresql:///pan-test-app-prod-api?cloudSqlInstance=projectId:region:instancename&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=my-user&password=$CL_prod_api_DB_PASSWORD"
|
|
1476
1476
|
- export DEPLOY_CLOUD_RUN_SERVICE_NAME="pan-test-app-prod-api"
|
|
1477
1477
|
- export DEPLOY_CLOUD_RUN_PROJECT_ID="google-project-id"
|
|
1478
1478
|
- export DEPLOY_CLOUD_RUN_REGION="europe-west6"
|
|
@@ -1522,9 +1522,9 @@ before_script:
|
|
|
1522
1522
|
DB_PASSWORD: |-
|
|
1523
1523
|
$(printf %s "$CL_prod_api_DB_PASSWORD" | sed '1!s/^/ /')
|
|
1524
1524
|
DATABASE_URL: |-
|
|
1525
|
-
postgresql
|
|
1525
|
+
postgresql://my-user:$(printf %s "$CL_prod_api_DB_PASSWORD" | sed '1!s/^/ /')@localhost/pan-test-app-prod-api?host=/cloudsql/projectId:region:instancename
|
|
1526
1526
|
DATABASE_JDBC_URL: |-
|
|
1527
|
-
jdbc:postgresql
|
|
1527
|
+
jdbc:postgresql:///pan-test-app-prod-api?cloudSqlInstance=projectId:region:instancename&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=my-user&password=$(printf %s "$CL_prod_api_DB_PASSWORD" | sed '1!s/^/ /')
|
|
1528
1528
|
DEPLOY_CLOUD_RUN_SERVICE_NAME: |-
|
|
1529
1529
|
pan-test-app-prod-api
|
|
1530
1530
|
DEPLOY_CLOUD_RUN_PROJECT_ID: |-
|
|
@@ -1727,8 +1727,8 @@ before_script:
|
|
|
1727
1727
|
- export DB_NAME="pan-test-app-dev-api"
|
|
1728
1728
|
- export DB_USER="my-user"
|
|
1729
1729
|
- export DB_PASSWORD="$CL_dev_api_DB_PASSWORD"
|
|
1730
|
-
- export DATABASE_URL="postgresql
|
|
1731
|
-
- export DATABASE_JDBC_URL="jdbc:postgresql
|
|
1730
|
+
- export DATABASE_URL="postgresql://my-user:$CL_dev_api_DB_PASSWORD@localhost/pan-test-app-dev-api?host=/cloudsql/projectId:region:instancename"
|
|
1731
|
+
- export DATABASE_JDBC_URL="jdbc:postgresql:///pan-test-app-dev-api?cloudSqlInstance=projectId:region:instancename&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=my-user&password=$CL_dev_api_DB_PASSWORD"
|
|
1732
1732
|
- export DEPLOY_CLOUD_RUN_SERVICE_NAME="pan-test-app-dev-worker"
|
|
1733
1733
|
- export DEPLOY_CLOUD_RUN_PROJECT_ID="google-project-id"
|
|
1734
1734
|
- export DEPLOY_CLOUD_RUN_REGION="europe-west6"
|
|
@@ -1750,8 +1750,8 @@ before_script:
|
|
|
1750
1750
|
DB_NAME=pan-test-app-dev-api
|
|
1751
1751
|
DB_USER=my-user
|
|
1752
1752
|
DB_PASSWORD=$(printf %s "$CL_dev_api_DB_PASSWORD" | escapeForDotEnv)
|
|
1753
|
-
DATABASE_URL
|
|
1754
|
-
DATABASE_JDBC_URL
|
|
1753
|
+
DATABASE_URL=$(printf %s "postgresql://my-user:$CL_dev_api_DB_PASSWORD@localhost/pan-test-app-dev-api?host=/cloudsql/projectId:region:instancename" | escapeForDotEnv)
|
|
1754
|
+
DATABASE_JDBC_URL=$(printf %s "jdbc:postgresql:///pan-test-app-dev-api?cloudSqlInstance=projectId:region:instancename&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=my-user&password=$CL_dev_api_DB_PASSWORD" | escapeForDotEnv)
|
|
1755
1755
|
DEPLOY_CLOUD_RUN_SERVICE_NAME=pan-test-app-dev-worker
|
|
1756
1756
|
DEPLOY_CLOUD_RUN_PROJECT_ID=google-project-id
|
|
1757
1757
|
DEPLOY_CLOUD_RUN_REGION=europe-west6
|
|
@@ -1887,8 +1887,8 @@ before_script:
|
|
|
1887
1887
|
- export DB_NAME="pan-test-app-dev-api"
|
|
1888
1888
|
- export DB_USER="my-user"
|
|
1889
1889
|
- export DB_PASSWORD="$CL_dev_api_DB_PASSWORD"
|
|
1890
|
-
- export DATABASE_URL="postgresql
|
|
1891
|
-
- export DATABASE_JDBC_URL="jdbc:postgresql
|
|
1890
|
+
- export DATABASE_URL="postgresql://my-user:$CL_dev_api_DB_PASSWORD@localhost/pan-test-app-dev-api?host=/cloudsql/projectId:region:instancename"
|
|
1891
|
+
- export DATABASE_JDBC_URL="jdbc:postgresql:///pan-test-app-dev-api?cloudSqlInstance=projectId:region:instancename&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=my-user&password=$CL_dev_api_DB_PASSWORD"
|
|
1892
1892
|
- export DEPLOY_CLOUD_RUN_SERVICE_NAME="pan-test-app-dev-worker"
|
|
1893
1893
|
- export DEPLOY_CLOUD_RUN_PROJECT_ID="google-project-id"
|
|
1894
1894
|
- export DEPLOY_CLOUD_RUN_REGION="europe-west6"
|
|
@@ -1938,9 +1938,9 @@ before_script:
|
|
|
1938
1938
|
DB_PASSWORD: |-
|
|
1939
1939
|
$(printf %s "$CL_dev_api_DB_PASSWORD" | sed '1!s/^/ /')
|
|
1940
1940
|
DATABASE_URL: |-
|
|
1941
|
-
postgresql
|
|
1941
|
+
postgresql://my-user:$(printf %s "$CL_dev_api_DB_PASSWORD" | sed '1!s/^/ /')@localhost/pan-test-app-dev-api?host=/cloudsql/projectId:region:instancename
|
|
1942
1942
|
DATABASE_JDBC_URL: |-
|
|
1943
|
-
jdbc:postgresql
|
|
1943
|
+
jdbc:postgresql:///pan-test-app-dev-api?cloudSqlInstance=projectId:region:instancename&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=my-user&password=$(printf %s "$CL_dev_api_DB_PASSWORD" | sed '1!s/^/ /')
|
|
1944
1944
|
DEPLOY_CLOUD_RUN_SERVICE_NAME: |-
|
|
1945
1945
|
pan-test-app-dev-worker
|
|
1946
1946
|
DEPLOY_CLOUD_RUN_PROJECT_ID: |-
|
|
@@ -2158,8 +2158,8 @@ before_script:
|
|
|
2158
2158
|
- export DB_NAME="pan-test-app-review-$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })-api"
|
|
2159
2159
|
- export DB_USER="my-user"
|
|
2160
2160
|
- export DB_PASSWORD="$CL_review_api_DB_PASSWORD"
|
|
2161
|
-
- export DATABASE_URL="postgresql
|
|
2162
|
-
- export DATABASE_JDBC_URL="jdbc:postgresql
|
|
2161
|
+
- export DATABASE_URL="postgresql://my-user:$CL_review_api_DB_PASSWORD@localhost/pan-test-app-review-$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })-api?host=/cloudsql/projectId:region:instancename"
|
|
2162
|
+
- export DATABASE_JDBC_URL="jdbc:postgresql:///pan-test-app-review-$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })-api?cloudSqlInstance=projectId:region:instancename&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=my-user&password=$CL_review_api_DB_PASSWORD"
|
|
2163
2163
|
- export DEPLOY_CLOUD_RUN_SERVICE_NAME="$(printf %s "pan-test-app-review-$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })-worker" | awk '{print tolower($0)}')"
|
|
2164
2164
|
- export DEPLOY_CLOUD_RUN_PROJECT_ID="google-project-id"
|
|
2165
2165
|
- export DEPLOY_CLOUD_RUN_REGION="europe-west6"
|
|
@@ -2181,8 +2181,8 @@ before_script:
|
|
|
2181
2181
|
DB_NAME=$(printf %s "pan-test-app-review-$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })-api" | escapeForDotEnv)
|
|
2182
2182
|
DB_USER=my-user
|
|
2183
2183
|
DB_PASSWORD=$(printf %s "$CL_review_api_DB_PASSWORD" | escapeForDotEnv)
|
|
2184
|
-
DATABASE_URL
|
|
2185
|
-
DATABASE_JDBC_URL
|
|
2184
|
+
DATABASE_URL=$(printf %s "postgresql://my-user:$CL_review_api_DB_PASSWORD@localhost/pan-test-app-review-$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })-api?host=/cloudsql/projectId:region:instancename" | escapeForDotEnv)
|
|
2185
|
+
DATABASE_JDBC_URL=$(printf %s "jdbc:postgresql:///pan-test-app-review-$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })-api?cloudSqlInstance=projectId:region:instancename&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=my-user&password=$CL_review_api_DB_PASSWORD" | escapeForDotEnv)
|
|
2186
2186
|
DEPLOY_CLOUD_RUN_SERVICE_NAME=$(printf %s "$(printf %s "pan-test-app-review-$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })-worker" | awk '{print tolower($0)}')" | escapeForDotEnv)
|
|
2187
2187
|
DEPLOY_CLOUD_RUN_PROJECT_ID=google-project-id
|
|
2188
2188
|
DEPLOY_CLOUD_RUN_REGION=europe-west6
|
|
@@ -2324,8 +2324,8 @@ before_script:
|
|
|
2324
2324
|
- export DB_NAME="pan-test-app-review-$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })-api"
|
|
2325
2325
|
- export DB_USER="my-user"
|
|
2326
2326
|
- export DB_PASSWORD="$CL_review_api_DB_PASSWORD"
|
|
2327
|
-
- export DATABASE_URL="postgresql
|
|
2328
|
-
- export DATABASE_JDBC_URL="jdbc:postgresql
|
|
2327
|
+
- export DATABASE_URL="postgresql://my-user:$CL_review_api_DB_PASSWORD@localhost/pan-test-app-review-$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })-api?host=/cloudsql/projectId:region:instancename"
|
|
2328
|
+
- export DATABASE_JDBC_URL="jdbc:postgresql:///pan-test-app-review-$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })-api?cloudSqlInstance=projectId:region:instancename&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=my-user&password=$CL_review_api_DB_PASSWORD"
|
|
2329
2329
|
- export DEPLOY_CLOUD_RUN_SERVICE_NAME="$(printf %s "pan-test-app-review-$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })-worker" | awk '{print tolower($0)}')"
|
|
2330
2330
|
- export DEPLOY_CLOUD_RUN_PROJECT_ID="google-project-id"
|
|
2331
2331
|
- export DEPLOY_CLOUD_RUN_REGION="europe-west6"
|
|
@@ -2375,9 +2375,9 @@ before_script:
|
|
|
2375
2375
|
DB_PASSWORD: |-
|
|
2376
2376
|
$(printf %s "$CL_review_api_DB_PASSWORD" | sed '1!s/^/ /')
|
|
2377
2377
|
DATABASE_URL: |-
|
|
2378
|
-
postgresql
|
|
2378
|
+
postgresql://my-user:$(printf %s "$CL_review_api_DB_PASSWORD" | sed '1!s/^/ /')@localhost/$(printf %s "pan-test-app-review-$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })-api" | sed '1!s/^/ /')?host=/cloudsql/projectId:region:instancename
|
|
2379
2379
|
DATABASE_JDBC_URL: |-
|
|
2380
|
-
jdbc:postgresql:///$
|
|
2380
|
+
jdbc:postgresql:///$(printf %s "pan-test-app-review-$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })-api" | sed '1!s/^/ /')?cloudSqlInstance=projectId:region:instancename&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=my-user&password=$(printf %s "$CL_review_api_DB_PASSWORD" | sed '1!s/^/ /')
|
|
2381
2381
|
DEPLOY_CLOUD_RUN_SERVICE_NAME: |-
|
|
2382
2382
|
$(printf %s "$(printf %s "pan-test-app-review-$([ -n "$CI_MERGE_REQUEST_IID" ] && echo "mr$CI_MERGE_REQUEST_IID" || { [ -n "$CI_COMMIT_REF_SLUG" ] && echo "$CI_COMMIT_REF_SLUG" || echo "unknown"; })-worker" | awk '{print tolower($0)}')" | sed '1!s/^/ /')
|
|
2383
2383
|
DEPLOY_CLOUD_RUN_PROJECT_ID: |-
|
|
@@ -2495,8 +2495,8 @@ before_script:
|
|
|
2495
2495
|
- export DB_NAME="pan-test-app-stage-api"
|
|
2496
2496
|
- export DB_USER="my-user"
|
|
2497
2497
|
- export DB_PASSWORD="$CL_stage_api_DB_PASSWORD"
|
|
2498
|
-
- export DATABASE_URL="postgresql
|
|
2499
|
-
- export DATABASE_JDBC_URL="jdbc:postgresql
|
|
2498
|
+
- export DATABASE_URL="postgresql://my-user:$CL_stage_api_DB_PASSWORD@localhost/pan-test-app-stage-api?host=/cloudsql/projectId:region:instancename"
|
|
2499
|
+
- export DATABASE_JDBC_URL="jdbc:postgresql:///pan-test-app-stage-api?cloudSqlInstance=projectId:region:instancename&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=my-user&password=$CL_stage_api_DB_PASSWORD"
|
|
2500
2500
|
- export DEPLOY_CLOUD_RUN_SERVICE_NAME="pan-test-app-stage-worker"
|
|
2501
2501
|
- export DEPLOY_CLOUD_RUN_PROJECT_ID="google-project-id"
|
|
2502
2502
|
- export DEPLOY_CLOUD_RUN_REGION="europe-west6"
|
|
@@ -2518,8 +2518,8 @@ before_script:
|
|
|
2518
2518
|
DB_NAME=pan-test-app-stage-api
|
|
2519
2519
|
DB_USER=my-user
|
|
2520
2520
|
DB_PASSWORD=$(printf %s "$CL_stage_api_DB_PASSWORD" | escapeForDotEnv)
|
|
2521
|
-
DATABASE_URL
|
|
2522
|
-
DATABASE_JDBC_URL
|
|
2521
|
+
DATABASE_URL=$(printf %s "postgresql://my-user:$CL_stage_api_DB_PASSWORD@localhost/pan-test-app-stage-api?host=/cloudsql/projectId:region:instancename" | escapeForDotEnv)
|
|
2522
|
+
DATABASE_JDBC_URL=$(printf %s "jdbc:postgresql:///pan-test-app-stage-api?cloudSqlInstance=projectId:region:instancename&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=my-user&password=$CL_stage_api_DB_PASSWORD" | escapeForDotEnv)
|
|
2523
2523
|
DEPLOY_CLOUD_RUN_SERVICE_NAME=pan-test-app-stage-worker
|
|
2524
2524
|
DEPLOY_CLOUD_RUN_PROJECT_ID=google-project-id
|
|
2525
2525
|
DEPLOY_CLOUD_RUN_REGION=europe-west6
|
|
@@ -2655,8 +2655,8 @@ before_script:
|
|
|
2655
2655
|
- export DB_NAME="pan-test-app-stage-api"
|
|
2656
2656
|
- export DB_USER="my-user"
|
|
2657
2657
|
- export DB_PASSWORD="$CL_stage_api_DB_PASSWORD"
|
|
2658
|
-
- export DATABASE_URL="postgresql
|
|
2659
|
-
- export DATABASE_JDBC_URL="jdbc:postgresql
|
|
2658
|
+
- export DATABASE_URL="postgresql://my-user:$CL_stage_api_DB_PASSWORD@localhost/pan-test-app-stage-api?host=/cloudsql/projectId:region:instancename"
|
|
2659
|
+
- export DATABASE_JDBC_URL="jdbc:postgresql:///pan-test-app-stage-api?cloudSqlInstance=projectId:region:instancename&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=my-user&password=$CL_stage_api_DB_PASSWORD"
|
|
2660
2660
|
- export DEPLOY_CLOUD_RUN_SERVICE_NAME="pan-test-app-stage-worker"
|
|
2661
2661
|
- export DEPLOY_CLOUD_RUN_PROJECT_ID="google-project-id"
|
|
2662
2662
|
- export DEPLOY_CLOUD_RUN_REGION="europe-west6"
|
|
@@ -2706,9 +2706,9 @@ before_script:
|
|
|
2706
2706
|
DB_PASSWORD: |-
|
|
2707
2707
|
$(printf %s "$CL_stage_api_DB_PASSWORD" | sed '1!s/^/ /')
|
|
2708
2708
|
DATABASE_URL: |-
|
|
2709
|
-
postgresql
|
|
2709
|
+
postgresql://my-user:$(printf %s "$CL_stage_api_DB_PASSWORD" | sed '1!s/^/ /')@localhost/pan-test-app-stage-api?host=/cloudsql/projectId:region:instancename
|
|
2710
2710
|
DATABASE_JDBC_URL: |-
|
|
2711
|
-
jdbc:postgresql
|
|
2711
|
+
jdbc:postgresql:///pan-test-app-stage-api?cloudSqlInstance=projectId:region:instancename&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=my-user&password=$(printf %s "$CL_stage_api_DB_PASSWORD" | sed '1!s/^/ /')
|
|
2712
2712
|
DEPLOY_CLOUD_RUN_SERVICE_NAME: |-
|
|
2713
2713
|
pan-test-app-stage-worker
|
|
2714
2714
|
DEPLOY_CLOUD_RUN_PROJECT_ID: |-
|
|
@@ -2810,8 +2810,8 @@ before_script:
|
|
|
2810
2810
|
- export DB_NAME="pan-test-app-prod-api"
|
|
2811
2811
|
- export DB_USER="my-user"
|
|
2812
2812
|
- export DB_PASSWORD="$CL_prod_api_DB_PASSWORD"
|
|
2813
|
-
- export DATABASE_URL="postgresql
|
|
2814
|
-
- export DATABASE_JDBC_URL="jdbc:postgresql
|
|
2813
|
+
- export DATABASE_URL="postgresql://my-user:$CL_prod_api_DB_PASSWORD@localhost/pan-test-app-prod-api?host=/cloudsql/projectId:region:instancename"
|
|
2814
|
+
- export DATABASE_JDBC_URL="jdbc:postgresql:///pan-test-app-prod-api?cloudSqlInstance=projectId:region:instancename&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=my-user&password=$CL_prod_api_DB_PASSWORD"
|
|
2815
2815
|
- export DEPLOY_CLOUD_RUN_SERVICE_NAME="pan-test-app-prod-worker"
|
|
2816
2816
|
- export DEPLOY_CLOUD_RUN_PROJECT_ID="google-project-id"
|
|
2817
2817
|
- export DEPLOY_CLOUD_RUN_REGION="europe-west6"
|
|
@@ -2833,8 +2833,8 @@ before_script:
|
|
|
2833
2833
|
DB_NAME=pan-test-app-prod-api
|
|
2834
2834
|
DB_USER=my-user
|
|
2835
2835
|
DB_PASSWORD=$(printf %s "$CL_prod_api_DB_PASSWORD" | escapeForDotEnv)
|
|
2836
|
-
DATABASE_URL
|
|
2837
|
-
DATABASE_JDBC_URL
|
|
2836
|
+
DATABASE_URL=$(printf %s "postgresql://my-user:$CL_prod_api_DB_PASSWORD@localhost/pan-test-app-prod-api?host=/cloudsql/projectId:region:instancename" | escapeForDotEnv)
|
|
2837
|
+
DATABASE_JDBC_URL=$(printf %s "jdbc:postgresql:///pan-test-app-prod-api?cloudSqlInstance=projectId:region:instancename&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=my-user&password=$CL_prod_api_DB_PASSWORD" | escapeForDotEnv)
|
|
2838
2838
|
DEPLOY_CLOUD_RUN_SERVICE_NAME=pan-test-app-prod-worker
|
|
2839
2839
|
DEPLOY_CLOUD_RUN_PROJECT_ID=google-project-id
|
|
2840
2840
|
DEPLOY_CLOUD_RUN_REGION=europe-west6
|
|
@@ -2970,8 +2970,8 @@ before_script:
|
|
|
2970
2970
|
- export DB_NAME="pan-test-app-prod-api"
|
|
2971
2971
|
- export DB_USER="my-user"
|
|
2972
2972
|
- export DB_PASSWORD="$CL_prod_api_DB_PASSWORD"
|
|
2973
|
-
- export DATABASE_URL="postgresql
|
|
2974
|
-
- export DATABASE_JDBC_URL="jdbc:postgresql
|
|
2973
|
+
- export DATABASE_URL="postgresql://my-user:$CL_prod_api_DB_PASSWORD@localhost/pan-test-app-prod-api?host=/cloudsql/projectId:region:instancename"
|
|
2974
|
+
- export DATABASE_JDBC_URL="jdbc:postgresql:///pan-test-app-prod-api?cloudSqlInstance=projectId:region:instancename&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=my-user&password=$CL_prod_api_DB_PASSWORD"
|
|
2975
2975
|
- export DEPLOY_CLOUD_RUN_SERVICE_NAME="pan-test-app-prod-worker"
|
|
2976
2976
|
- export DEPLOY_CLOUD_RUN_PROJECT_ID="google-project-id"
|
|
2977
2977
|
- export DEPLOY_CLOUD_RUN_REGION="europe-west6"
|
|
@@ -3021,9 +3021,9 @@ before_script:
|
|
|
3021
3021
|
DB_PASSWORD: |-
|
|
3022
3022
|
$(printf %s "$CL_prod_api_DB_PASSWORD" | sed '1!s/^/ /')
|
|
3023
3023
|
DATABASE_URL: |-
|
|
3024
|
-
postgresql
|
|
3024
|
+
postgresql://my-user:$(printf %s "$CL_prod_api_DB_PASSWORD" | sed '1!s/^/ /')@localhost/pan-test-app-prod-api?host=/cloudsql/projectId:region:instancename
|
|
3025
3025
|
DATABASE_JDBC_URL: |-
|
|
3026
|
-
jdbc:postgresql
|
|
3026
|
+
jdbc:postgresql:///pan-test-app-prod-api?cloudSqlInstance=projectId:region:instancename&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=my-user&password=$(printf %s "$CL_prod_api_DB_PASSWORD" | sed '1!s/^/ /')
|
|
3027
3027
|
DEPLOY_CLOUD_RUN_SERVICE_NAME: |-
|
|
3028
3028
|
pan-test-app-prod-worker
|
|
3029
3029
|
DEPLOY_CLOUD_RUN_PROJECT_ID: |-
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { it, expect } from "vitest";
|
|
2
|
+
import { createYamlLocalPipeline } from "./__utils__/helpers";
|
|
3
|
+
import config from "./cloud-run-verify";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* This test is auto-generated.
|
|
7
|
+
* Modifications will be overwritten on every `yarn test` run!
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
it("matches snapshot for cloud-run-verify local pipeline YAML", async () => {
|
|
11
|
+
expect(await createYamlLocalPipeline(config)).toMatchSnapshot();
|
|
12
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Config } from "../src";
|
|
2
|
+
|
|
3
|
+
const config = {
|
|
4
|
+
appName: "test-app",
|
|
5
|
+
customerName: "pan",
|
|
6
|
+
components: {
|
|
7
|
+
db: {
|
|
8
|
+
dir: "db",
|
|
9
|
+
build: {
|
|
10
|
+
type: "node",
|
|
11
|
+
},
|
|
12
|
+
deploy: {
|
|
13
|
+
type: "google-cloudrun",
|
|
14
|
+
projectId: "asdf",
|
|
15
|
+
region: "asia-east1",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
api: {
|
|
19
|
+
dir: "api",
|
|
20
|
+
build: {
|
|
21
|
+
type: "node",
|
|
22
|
+
},
|
|
23
|
+
deploy: {
|
|
24
|
+
type: "google-cloudrun",
|
|
25
|
+
projectId: "asdf",
|
|
26
|
+
region: "asia-east1",
|
|
27
|
+
service: {
|
|
28
|
+
allowUnauthenticated: false,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
verify: {
|
|
32
|
+
command: "yarn e2e",
|
|
33
|
+
waitFor: ["db"],
|
|
34
|
+
},
|
|
35
|
+
env: {
|
|
36
|
+
prod: {
|
|
37
|
+
verify: false,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
} satisfies Config;
|
|
43
|
+
|
|
44
|
+
export default config;
|
|
45
|
+
|
|
46
|
+
export const information = {
|
|
47
|
+
title: "Cloud Run: Post-deploy verify",
|
|
48
|
+
description:
|
|
49
|
+
"Runs an e2e suite in the verify stage after each deploy. The verify job waits for the db component's deploy, authenticates via application default credentials because the service is non-public, and is disabled for prod.",
|
|
50
|
+
};
|
|
@@ -4,6 +4,10 @@ const CLOUD_SQL: DeployConfigCloudRunCloudSql = {
|
|
|
4
4
|
type: "unmanaged",
|
|
5
5
|
instanceConnectionName: "projectId:region:instancename",
|
|
6
6
|
dbUser: "my-user",
|
|
7
|
+
// embed the final values into DATABASE_URL. This also picks up the
|
|
8
|
+
// DB_PASSWORD override below, so the connection string contains the
|
|
9
|
+
// password of the component that owns the database
|
|
10
|
+
dbConnectionStringVariablesMode: "embedded",
|
|
7
11
|
};
|
|
8
12
|
const config = {
|
|
9
13
|
appName: "test-app",
|
package/package.json
CHANGED
|
@@ -85,8 +85,10 @@ export const getEnvironmentVariables = async (
|
|
|
85
85
|
)
|
|
86
86
|
: {};
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
// deploy types provide HOSTNAME_INTERNAL as a plain string or bash
|
|
89
|
+
// expression (never containing references)
|
|
90
|
+
const HOSTNAME_INTERNAL = (additionalEnvVars.HOSTNAME_INTERNAL ??
|
|
91
|
+
"unknown-host.example.com") as StringOrBashExpression;
|
|
90
92
|
|
|
91
93
|
host = envConfigRaw?.host ?? HOSTNAME_INTERNAL;
|
|
92
94
|
url = joinBashExpressions(["https://", host]);
|
|
@@ -129,10 +131,21 @@ export const getEnvironmentVariables = async (
|
|
|
129
131
|
]),
|
|
130
132
|
);
|
|
131
133
|
|
|
132
|
-
|
|
134
|
+
// predefined variables may contain references too (e.g. the embedded
|
|
135
|
+
// database connection string references the component's own DB_* vars), so
|
|
136
|
+
// we resolve references over the merged map. This way public var overrides
|
|
137
|
+
// (like DB_PASSWORD: "${otherComponent:DB_PASSWORD}") are picked up by the
|
|
138
|
+
// predefined variables that reference them
|
|
139
|
+
const mergedEnvVars = {
|
|
140
|
+
...predefinedVariables,
|
|
141
|
+
...secretEnvVars,
|
|
142
|
+
...publicEnvVarsUnresolved,
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
const resolvedEnvVars =
|
|
133
146
|
(options.shouldResolveReferences ?? true)
|
|
134
147
|
? await resolveAllReferences(
|
|
135
|
-
|
|
148
|
+
mergedEnvVars,
|
|
136
149
|
async (otherComponentName) => {
|
|
137
150
|
const { envVars: otherEnvVars } = await getEnvironmentVariables(
|
|
138
151
|
{
|
|
@@ -146,13 +159,9 @@ export const getEnvironmentVariables = async (
|
|
|
146
159
|
return otherEnvVars;
|
|
147
160
|
},
|
|
148
161
|
)
|
|
149
|
-
:
|
|
162
|
+
: mergedEnvVars;
|
|
150
163
|
|
|
151
|
-
const envVars = addIndexVar(
|
|
152
|
-
...predefinedVariables,
|
|
153
|
-
...secretEnvVars,
|
|
154
|
-
...publicEnvVars,
|
|
155
|
-
});
|
|
164
|
+
const envVars = addIndexVar(resolvedEnvVars);
|
|
156
165
|
|
|
157
166
|
return {
|
|
158
167
|
envVars,
|
|
@@ -6,7 +6,10 @@ import {
|
|
|
6
6
|
import type { BuildConfig } from "../../build";
|
|
7
7
|
import { getSecretVarName } from "../../context";
|
|
8
8
|
import type { EnvironmentContext } from "../../types/environmentContext";
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
collapseableSection,
|
|
11
|
+
sanitizeForBashVariable,
|
|
12
|
+
} from "../../utils/gitlab";
|
|
10
13
|
import { getFullDbName } from "../cloudSql/utils";
|
|
11
14
|
import { createGoogleCloudRunDeployJobs } from "./createJobs";
|
|
12
15
|
import { getCloudRunJobExecuteUrl } from "./utils/cloudRunExecutionUrl";
|
|
@@ -56,11 +59,13 @@ const getCloudSqlVariables = ({
|
|
|
56
59
|
DATABASE_URL: getDatabaseConnectionString(
|
|
57
60
|
deployConfigRaw.cloudSql,
|
|
58
61
|
dbVars,
|
|
62
|
+
componentName,
|
|
59
63
|
).concat(additionalQueryParamsString),
|
|
60
64
|
DATABASE_JDBC_URL: getDatabaseJdbcUrl(
|
|
61
65
|
dbVars,
|
|
62
66
|
deployConfigRaw.cloudSql.dbConnectionStringVariablesMode ??
|
|
63
67
|
DEFAULT_DB_VARIABLES_MODE,
|
|
68
|
+
componentName,
|
|
64
69
|
),
|
|
65
70
|
};
|
|
66
71
|
}
|
|
@@ -137,4 +142,23 @@ export const GCLOUD_RUN_DEPLOY_TYPE: DeployTypeDefinition<DeployConfigCloudRun>
|
|
|
137
142
|
: undefined,
|
|
138
143
|
};
|
|
139
144
|
},
|
|
145
|
+
verifyJobSetupScript: (context) => {
|
|
146
|
+
const deployConfig = context.deploy?.config as
|
|
147
|
+
| DeployConfigCloudRun
|
|
148
|
+
| undefined;
|
|
149
|
+
const service = deployConfig?.service;
|
|
150
|
+
const serviceConfig = typeof service === "object" ? service : undefined;
|
|
151
|
+
if (serviceConfig?.allowUnauthenticated !== false) {
|
|
152
|
+
return [];
|
|
153
|
+
}
|
|
154
|
+
// the service requires IAM auth: provide application default credentials
|
|
155
|
+
// so the verify command can fetch identity tokens for the deployed service
|
|
156
|
+
return collapseableSection(
|
|
157
|
+
"verifygcloudauth",
|
|
158
|
+
"Setup google application credentials",
|
|
159
|
+
)([
|
|
160
|
+
`echo "$${GCLOUD_DEPLOY_CREDENTIALS_KEY}" > "$CI_PROJECT_DIR/.gcloud-sa.json"`,
|
|
161
|
+
`export GOOGLE_APPLICATION_CREDENTIALS="$CI_PROJECT_DIR/.gcloud-sa.json"`,
|
|
162
|
+
]);
|
|
163
|
+
},
|
|
140
164
|
};
|