@catladder/pipeline 1.123.1 → 1.124.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/build/custom/buildJob.js +1 -1
- package/dist/build/docker.d.ts +26 -6
- package/dist/build/docker.js +53 -8
- package/dist/build/node/buildJob.js +1 -1
- package/dist/build/node/meteor.js +1 -1
- package/dist/build/rails/build.js +12 -3
- package/dist/bundles/catladder-gitlab/index.js +3 -3
- package/dist/constants.js +1 -1
- package/dist/deploy/cloudRun/artifactsRegistry.d.ts +7 -4
- package/dist/deploy/cloudRun/artifactsRegistry.js +30 -23
- package/dist/deploy/cloudRun/deployJob.js +1 -1
- package/dist/deploy/dockerTag/deployJob.js +32 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/examples/__snapshots__/cloud-run-memory-limit.ts.snap +72 -76
- package/examples/__snapshots__/cloud-run-no-cpu-throttling.ts.snap +72 -76
- package/examples/__snapshots__/cloud-run-non-public.ts.snap +72 -76
- package/examples/__snapshots__/cloud-run-with-sql-reuse-db.ts.snap +144 -152
- package/examples/__snapshots__/cloud-run-with-sql.ts.snap +144 -152
- package/examples/__snapshots__/custom-build-job-with-tests.ts.snap +72 -76
- package/examples/__snapshots__/custom-build-job.ts.snap +72 -76
- package/examples/__snapshots__/custom-deploy.ts.snap +40 -28
- package/examples/__snapshots__/custom-sbom-java.ts.snap +72 -76
- package/examples/__snapshots__/kubernetes-application-customization.ts.snap +40 -28
- package/examples/__snapshots__/kubernetes-with-cloud-sql-legacy.ts.snap +40 -28
- package/examples/__snapshots__/kubernetes-with-cloud-sql.ts.snap +40 -28
- package/examples/__snapshots__/kubernetes-with-jobs.ts.snap +80 -56
- package/examples/__snapshots__/kubernetes-with-mongodb.ts.snap +40 -28
- package/examples/__snapshots__/meteor-kubernetes.ts.snap +40 -28
- package/examples/__snapshots__/native-app.ts.snap +72 -76
- package/examples/__snapshots__/node-build-with-custom-image.ts.snap +72 -76
- package/examples/__snapshots__/rails-k8s-with-worker.ts.snap +56 -52
- package/package.json +1 -1
- package/src/build/custom/buildJob.ts +1 -0
- package/src/build/docker.ts +56 -16
- package/src/build/node/buildJob.ts +1 -0
- package/src/build/node/meteor.ts +1 -1
- package/src/build/rails/build.ts +2 -2
- package/src/deploy/cloudRun/artifactsRegistry.ts +35 -32
- package/src/deploy/cloudRun/deployJob.ts +1 -8
- package/src/deploy/dockerTag/deployJob.ts +1 -1
|
@@ -70,12 +70,20 @@ exports[`matches snapshot 1`] = `
|
|
|
70
70
|
},
|
|
71
71
|
"script": [
|
|
72
72
|
"ensureNginxDockerfile",
|
|
73
|
-
"
|
|
74
|
-
"
|
|
73
|
+
"echo -e "\\e[0Ksection_start:$(date +%s):docker-login[collapsed=true]\\r\\e[0KDocker Login"",
|
|
74
|
+
"echo $CL_dev_www_GCLOUD_DEPLOY_credentialsKey > ./____keyfile.json
|
|
75
|
+
",
|
|
76
|
+
"gcloud auth activate-service-account --key-file="./____keyfile.json"",
|
|
77
|
+
"gcloud auth configure-docker asia-east1-docker.pkg.dev",
|
|
78
|
+
"echo -e "\\e[0Ksection_end:$(date +%s):docker-login\\r\\e[0K"",
|
|
79
|
+
"echo -e "\\e[0Ksection_start:$(date +%s):docker-build[collapsed=true]\\r\\e[0KDocker build"",
|
|
75
80
|
"docker build --network host --cache-from $DOCKER_CACHE_IMAGE --tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG -f $APP_DIR/Dockerfile . --build-arg BUILDKIT_INLINE_CACHE=1",
|
|
81
|
+
"echo -e "\\e[0Ksection_end:$(date +%s):docker-build\\r\\e[0K"",
|
|
82
|
+
"echo -e "\\e[0Ksection_start:$(date +%s):docker-push[collapsed=true]\\r\\e[0KDocker push and tag"",
|
|
76
83
|
"docker push $DOCKER_IMAGE:$DOCKER_IMAGE_TAG",
|
|
77
84
|
"docker tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG $DOCKER_CACHE_IMAGE",
|
|
78
85
|
"docker push $DOCKER_CACHE_IMAGE",
|
|
86
|
+
"echo -e "\\e[0Ksection_end:$(date +%s):docker-push\\r\\e[0K"",
|
|
79
87
|
],
|
|
80
88
|
"services": [
|
|
81
89
|
{
|
|
@@ -91,15 +99,13 @@ exports[`matches snapshot 1`] = `
|
|
|
91
99
|
"DOCKERFILE_ADDITIONS": undefined,
|
|
92
100
|
"DOCKERFILE_ADDITIONS_END": undefined,
|
|
93
101
|
"DOCKER_BUILDKIT": "1",
|
|
94
|
-
"DOCKER_CACHE_IMAGE": "
|
|
102
|
+
"DOCKER_CACHE_IMAGE": "asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/caches/www",
|
|
95
103
|
"DOCKER_DIR": ".",
|
|
96
104
|
"DOCKER_DRIVER": "overlay2",
|
|
97
105
|
"DOCKER_HOST": "tcp://0.0.0.0:2375",
|
|
98
|
-
"DOCKER_IMAGE": "
|
|
99
|
-
"DOCKER_IMAGE_NAME": "dev/www",
|
|
106
|
+
"DOCKER_IMAGE": "asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/dev/www",
|
|
100
107
|
"DOCKER_IMAGE_TAG": "$CI_COMMIT_SHA",
|
|
101
|
-
"DOCKER_REGISTRY": "
|
|
102
|
-
"DOCKER_REGISTRY_IMAGE_PATH": "$CI_REGISTRY_IMAGE",
|
|
108
|
+
"DOCKER_REGISTRY": "asia-east1-docker.pkg.dev",
|
|
103
109
|
"DOCKER_TLS_CERTDIR": "",
|
|
104
110
|
"KUBERNETES_CPU_LIMIT": "1",
|
|
105
111
|
"KUBERNETES_CPU_REQUEST": "0.5",
|
|
@@ -156,13 +162,6 @@ exports[`matches snapshot 1`] = `
|
|
|
156
162
|
"export GCLOUD_PROJECT_NUMBER=$(gcloud projects describe asdf --format="value(projectNumber)")",
|
|
157
163
|
"echo "GCLOUD_PROJECT_NUMBER: $GCLOUD_PROJECT_NUMBER"",
|
|
158
164
|
"echo -e "\\e[0Ksection_end:$(date +%s):prepare\\r\\e[0K"",
|
|
159
|
-
"echo -e "\\e[0Ksection_start:$(date +%s):pushToArtifactRegistry[collapsed=true]\\r\\e[0KPushing image to artifacts registry"",
|
|
160
|
-
"docker login --username gitlab-ci-token --password $CI_JOB_TOKEN $CI_REGISTRY",
|
|
161
|
-
"gcloud auth configure-docker asia-east1-docker.pkg.dev",
|
|
162
|
-
"docker pull $DOCKER_IMAGE:$DOCKER_IMAGE_TAG",
|
|
163
|
-
"docker tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/dev/www:$DOCKER_IMAGE_TAG",
|
|
164
|
-
"docker push asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/dev/www:$DOCKER_IMAGE_TAG",
|
|
165
|
-
"echo -e "\\e[0Ksection_end:$(date +%s):pushToArtifactRegistry\\r\\e[0K"",
|
|
166
165
|
"echo -e "\\e[0Ksection_start:$(date +%s):deploy[collapsed=true]\\r\\e[0KDeploy to cloud run"",
|
|
167
166
|
"echo "$ENV_VARS" > ____envvars.yaml",
|
|
168
167
|
"gcloud run deploy pan-test-app-dev-www --command="" --image=asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/dev/www:$DOCKER_IMAGE_TAG --project=asdf --region=asia-east1 --labels=customer-name=pan,component-name=www,app-name=test-app,env-type=dev,env-name=dev,build-type=custom --env-vars-file=____envvars.yaml --min-instances=0 --max-instances=100 --cpu-throttling --allow-unauthenticated --ingress=all --cpu-boost",
|
|
@@ -170,6 +169,7 @@ exports[`matches snapshot 1`] = `
|
|
|
170
169
|
"echo -e "\\e[0Ksection_start:$(date +%s):cleanup[collapsed=true]\\r\\e[0KCleanup"",
|
|
171
170
|
"gcloud run revisions list --project=asdf --region=asia-east1 --service=pan-test-app-dev-www --limit=unlimited --sort-by=metadata.creationTimestamp --format="value(name)" --filter='(status.conditions.status=False OR status.conditions.status=Unknown)' | while read -r revisionname; do gcloud run revisions delete --project=asdf --region=asia-east1 --quiet $revisionname ; done",
|
|
172
171
|
"gcloud artifacts docker images list asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/dev/www --sort-by=~CREATE_TIME --format="value(version)" | tail -n +2 | while read -r version; do gcloud artifacts docker images delete asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/dev/www@$version --quiet --delete-tags; done",
|
|
172
|
+
"gcloud artifacts docker images list asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/caches/www --sort-by=~CREATE_TIME --format="value(version)" | tail -n +2 | while read -r version; do gcloud artifacts docker images delete asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/caches/www@$version --quiet --delete-tags; done",
|
|
173
173
|
"echo -e "\\e[0Ksection_end:$(date +%s):cleanup\\r\\e[0K"",
|
|
174
174
|
"echo Uploading SBOM to Dependency Track",
|
|
175
175
|
"/dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" upload "pan-test-app/www" "https://pan-test-app-dev-www-unknown-host.example.com" "__sbom.json" vex.json || true",
|
|
@@ -190,14 +190,12 @@ exports[`matches snapshot 1`] = `
|
|
|
190
190
|
"BUILD_INFO_ID": "some-id",
|
|
191
191
|
"CLOUDSDK_CORE_DISABLE_PROMPTS": "1",
|
|
192
192
|
"DOCKER_BUILDKIT": "1",
|
|
193
|
-
"DOCKER_CACHE_IMAGE": "
|
|
193
|
+
"DOCKER_CACHE_IMAGE": "asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/caches/www",
|
|
194
194
|
"DOCKER_DRIVER": "overlay2",
|
|
195
195
|
"DOCKER_HOST": "tcp://0.0.0.0:2375",
|
|
196
|
-
"DOCKER_IMAGE": "
|
|
197
|
-
"DOCKER_IMAGE_NAME": "dev/www",
|
|
196
|
+
"DOCKER_IMAGE": "asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/dev/www",
|
|
198
197
|
"DOCKER_IMAGE_TAG": "$CI_COMMIT_SHA",
|
|
199
|
-
"DOCKER_REGISTRY": "
|
|
200
|
-
"DOCKER_REGISTRY_IMAGE_PATH": "$CI_REGISTRY_IMAGE",
|
|
198
|
+
"DOCKER_REGISTRY": "asia-east1-docker.pkg.dev",
|
|
201
199
|
"DOCKER_TLS_CERTDIR": "",
|
|
202
200
|
"ENV_SHORT": "dev",
|
|
203
201
|
"ENV_TYPE": "dev",
|
|
@@ -259,6 +257,7 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","BUILD_INFO_ID","BUILD_INF
|
|
|
259
257
|
"gcloud auth activate-service-account --key-file="./____keyfile.json"",
|
|
260
258
|
"gcloud run services delete pan-test-app-dev-www --project=asdf --region=asia-east1",
|
|
261
259
|
"gcloud artifacts docker images delete asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/dev/www --quiet --delete-tags",
|
|
260
|
+
"gcloud artifacts docker images list asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/caches/www --sort-by=~CREATE_TIME --format="value(version)" | tail -n +2 | while read -r version; do gcloud artifacts docker images delete asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/caches/www@$version --quiet --delete-tags; done",
|
|
262
261
|
"echo Disabling component in Dependency Track",
|
|
263
262
|
"/dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" disable "pan-test-app/www" "https://pan-test-app-dev-www-unknown-host.example.com" || true",
|
|
264
263
|
"set -e",
|
|
@@ -434,12 +433,20 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","BUILD_INFO_ID","BUILD_INF
|
|
|
434
433
|
},
|
|
435
434
|
"script": [
|
|
436
435
|
"ensureNginxDockerfile",
|
|
437
|
-
"
|
|
438
|
-
"
|
|
436
|
+
"echo -e "\\e[0Ksection_start:$(date +%s):docker-login[collapsed=true]\\r\\e[0KDocker Login"",
|
|
437
|
+
"echo $CL_review_www_GCLOUD_DEPLOY_credentialsKey > ./____keyfile.json
|
|
438
|
+
",
|
|
439
|
+
"gcloud auth activate-service-account --key-file="./____keyfile.json"",
|
|
440
|
+
"gcloud auth configure-docker asia-east1-docker.pkg.dev",
|
|
441
|
+
"echo -e "\\e[0Ksection_end:$(date +%s):docker-login\\r\\e[0K"",
|
|
442
|
+
"echo -e "\\e[0Ksection_start:$(date +%s):docker-build[collapsed=true]\\r\\e[0KDocker build"",
|
|
439
443
|
"docker build --network host --cache-from $DOCKER_CACHE_IMAGE --tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG -f $APP_DIR/Dockerfile . --build-arg BUILDKIT_INLINE_CACHE=1",
|
|
444
|
+
"echo -e "\\e[0Ksection_end:$(date +%s):docker-build\\r\\e[0K"",
|
|
445
|
+
"echo -e "\\e[0Ksection_start:$(date +%s):docker-push[collapsed=true]\\r\\e[0KDocker push and tag"",
|
|
440
446
|
"docker push $DOCKER_IMAGE:$DOCKER_IMAGE_TAG",
|
|
441
447
|
"docker tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG $DOCKER_CACHE_IMAGE",
|
|
442
448
|
"docker push $DOCKER_CACHE_IMAGE",
|
|
449
|
+
"echo -e "\\e[0Ksection_end:$(date +%s):docker-push\\r\\e[0K"",
|
|
443
450
|
],
|
|
444
451
|
"services": [
|
|
445
452
|
{
|
|
@@ -455,15 +462,13 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","BUILD_INFO_ID","BUILD_INF
|
|
|
455
462
|
"DOCKERFILE_ADDITIONS": undefined,
|
|
456
463
|
"DOCKERFILE_ADDITIONS_END": undefined,
|
|
457
464
|
"DOCKER_BUILDKIT": "1",
|
|
458
|
-
"DOCKER_CACHE_IMAGE": "
|
|
465
|
+
"DOCKER_CACHE_IMAGE": "asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/caches/www",
|
|
459
466
|
"DOCKER_DIR": ".",
|
|
460
467
|
"DOCKER_DRIVER": "overlay2",
|
|
461
468
|
"DOCKER_HOST": "tcp://0.0.0.0:2375",
|
|
462
|
-
"DOCKER_IMAGE": "
|
|
463
|
-
"DOCKER_IMAGE_NAME": "review/www",
|
|
469
|
+
"DOCKER_IMAGE": "asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/review/www/mr1234",
|
|
464
470
|
"DOCKER_IMAGE_TAG": "$CI_COMMIT_SHA",
|
|
465
|
-
"DOCKER_REGISTRY": "
|
|
466
|
-
"DOCKER_REGISTRY_IMAGE_PATH": "$CI_REGISTRY_IMAGE",
|
|
471
|
+
"DOCKER_REGISTRY": "asia-east1-docker.pkg.dev",
|
|
467
472
|
"DOCKER_TLS_CERTDIR": "",
|
|
468
473
|
"KUBERNETES_CPU_LIMIT": "1",
|
|
469
474
|
"KUBERNETES_CPU_REQUEST": "0.5",
|
|
@@ -520,13 +525,6 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","BUILD_INFO_ID","BUILD_INF
|
|
|
520
525
|
"export GCLOUD_PROJECT_NUMBER=$(gcloud projects describe asdf --format="value(projectNumber)")",
|
|
521
526
|
"echo "GCLOUD_PROJECT_NUMBER: $GCLOUD_PROJECT_NUMBER"",
|
|
522
527
|
"echo -e "\\e[0Ksection_end:$(date +%s):prepare\\r\\e[0K"",
|
|
523
|
-
"echo -e "\\e[0Ksection_start:$(date +%s):pushToArtifactRegistry[collapsed=true]\\r\\e[0KPushing image to artifacts registry"",
|
|
524
|
-
"docker login --username gitlab-ci-token --password $CI_JOB_TOKEN $CI_REGISTRY",
|
|
525
|
-
"gcloud auth configure-docker asia-east1-docker.pkg.dev",
|
|
526
|
-
"docker pull $DOCKER_IMAGE:$DOCKER_IMAGE_TAG",
|
|
527
|
-
"docker tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/review/www/mr1234:$DOCKER_IMAGE_TAG",
|
|
528
|
-
"docker push asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/review/www/mr1234:$DOCKER_IMAGE_TAG",
|
|
529
|
-
"echo -e "\\e[0Ksection_end:$(date +%s):pushToArtifactRegistry\\r\\e[0K"",
|
|
530
528
|
"echo -e "\\e[0Ksection_start:$(date +%s):deploy[collapsed=true]\\r\\e[0KDeploy to cloud run"",
|
|
531
529
|
"echo "$ENV_VARS" > ____envvars.yaml",
|
|
532
530
|
"gcloud run deploy pan-test-app-review-mr1234-www --command="" --image=asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/review/www/mr1234:$DOCKER_IMAGE_TAG --project=asdf --region=asia-east1 --labels=customer-name=pan,component-name=www,app-name=test-app,env-type=review,env-name=review,build-type=custom --env-vars-file=____envvars.yaml --min-instances=0 --max-instances=100 --cpu-throttling --allow-unauthenticated --ingress=all --cpu-boost",
|
|
@@ -534,6 +532,7 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","BUILD_INFO_ID","BUILD_INF
|
|
|
534
532
|
"echo -e "\\e[0Ksection_start:$(date +%s):cleanup[collapsed=true]\\r\\e[0KCleanup"",
|
|
535
533
|
"gcloud run revisions list --project=asdf --region=asia-east1 --service=pan-test-app-review-mr1234-www --limit=unlimited --sort-by=metadata.creationTimestamp --format="value(name)" --filter='(status.conditions.status=False OR status.conditions.status=Unknown)' | while read -r revisionname; do gcloud run revisions delete --project=asdf --region=asia-east1 --quiet $revisionname ; done",
|
|
536
534
|
"gcloud artifacts docker images list asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/review/www/mr1234 --sort-by=~CREATE_TIME --format="value(version)" | tail -n +2 | while read -r version; do gcloud artifacts docker images delete asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/review/www/mr1234@$version --quiet --delete-tags; done",
|
|
535
|
+
"gcloud artifacts docker images list asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/caches/www --sort-by=~CREATE_TIME --format="value(version)" | tail -n +2 | while read -r version; do gcloud artifacts docker images delete asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/caches/www@$version --quiet --delete-tags; done",
|
|
537
536
|
"set +e",
|
|
538
537
|
"gcloud artifacts docker images delete asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/review/www --quiet --delete-tags",
|
|
539
538
|
"set -e",
|
|
@@ -557,14 +556,12 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","BUILD_INFO_ID","BUILD_INF
|
|
|
557
556
|
"BUILD_INFO_ID": "some-id",
|
|
558
557
|
"CLOUDSDK_CORE_DISABLE_PROMPTS": "1",
|
|
559
558
|
"DOCKER_BUILDKIT": "1",
|
|
560
|
-
"DOCKER_CACHE_IMAGE": "
|
|
559
|
+
"DOCKER_CACHE_IMAGE": "asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/caches/www",
|
|
561
560
|
"DOCKER_DRIVER": "overlay2",
|
|
562
561
|
"DOCKER_HOST": "tcp://0.0.0.0:2375",
|
|
563
|
-
"DOCKER_IMAGE": "
|
|
564
|
-
"DOCKER_IMAGE_NAME": "review/www",
|
|
562
|
+
"DOCKER_IMAGE": "asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/review/www/mr1234",
|
|
565
563
|
"DOCKER_IMAGE_TAG": "$CI_COMMIT_SHA",
|
|
566
|
-
"DOCKER_REGISTRY": "
|
|
567
|
-
"DOCKER_REGISTRY_IMAGE_PATH": "$CI_REGISTRY_IMAGE",
|
|
564
|
+
"DOCKER_REGISTRY": "asia-east1-docker.pkg.dev",
|
|
568
565
|
"DOCKER_TLS_CERTDIR": "",
|
|
569
566
|
"ENV_SHORT": "review",
|
|
570
567
|
"ENV_TYPE": "review",
|
|
@@ -626,6 +623,7 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","BUILD_INFO_ID","BUILD_INF
|
|
|
626
623
|
"gcloud auth activate-service-account --key-file="./____keyfile.json"",
|
|
627
624
|
"gcloud run services delete pan-test-app-review-mr1234-www --project=asdf --region=asia-east1",
|
|
628
625
|
"gcloud artifacts docker images delete asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/review/www/mr1234 --quiet --delete-tags",
|
|
626
|
+
"gcloud artifacts docker images list asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/caches/www --sort-by=~CREATE_TIME --format="value(version)" | tail -n +2 | while read -r version; do gcloud artifacts docker images delete asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/caches/www@$version --quiet --delete-tags; done",
|
|
629
627
|
"set +e",
|
|
630
628
|
"gcloud artifacts docker images delete asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/review/www --quiet --delete-tags",
|
|
631
629
|
"set -e",
|
|
@@ -854,12 +852,20 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","BUILD_INFO_ID","BUILD_INF
|
|
|
854
852
|
},
|
|
855
853
|
"script": [
|
|
856
854
|
"ensureNginxDockerfile",
|
|
857
|
-
"
|
|
858
|
-
"
|
|
855
|
+
"echo -e "\\e[0Ksection_start:$(date +%s):docker-login[collapsed=true]\\r\\e[0KDocker Login"",
|
|
856
|
+
"echo $CL_prod_www_GCLOUD_DEPLOY_credentialsKey > ./____keyfile.json
|
|
857
|
+
",
|
|
858
|
+
"gcloud auth activate-service-account --key-file="./____keyfile.json"",
|
|
859
|
+
"gcloud auth configure-docker asia-east1-docker.pkg.dev",
|
|
860
|
+
"echo -e "\\e[0Ksection_end:$(date +%s):docker-login\\r\\e[0K"",
|
|
861
|
+
"echo -e "\\e[0Ksection_start:$(date +%s):docker-build[collapsed=true]\\r\\e[0KDocker build"",
|
|
859
862
|
"docker build --network host --cache-from $DOCKER_CACHE_IMAGE --tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG -f $APP_DIR/Dockerfile . --build-arg BUILDKIT_INLINE_CACHE=1",
|
|
863
|
+
"echo -e "\\e[0Ksection_end:$(date +%s):docker-build\\r\\e[0K"",
|
|
864
|
+
"echo -e "\\e[0Ksection_start:$(date +%s):docker-push[collapsed=true]\\r\\e[0KDocker push and tag"",
|
|
860
865
|
"docker push $DOCKER_IMAGE:$DOCKER_IMAGE_TAG",
|
|
861
866
|
"docker tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG $DOCKER_CACHE_IMAGE",
|
|
862
867
|
"docker push $DOCKER_CACHE_IMAGE",
|
|
868
|
+
"echo -e "\\e[0Ksection_end:$(date +%s):docker-push\\r\\e[0K"",
|
|
863
869
|
],
|
|
864
870
|
"services": [
|
|
865
871
|
{
|
|
@@ -875,15 +881,13 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","BUILD_INFO_ID","BUILD_INF
|
|
|
875
881
|
"DOCKERFILE_ADDITIONS": undefined,
|
|
876
882
|
"DOCKERFILE_ADDITIONS_END": undefined,
|
|
877
883
|
"DOCKER_BUILDKIT": "1",
|
|
878
|
-
"DOCKER_CACHE_IMAGE": "
|
|
884
|
+
"DOCKER_CACHE_IMAGE": "asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/caches/www",
|
|
879
885
|
"DOCKER_DIR": ".",
|
|
880
886
|
"DOCKER_DRIVER": "overlay2",
|
|
881
887
|
"DOCKER_HOST": "tcp://0.0.0.0:2375",
|
|
882
|
-
"DOCKER_IMAGE": "
|
|
883
|
-
"DOCKER_IMAGE_NAME": "prod/www",
|
|
888
|
+
"DOCKER_IMAGE": "asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/prod/www",
|
|
884
889
|
"DOCKER_IMAGE_TAG": "$CI_COMMIT_SHA",
|
|
885
|
-
"DOCKER_REGISTRY": "
|
|
886
|
-
"DOCKER_REGISTRY_IMAGE_PATH": "$CI_REGISTRY_IMAGE",
|
|
890
|
+
"DOCKER_REGISTRY": "asia-east1-docker.pkg.dev",
|
|
887
891
|
"DOCKER_TLS_CERTDIR": "",
|
|
888
892
|
"KUBERNETES_CPU_LIMIT": "1",
|
|
889
893
|
"KUBERNETES_CPU_REQUEST": "0.5",
|
|
@@ -906,12 +910,20 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","BUILD_INFO_ID","BUILD_INF
|
|
|
906
910
|
},
|
|
907
911
|
"script": [
|
|
908
912
|
"ensureNginxDockerfile",
|
|
909
|
-
"
|
|
910
|
-
"
|
|
913
|
+
"echo -e "\\e[0Ksection_start:$(date +%s):docker-login[collapsed=true]\\r\\e[0KDocker Login"",
|
|
914
|
+
"echo $CL_stage_www_GCLOUD_DEPLOY_credentialsKey > ./____keyfile.json
|
|
915
|
+
",
|
|
916
|
+
"gcloud auth activate-service-account --key-file="./____keyfile.json"",
|
|
917
|
+
"gcloud auth configure-docker asia-east1-docker.pkg.dev",
|
|
918
|
+
"echo -e "\\e[0Ksection_end:$(date +%s):docker-login\\r\\e[0K"",
|
|
919
|
+
"echo -e "\\e[0Ksection_start:$(date +%s):docker-build[collapsed=true]\\r\\e[0KDocker build"",
|
|
911
920
|
"docker build --network host --cache-from $DOCKER_CACHE_IMAGE --tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG -f $APP_DIR/Dockerfile . --build-arg BUILDKIT_INLINE_CACHE=1",
|
|
921
|
+
"echo -e "\\e[0Ksection_end:$(date +%s):docker-build\\r\\e[0K"",
|
|
922
|
+
"echo -e "\\e[0Ksection_start:$(date +%s):docker-push[collapsed=true]\\r\\e[0KDocker push and tag"",
|
|
912
923
|
"docker push $DOCKER_IMAGE:$DOCKER_IMAGE_TAG",
|
|
913
924
|
"docker tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG $DOCKER_CACHE_IMAGE",
|
|
914
925
|
"docker push $DOCKER_CACHE_IMAGE",
|
|
926
|
+
"echo -e "\\e[0Ksection_end:$(date +%s):docker-push\\r\\e[0K"",
|
|
915
927
|
],
|
|
916
928
|
"services": [
|
|
917
929
|
{
|
|
@@ -927,15 +939,13 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","BUILD_INFO_ID","BUILD_INF
|
|
|
927
939
|
"DOCKERFILE_ADDITIONS": undefined,
|
|
928
940
|
"DOCKERFILE_ADDITIONS_END": undefined,
|
|
929
941
|
"DOCKER_BUILDKIT": "1",
|
|
930
|
-
"DOCKER_CACHE_IMAGE": "
|
|
942
|
+
"DOCKER_CACHE_IMAGE": "asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/caches/www",
|
|
931
943
|
"DOCKER_DIR": ".",
|
|
932
944
|
"DOCKER_DRIVER": "overlay2",
|
|
933
945
|
"DOCKER_HOST": "tcp://0.0.0.0:2375",
|
|
934
|
-
"DOCKER_IMAGE": "
|
|
935
|
-
"DOCKER_IMAGE_NAME": "stage/www",
|
|
946
|
+
"DOCKER_IMAGE": "asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/stage/www",
|
|
936
947
|
"DOCKER_IMAGE_TAG": "$CI_COMMIT_SHA",
|
|
937
|
-
"DOCKER_REGISTRY": "
|
|
938
|
-
"DOCKER_REGISTRY_IMAGE_PATH": "$CI_REGISTRY_IMAGE",
|
|
948
|
+
"DOCKER_REGISTRY": "asia-east1-docker.pkg.dev",
|
|
939
949
|
"DOCKER_TLS_CERTDIR": "",
|
|
940
950
|
"KUBERNETES_CPU_LIMIT": "1",
|
|
941
951
|
"KUBERNETES_CPU_REQUEST": "0.5",
|
|
@@ -992,13 +1002,6 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","BUILD_INFO_ID","BUILD_INF
|
|
|
992
1002
|
"export GCLOUD_PROJECT_NUMBER=$(gcloud projects describe asdf --format="value(projectNumber)")",
|
|
993
1003
|
"echo "GCLOUD_PROJECT_NUMBER: $GCLOUD_PROJECT_NUMBER"",
|
|
994
1004
|
"echo -e "\\e[0Ksection_end:$(date +%s):prepare\\r\\e[0K"",
|
|
995
|
-
"echo -e "\\e[0Ksection_start:$(date +%s):pushToArtifactRegistry[collapsed=true]\\r\\e[0KPushing image to artifacts registry"",
|
|
996
|
-
"docker login --username gitlab-ci-token --password $CI_JOB_TOKEN $CI_REGISTRY",
|
|
997
|
-
"gcloud auth configure-docker asia-east1-docker.pkg.dev",
|
|
998
|
-
"docker pull $DOCKER_IMAGE:$DOCKER_IMAGE_TAG",
|
|
999
|
-
"docker tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/prod/www:$DOCKER_IMAGE_TAG",
|
|
1000
|
-
"docker push asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/prod/www:$DOCKER_IMAGE_TAG",
|
|
1001
|
-
"echo -e "\\e[0Ksection_end:$(date +%s):pushToArtifactRegistry\\r\\e[0K"",
|
|
1002
1005
|
"echo -e "\\e[0Ksection_start:$(date +%s):deploy[collapsed=true]\\r\\e[0KDeploy to cloud run"",
|
|
1003
1006
|
"echo "$ENV_VARS" > ____envvars.yaml",
|
|
1004
1007
|
"gcloud run deploy pan-test-app-prod-www --command="" --image=asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/prod/www:$DOCKER_IMAGE_TAG --project=asdf --region=asia-east1 --labels=customer-name=pan,component-name=www,app-name=test-app,env-type=prod,env-name=prod,build-type=custom --env-vars-file=____envvars.yaml --min-instances=0 --max-instances=100 --cpu-throttling --allow-unauthenticated --ingress=all --cpu-boost",
|
|
@@ -1006,6 +1009,7 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","BUILD_INFO_ID","BUILD_INF
|
|
|
1006
1009
|
"echo -e "\\e[0Ksection_start:$(date +%s):cleanup[collapsed=true]\\r\\e[0KCleanup"",
|
|
1007
1010
|
"gcloud run revisions list --project=asdf --region=asia-east1 --service=pan-test-app-prod-www --limit=unlimited --sort-by=metadata.creationTimestamp --format="value(name)" --filter='(status.conditions.status=False OR status.conditions.status=Unknown)' | tail -n +6 | while read -r revisionname; do gcloud run revisions delete --project=asdf --region=asia-east1 --quiet $revisionname ; done",
|
|
1008
1011
|
"gcloud artifacts docker images list asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/prod/www --sort-by=~CREATE_TIME --format="value(version)" | tail -n +7 | while read -r version; do gcloud artifacts docker images delete asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/prod/www@$version --quiet --delete-tags; done",
|
|
1012
|
+
"gcloud artifacts docker images list asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/caches/www --sort-by=~CREATE_TIME --format="value(version)" | tail -n +2 | while read -r version; do gcloud artifacts docker images delete asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/caches/www@$version --quiet --delete-tags; done",
|
|
1009
1013
|
"echo -e "\\e[0Ksection_end:$(date +%s):cleanup\\r\\e[0K"",
|
|
1010
1014
|
"echo Uploading SBOM to Dependency Track",
|
|
1011
1015
|
"/dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" upload "pan-test-app/www" "https://pan-test-app-prod-www-unknown-host.example.com" "__sbom.json" vex.json || true",
|
|
@@ -1026,14 +1030,12 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","BUILD_INFO_ID","BUILD_INF
|
|
|
1026
1030
|
"BUILD_INFO_ID": "some-id",
|
|
1027
1031
|
"CLOUDSDK_CORE_DISABLE_PROMPTS": "1",
|
|
1028
1032
|
"DOCKER_BUILDKIT": "1",
|
|
1029
|
-
"DOCKER_CACHE_IMAGE": "
|
|
1033
|
+
"DOCKER_CACHE_IMAGE": "asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/caches/www",
|
|
1030
1034
|
"DOCKER_DRIVER": "overlay2",
|
|
1031
1035
|
"DOCKER_HOST": "tcp://0.0.0.0:2375",
|
|
1032
|
-
"DOCKER_IMAGE": "
|
|
1033
|
-
"DOCKER_IMAGE_NAME": "prod/www",
|
|
1036
|
+
"DOCKER_IMAGE": "asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/prod/www",
|
|
1034
1037
|
"DOCKER_IMAGE_TAG": "$CI_COMMIT_SHA",
|
|
1035
|
-
"DOCKER_REGISTRY": "
|
|
1036
|
-
"DOCKER_REGISTRY_IMAGE_PATH": "$CI_REGISTRY_IMAGE",
|
|
1038
|
+
"DOCKER_REGISTRY": "asia-east1-docker.pkg.dev",
|
|
1037
1039
|
"DOCKER_TLS_CERTDIR": "",
|
|
1038
1040
|
"ENV_SHORT": "prod",
|
|
1039
1041
|
"ENV_TYPE": "prod",
|
|
@@ -1110,13 +1112,6 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","BUILD_INFO_ID","BUILD_INF
|
|
|
1110
1112
|
"export GCLOUD_PROJECT_NUMBER=$(gcloud projects describe asdf --format="value(projectNumber)")",
|
|
1111
1113
|
"echo "GCLOUD_PROJECT_NUMBER: $GCLOUD_PROJECT_NUMBER"",
|
|
1112
1114
|
"echo -e "\\e[0Ksection_end:$(date +%s):prepare\\r\\e[0K"",
|
|
1113
|
-
"echo -e "\\e[0Ksection_start:$(date +%s):pushToArtifactRegistry[collapsed=true]\\r\\e[0KPushing image to artifacts registry"",
|
|
1114
|
-
"docker login --username gitlab-ci-token --password $CI_JOB_TOKEN $CI_REGISTRY",
|
|
1115
|
-
"gcloud auth configure-docker asia-east1-docker.pkg.dev",
|
|
1116
|
-
"docker pull $DOCKER_IMAGE:$DOCKER_IMAGE_TAG",
|
|
1117
|
-
"docker tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/stage/www:$DOCKER_IMAGE_TAG",
|
|
1118
|
-
"docker push asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/stage/www:$DOCKER_IMAGE_TAG",
|
|
1119
|
-
"echo -e "\\e[0Ksection_end:$(date +%s):pushToArtifactRegistry\\r\\e[0K"",
|
|
1120
1115
|
"echo -e "\\e[0Ksection_start:$(date +%s):deploy[collapsed=true]\\r\\e[0KDeploy to cloud run"",
|
|
1121
1116
|
"echo "$ENV_VARS" > ____envvars.yaml",
|
|
1122
1117
|
"gcloud run deploy pan-test-app-stage-www --command="" --image=asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/stage/www:$DOCKER_IMAGE_TAG --project=asdf --region=asia-east1 --labels=customer-name=pan,component-name=www,app-name=test-app,env-type=stage,env-name=stage,build-type=custom --env-vars-file=____envvars.yaml --min-instances=0 --max-instances=100 --cpu-throttling --allow-unauthenticated --ingress=all --cpu-boost",
|
|
@@ -1124,6 +1119,7 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","BUILD_INFO_ID","BUILD_INF
|
|
|
1124
1119
|
"echo -e "\\e[0Ksection_start:$(date +%s):cleanup[collapsed=true]\\r\\e[0KCleanup"",
|
|
1125
1120
|
"gcloud run revisions list --project=asdf --region=asia-east1 --service=pan-test-app-stage-www --limit=unlimited --sort-by=metadata.creationTimestamp --format="value(name)" --filter='(status.conditions.status=False OR status.conditions.status=Unknown)' | while read -r revisionname; do gcloud run revisions delete --project=asdf --region=asia-east1 --quiet $revisionname ; done",
|
|
1126
1121
|
"gcloud artifacts docker images list asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/stage/www --sort-by=~CREATE_TIME --format="value(version)" | tail -n +2 | while read -r version; do gcloud artifacts docker images delete asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/stage/www@$version --quiet --delete-tags; done",
|
|
1122
|
+
"gcloud artifacts docker images list asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/caches/www --sort-by=~CREATE_TIME --format="value(version)" | tail -n +2 | while read -r version; do gcloud artifacts docker images delete asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/caches/www@$version --quiet --delete-tags; done",
|
|
1127
1123
|
"echo -e "\\e[0Ksection_end:$(date +%s):cleanup\\r\\e[0K"",
|
|
1128
1124
|
"echo Uploading SBOM to Dependency Track",
|
|
1129
1125
|
"/dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" upload "pan-test-app/www" "https://pan-test-app-stage-www-unknown-host.example.com" "__sbom.json" vex.json || true",
|
|
@@ -1144,14 +1140,12 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","BUILD_INFO_ID","BUILD_INF
|
|
|
1144
1140
|
"BUILD_INFO_ID": "some-id",
|
|
1145
1141
|
"CLOUDSDK_CORE_DISABLE_PROMPTS": "1",
|
|
1146
1142
|
"DOCKER_BUILDKIT": "1",
|
|
1147
|
-
"DOCKER_CACHE_IMAGE": "
|
|
1143
|
+
"DOCKER_CACHE_IMAGE": "asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/caches/www",
|
|
1148
1144
|
"DOCKER_DRIVER": "overlay2",
|
|
1149
1145
|
"DOCKER_HOST": "tcp://0.0.0.0:2375",
|
|
1150
|
-
"DOCKER_IMAGE": "
|
|
1151
|
-
"DOCKER_IMAGE_NAME": "stage/www",
|
|
1146
|
+
"DOCKER_IMAGE": "asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/stage/www",
|
|
1152
1147
|
"DOCKER_IMAGE_TAG": "$CI_COMMIT_SHA",
|
|
1153
|
-
"DOCKER_REGISTRY": "
|
|
1154
|
-
"DOCKER_REGISTRY_IMAGE_PATH": "$CI_REGISTRY_IMAGE",
|
|
1148
|
+
"DOCKER_REGISTRY": "asia-east1-docker.pkg.dev",
|
|
1155
1149
|
"DOCKER_TLS_CERTDIR": "",
|
|
1156
1150
|
"ENV_SHORT": "stage",
|
|
1157
1151
|
"ENV_TYPE": "stage",
|
|
@@ -1213,6 +1207,7 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","BUILD_INFO_ID","BUILD_INF
|
|
|
1213
1207
|
"gcloud auth activate-service-account --key-file="./____keyfile.json"",
|
|
1214
1208
|
"gcloud run services delete pan-test-app-prod-www --project=asdf --region=asia-east1",
|
|
1215
1209
|
"gcloud artifacts docker images delete asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/prod/www --quiet --delete-tags",
|
|
1210
|
+
"gcloud artifacts docker images list asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/caches/www --sort-by=~CREATE_TIME --format="value(version)" | tail -n +2 | while read -r version; do gcloud artifacts docker images delete asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/caches/www@$version --quiet --delete-tags; done",
|
|
1216
1211
|
"echo Disabling component in Dependency Track",
|
|
1217
1212
|
"/dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" disable "pan-test-app/www" "https://pan-test-app-prod-www-unknown-host.example.com" || true",
|
|
1218
1213
|
"set -e",
|
|
@@ -1261,6 +1256,7 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","BUILD_INFO_ID","BUILD_INF
|
|
|
1261
1256
|
"gcloud auth activate-service-account --key-file="./____keyfile.json"",
|
|
1262
1257
|
"gcloud run services delete pan-test-app-stage-www --project=asdf --region=asia-east1",
|
|
1263
1258
|
"gcloud artifacts docker images delete asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/stage/www --quiet --delete-tags",
|
|
1259
|
+
"gcloud artifacts docker images list asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/caches/www --sort-by=~CREATE_TIME --format="value(version)" | tail -n +2 | while read -r version; do gcloud artifacts docker images delete asia-east1-docker.pkg.dev/asdf/catladder-deploy/pan-test-app/caches/www@$version --quiet --delete-tags; done",
|
|
1264
1260
|
"echo Disabling component in Dependency Track",
|
|
1265
1261
|
"/dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" disable "pan-test-app/www" "https://pan-test-app-stage-www-unknown-host.example.com" || true",
|
|
1266
1262
|
"set -e",
|
|
@@ -155,12 +155,17 @@ exports[`matches snapshot 1`] = `
|
|
|
155
155
|
},
|
|
156
156
|
"script": [
|
|
157
157
|
"ensureNodeDockerfile",
|
|
158
|
+
"echo -e "\\e[0Ksection_start:$(date +%s):docker-login[collapsed=true]\\r\\e[0KDocker Login"",
|
|
158
159
|
"docker login --username gitlab-ci-token --password $CI_JOB_TOKEN $CI_REGISTRY",
|
|
159
|
-
"
|
|
160
|
+
"echo -e "\\e[0Ksection_end:$(date +%s):docker-login\\r\\e[0K"",
|
|
161
|
+
"echo -e "\\e[0Ksection_start:$(date +%s):docker-build[collapsed=true]\\r\\e[0KDocker build"",
|
|
160
162
|
"docker build --network host --cache-from $DOCKER_CACHE_IMAGE --tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG -f $APP_DIR/Dockerfile . --build-arg BUILDKIT_INLINE_CACHE=1",
|
|
163
|
+
"echo -e "\\e[0Ksection_end:$(date +%s):docker-build\\r\\e[0K"",
|
|
164
|
+
"echo -e "\\e[0Ksection_start:$(date +%s):docker-push[collapsed=true]\\r\\e[0KDocker push and tag"",
|
|
161
165
|
"docker push $DOCKER_IMAGE:$DOCKER_IMAGE_TAG",
|
|
162
166
|
"docker tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG $DOCKER_CACHE_IMAGE",
|
|
163
167
|
"docker push $DOCKER_CACHE_IMAGE",
|
|
168
|
+
"echo -e "\\e[0Ksection_end:$(date +%s):docker-push\\r\\e[0K"",
|
|
164
169
|
],
|
|
165
170
|
"services": [
|
|
166
171
|
{
|
|
@@ -176,7 +181,7 @@ exports[`matches snapshot 1`] = `
|
|
|
176
181
|
"DOCKERFILE_ADDITIONS": undefined,
|
|
177
182
|
"DOCKERFILE_ADDITIONS_END": undefined,
|
|
178
183
|
"DOCKER_BUILDKIT": "1",
|
|
179
|
-
"DOCKER_CACHE_IMAGE": "$
|
|
184
|
+
"DOCKER_CACHE_IMAGE": "$CI_REGISTRY_IMAGE/caches/www",
|
|
180
185
|
"DOCKER_COPY_AND_INSTALL_APP": "COPY --chown=node:node $APP_DIR .
|
|
181
186
|
RUN yarn plugin import workspace-tools
|
|
182
187
|
RUN yarn workspaces focus --production && yarn rebuild",
|
|
@@ -187,11 +192,10 @@ COPY --chown=node:node .yarn /app/.yarn",
|
|
|
187
192
|
"DOCKER_DIR": ".",
|
|
188
193
|
"DOCKER_DRIVER": "overlay2",
|
|
189
194
|
"DOCKER_HOST": "tcp://0.0.0.0:2375",
|
|
190
|
-
"DOCKER_IMAGE": "$
|
|
195
|
+
"DOCKER_IMAGE": "$CI_REGISTRY_IMAGE/$DOCKER_IMAGE_NAME",
|
|
191
196
|
"DOCKER_IMAGE_NAME": "dev/www",
|
|
192
197
|
"DOCKER_IMAGE_TAG": "$CI_COMMIT_SHA",
|
|
193
198
|
"DOCKER_REGISTRY": "$CI_REGISTRY",
|
|
194
|
-
"DOCKER_REGISTRY_IMAGE_PATH": "$CI_REGISTRY_IMAGE",
|
|
195
199
|
"DOCKER_TLS_CERTDIR": "",
|
|
196
200
|
"KUBERNETES_CPU_LIMIT": "1",
|
|
197
201
|
"KUBERNETES_CPU_REQUEST": "0.5",
|
|
@@ -261,12 +265,11 @@ COPY --chown=node:node .yarn /app/.yarn",
|
|
|
261
265
|
"BUILD_INFO_CURRENT_VERSION": "3.2.1",
|
|
262
266
|
"BUILD_INFO_ID": "some-id",
|
|
263
267
|
"DEPLOY_API_KEY": "$CL_dev_www_DEPLOY_API_KEY",
|
|
264
|
-
"DOCKER_CACHE_IMAGE": "$
|
|
265
|
-
"DOCKER_IMAGE": "$
|
|
268
|
+
"DOCKER_CACHE_IMAGE": "$CI_REGISTRY_IMAGE/caches/www",
|
|
269
|
+
"DOCKER_IMAGE": "$CI_REGISTRY_IMAGE/$DOCKER_IMAGE_NAME",
|
|
266
270
|
"DOCKER_IMAGE_NAME": "dev/www",
|
|
267
271
|
"DOCKER_IMAGE_TAG": "$CI_COMMIT_SHA",
|
|
268
272
|
"DOCKER_REGISTRY": "$CI_REGISTRY",
|
|
269
|
-
"DOCKER_REGISTRY_IMAGE_PATH": "$CI_REGISTRY_IMAGE",
|
|
270
273
|
"ENV_SHORT": "dev",
|
|
271
274
|
"ENV_TYPE": "dev",
|
|
272
275
|
"HOST": "unknown-host.example.com",
|
|
@@ -638,12 +641,17 @@ COPY --chown=node:node .yarn /app/.yarn",
|
|
|
638
641
|
},
|
|
639
642
|
"script": [
|
|
640
643
|
"ensureNodeDockerfile",
|
|
644
|
+
"echo -e "\\e[0Ksection_start:$(date +%s):docker-login[collapsed=true]\\r\\e[0KDocker Login"",
|
|
641
645
|
"docker login --username gitlab-ci-token --password $CI_JOB_TOKEN $CI_REGISTRY",
|
|
642
|
-
"
|
|
646
|
+
"echo -e "\\e[0Ksection_end:$(date +%s):docker-login\\r\\e[0K"",
|
|
647
|
+
"echo -e "\\e[0Ksection_start:$(date +%s):docker-build[collapsed=true]\\r\\e[0KDocker build"",
|
|
643
648
|
"docker build --network host --cache-from $DOCKER_CACHE_IMAGE --tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG -f $APP_DIR/Dockerfile . --build-arg BUILDKIT_INLINE_CACHE=1",
|
|
649
|
+
"echo -e "\\e[0Ksection_end:$(date +%s):docker-build\\r\\e[0K"",
|
|
650
|
+
"echo -e "\\e[0Ksection_start:$(date +%s):docker-push[collapsed=true]\\r\\e[0KDocker push and tag"",
|
|
644
651
|
"docker push $DOCKER_IMAGE:$DOCKER_IMAGE_TAG",
|
|
645
652
|
"docker tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG $DOCKER_CACHE_IMAGE",
|
|
646
653
|
"docker push $DOCKER_CACHE_IMAGE",
|
|
654
|
+
"echo -e "\\e[0Ksection_end:$(date +%s):docker-push\\r\\e[0K"",
|
|
647
655
|
],
|
|
648
656
|
"services": [
|
|
649
657
|
{
|
|
@@ -659,7 +667,7 @@ COPY --chown=node:node .yarn /app/.yarn",
|
|
|
659
667
|
"DOCKERFILE_ADDITIONS": undefined,
|
|
660
668
|
"DOCKERFILE_ADDITIONS_END": undefined,
|
|
661
669
|
"DOCKER_BUILDKIT": "1",
|
|
662
|
-
"DOCKER_CACHE_IMAGE": "$
|
|
670
|
+
"DOCKER_CACHE_IMAGE": "$CI_REGISTRY_IMAGE/caches/www",
|
|
663
671
|
"DOCKER_COPY_AND_INSTALL_APP": "COPY --chown=node:node $APP_DIR .
|
|
664
672
|
RUN yarn plugin import workspace-tools
|
|
665
673
|
RUN yarn workspaces focus --production && yarn rebuild",
|
|
@@ -670,11 +678,10 @@ COPY --chown=node:node .yarn /app/.yarn",
|
|
|
670
678
|
"DOCKER_DIR": ".",
|
|
671
679
|
"DOCKER_DRIVER": "overlay2",
|
|
672
680
|
"DOCKER_HOST": "tcp://0.0.0.0:2375",
|
|
673
|
-
"DOCKER_IMAGE": "$
|
|
681
|
+
"DOCKER_IMAGE": "$CI_REGISTRY_IMAGE/$DOCKER_IMAGE_NAME",
|
|
674
682
|
"DOCKER_IMAGE_NAME": "review/www",
|
|
675
683
|
"DOCKER_IMAGE_TAG": "$CI_COMMIT_SHA",
|
|
676
684
|
"DOCKER_REGISTRY": "$CI_REGISTRY",
|
|
677
|
-
"DOCKER_REGISTRY_IMAGE_PATH": "$CI_REGISTRY_IMAGE",
|
|
678
685
|
"DOCKER_TLS_CERTDIR": "",
|
|
679
686
|
"KUBERNETES_CPU_LIMIT": "1",
|
|
680
687
|
"KUBERNETES_CPU_REQUEST": "0.5",
|
|
@@ -744,12 +751,11 @@ COPY --chown=node:node .yarn /app/.yarn",
|
|
|
744
751
|
"BUILD_INFO_CURRENT_VERSION": "3.2.1",
|
|
745
752
|
"BUILD_INFO_ID": "some-id",
|
|
746
753
|
"DEPLOY_API_KEY": "$CL_review_www_DEPLOY_API_KEY",
|
|
747
|
-
"DOCKER_CACHE_IMAGE": "$
|
|
748
|
-
"DOCKER_IMAGE": "$
|
|
754
|
+
"DOCKER_CACHE_IMAGE": "$CI_REGISTRY_IMAGE/caches/www",
|
|
755
|
+
"DOCKER_IMAGE": "$CI_REGISTRY_IMAGE/$DOCKER_IMAGE_NAME",
|
|
749
756
|
"DOCKER_IMAGE_NAME": "review/www",
|
|
750
757
|
"DOCKER_IMAGE_TAG": "$CI_COMMIT_SHA",
|
|
751
758
|
"DOCKER_REGISTRY": "$CI_REGISTRY",
|
|
752
|
-
"DOCKER_REGISTRY_IMAGE_PATH": "$CI_REGISTRY_IMAGE",
|
|
753
759
|
"ENV_SHORT": "review",
|
|
754
760
|
"ENV_TYPE": "review",
|
|
755
761
|
"HOST": "unknown-host.example.com",
|
|
@@ -1153,12 +1159,17 @@ COPY --chown=node:node .yarn /app/.yarn",
|
|
|
1153
1159
|
},
|
|
1154
1160
|
"script": [
|
|
1155
1161
|
"ensureNodeDockerfile",
|
|
1162
|
+
"echo -e "\\e[0Ksection_start:$(date +%s):docker-login[collapsed=true]\\r\\e[0KDocker Login"",
|
|
1156
1163
|
"docker login --username gitlab-ci-token --password $CI_JOB_TOKEN $CI_REGISTRY",
|
|
1157
|
-
"
|
|
1164
|
+
"echo -e "\\e[0Ksection_end:$(date +%s):docker-login\\r\\e[0K"",
|
|
1165
|
+
"echo -e "\\e[0Ksection_start:$(date +%s):docker-build[collapsed=true]\\r\\e[0KDocker build"",
|
|
1158
1166
|
"docker build --network host --cache-from $DOCKER_CACHE_IMAGE --tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG -f $APP_DIR/Dockerfile . --build-arg BUILDKIT_INLINE_CACHE=1",
|
|
1167
|
+
"echo -e "\\e[0Ksection_end:$(date +%s):docker-build\\r\\e[0K"",
|
|
1168
|
+
"echo -e "\\e[0Ksection_start:$(date +%s):docker-push[collapsed=true]\\r\\e[0KDocker push and tag"",
|
|
1159
1169
|
"docker push $DOCKER_IMAGE:$DOCKER_IMAGE_TAG",
|
|
1160
1170
|
"docker tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG $DOCKER_CACHE_IMAGE",
|
|
1161
1171
|
"docker push $DOCKER_CACHE_IMAGE",
|
|
1172
|
+
"echo -e "\\e[0Ksection_end:$(date +%s):docker-push\\r\\e[0K"",
|
|
1162
1173
|
],
|
|
1163
1174
|
"services": [
|
|
1164
1175
|
{
|
|
@@ -1174,7 +1185,7 @@ COPY --chown=node:node .yarn /app/.yarn",
|
|
|
1174
1185
|
"DOCKERFILE_ADDITIONS": undefined,
|
|
1175
1186
|
"DOCKERFILE_ADDITIONS_END": undefined,
|
|
1176
1187
|
"DOCKER_BUILDKIT": "1",
|
|
1177
|
-
"DOCKER_CACHE_IMAGE": "$
|
|
1188
|
+
"DOCKER_CACHE_IMAGE": "$CI_REGISTRY_IMAGE/caches/www",
|
|
1178
1189
|
"DOCKER_COPY_AND_INSTALL_APP": "COPY --chown=node:node $APP_DIR .
|
|
1179
1190
|
RUN yarn plugin import workspace-tools
|
|
1180
1191
|
RUN yarn workspaces focus --production && yarn rebuild",
|
|
@@ -1185,11 +1196,10 @@ COPY --chown=node:node .yarn /app/.yarn",
|
|
|
1185
1196
|
"DOCKER_DIR": ".",
|
|
1186
1197
|
"DOCKER_DRIVER": "overlay2",
|
|
1187
1198
|
"DOCKER_HOST": "tcp://0.0.0.0:2375",
|
|
1188
|
-
"DOCKER_IMAGE": "$
|
|
1199
|
+
"DOCKER_IMAGE": "$CI_REGISTRY_IMAGE/$DOCKER_IMAGE_NAME",
|
|
1189
1200
|
"DOCKER_IMAGE_NAME": "prod/www",
|
|
1190
1201
|
"DOCKER_IMAGE_TAG": "$CI_COMMIT_SHA",
|
|
1191
1202
|
"DOCKER_REGISTRY": "$CI_REGISTRY",
|
|
1192
|
-
"DOCKER_REGISTRY_IMAGE_PATH": "$CI_REGISTRY_IMAGE",
|
|
1193
1203
|
"DOCKER_TLS_CERTDIR": "",
|
|
1194
1204
|
"KUBERNETES_CPU_LIMIT": "1",
|
|
1195
1205
|
"KUBERNETES_CPU_REQUEST": "0.5",
|
|
@@ -1221,12 +1231,17 @@ COPY --chown=node:node .yarn /app/.yarn",
|
|
|
1221
1231
|
},
|
|
1222
1232
|
"script": [
|
|
1223
1233
|
"ensureNodeDockerfile",
|
|
1234
|
+
"echo -e "\\e[0Ksection_start:$(date +%s):docker-login[collapsed=true]\\r\\e[0KDocker Login"",
|
|
1224
1235
|
"docker login --username gitlab-ci-token --password $CI_JOB_TOKEN $CI_REGISTRY",
|
|
1225
|
-
"
|
|
1236
|
+
"echo -e "\\e[0Ksection_end:$(date +%s):docker-login\\r\\e[0K"",
|
|
1237
|
+
"echo -e "\\e[0Ksection_start:$(date +%s):docker-build[collapsed=true]\\r\\e[0KDocker build"",
|
|
1226
1238
|
"docker build --network host --cache-from $DOCKER_CACHE_IMAGE --tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG -f $APP_DIR/Dockerfile . --build-arg BUILDKIT_INLINE_CACHE=1",
|
|
1239
|
+
"echo -e "\\e[0Ksection_end:$(date +%s):docker-build\\r\\e[0K"",
|
|
1240
|
+
"echo -e "\\e[0Ksection_start:$(date +%s):docker-push[collapsed=true]\\r\\e[0KDocker push and tag"",
|
|
1227
1241
|
"docker push $DOCKER_IMAGE:$DOCKER_IMAGE_TAG",
|
|
1228
1242
|
"docker tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG $DOCKER_CACHE_IMAGE",
|
|
1229
1243
|
"docker push $DOCKER_CACHE_IMAGE",
|
|
1244
|
+
"echo -e "\\e[0Ksection_end:$(date +%s):docker-push\\r\\e[0K"",
|
|
1230
1245
|
],
|
|
1231
1246
|
"services": [
|
|
1232
1247
|
{
|
|
@@ -1242,7 +1257,7 @@ COPY --chown=node:node .yarn /app/.yarn",
|
|
|
1242
1257
|
"DOCKERFILE_ADDITIONS": undefined,
|
|
1243
1258
|
"DOCKERFILE_ADDITIONS_END": undefined,
|
|
1244
1259
|
"DOCKER_BUILDKIT": "1",
|
|
1245
|
-
"DOCKER_CACHE_IMAGE": "$
|
|
1260
|
+
"DOCKER_CACHE_IMAGE": "$CI_REGISTRY_IMAGE/caches/www",
|
|
1246
1261
|
"DOCKER_COPY_AND_INSTALL_APP": "COPY --chown=node:node $APP_DIR .
|
|
1247
1262
|
RUN yarn plugin import workspace-tools
|
|
1248
1263
|
RUN yarn workspaces focus --production && yarn rebuild",
|
|
@@ -1253,11 +1268,10 @@ COPY --chown=node:node .yarn /app/.yarn",
|
|
|
1253
1268
|
"DOCKER_DIR": ".",
|
|
1254
1269
|
"DOCKER_DRIVER": "overlay2",
|
|
1255
1270
|
"DOCKER_HOST": "tcp://0.0.0.0:2375",
|
|
1256
|
-
"DOCKER_IMAGE": "$
|
|
1271
|
+
"DOCKER_IMAGE": "$CI_REGISTRY_IMAGE/$DOCKER_IMAGE_NAME",
|
|
1257
1272
|
"DOCKER_IMAGE_NAME": "stage/www",
|
|
1258
1273
|
"DOCKER_IMAGE_TAG": "$CI_COMMIT_SHA",
|
|
1259
1274
|
"DOCKER_REGISTRY": "$CI_REGISTRY",
|
|
1260
|
-
"DOCKER_REGISTRY_IMAGE_PATH": "$CI_REGISTRY_IMAGE",
|
|
1261
1275
|
"DOCKER_TLS_CERTDIR": "",
|
|
1262
1276
|
"KUBERNETES_CPU_LIMIT": "1",
|
|
1263
1277
|
"KUBERNETES_CPU_REQUEST": "0.5",
|
|
@@ -1315,12 +1329,11 @@ COPY --chown=node:node .yarn /app/.yarn",
|
|
|
1315
1329
|
"BUILD_INFO_CURRENT_VERSION": "3.2.1",
|
|
1316
1330
|
"BUILD_INFO_ID": "some-id",
|
|
1317
1331
|
"DEPLOY_API_KEY": "$CL_prod_www_DEPLOY_API_KEY",
|
|
1318
|
-
"DOCKER_CACHE_IMAGE": "$
|
|
1319
|
-
"DOCKER_IMAGE": "$
|
|
1332
|
+
"DOCKER_CACHE_IMAGE": "$CI_REGISTRY_IMAGE/caches/www",
|
|
1333
|
+
"DOCKER_IMAGE": "$CI_REGISTRY_IMAGE/$DOCKER_IMAGE_NAME",
|
|
1320
1334
|
"DOCKER_IMAGE_NAME": "prod/www",
|
|
1321
1335
|
"DOCKER_IMAGE_TAG": "$CI_COMMIT_SHA",
|
|
1322
1336
|
"DOCKER_REGISTRY": "$CI_REGISTRY",
|
|
1323
|
-
"DOCKER_REGISTRY_IMAGE_PATH": "$CI_REGISTRY_IMAGE",
|
|
1324
1337
|
"ENV_SHORT": "prod",
|
|
1325
1338
|
"ENV_TYPE": "prod",
|
|
1326
1339
|
"HOST": "unknown-host.example.com",
|
|
@@ -1382,12 +1395,11 @@ COPY --chown=node:node .yarn /app/.yarn",
|
|
|
1382
1395
|
"BUILD_INFO_CURRENT_VERSION": "3.2.1",
|
|
1383
1396
|
"BUILD_INFO_ID": "some-id",
|
|
1384
1397
|
"DEPLOY_API_KEY": "$CL_stage_www_DEPLOY_API_KEY",
|
|
1385
|
-
"DOCKER_CACHE_IMAGE": "$
|
|
1386
|
-
"DOCKER_IMAGE": "$
|
|
1398
|
+
"DOCKER_CACHE_IMAGE": "$CI_REGISTRY_IMAGE/caches/www",
|
|
1399
|
+
"DOCKER_IMAGE": "$CI_REGISTRY_IMAGE/$DOCKER_IMAGE_NAME",
|
|
1387
1400
|
"DOCKER_IMAGE_NAME": "stage/www",
|
|
1388
1401
|
"DOCKER_IMAGE_TAG": "$CI_COMMIT_SHA",
|
|
1389
1402
|
"DOCKER_REGISTRY": "$CI_REGISTRY",
|
|
1390
|
-
"DOCKER_REGISTRY_IMAGE_PATH": "$CI_REGISTRY_IMAGE",
|
|
1391
1403
|
"ENV_SHORT": "stage",
|
|
1392
1404
|
"ENV_TYPE": "stage",
|
|
1393
1405
|
"HOST": "unknown-host.example.com",
|