@catladder/pipeline 1.153.0 → 1.154.0
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/artifacts/createBuildJobArtifact.d.ts +3 -0
- package/dist/build/artifacts/createBuildJobArtifact.js +97 -0
- package/dist/build/base/createAppBuildJob.d.ts +3 -3
- package/dist/build/base/createAppBuildJob.js +9 -15
- package/dist/build/base/index.d.ts +6 -2
- package/dist/build/base/index.js +14 -5
- package/dist/build/base/writeDotEnv.js +2 -1
- package/dist/build/custom/__tests__/testJob.test.js +1 -1
- package/dist/build/custom/buildJob.js +3 -10
- package/dist/build/docker.js +3 -3
- package/dist/build/index.d.ts +13 -6
- package/dist/build/index.js +29 -7
- package/dist/build/node/buildJob.d.ts +7 -2
- package/dist/build/node/buildJob.js +40 -33
- package/dist/build/node/cache.d.ts +2 -2
- package/dist/build/node/cache.js +8 -4
- package/dist/build/node/index.d.ts +2 -2
- package/dist/build/node/meteor.js +3 -6
- package/dist/build/node/testJob.d.ts +3 -2
- package/dist/build/node/testJob.js +9 -4
- package/dist/build/node/yarn.js +1 -1
- package/dist/build/rails/build.d.ts +1 -1
- package/dist/build/rails/build.js +7 -2
- package/dist/build/rails/test.d.ts +1 -1
- package/dist/build/rails/test.js +5 -0
- package/dist/build/sbom.js +3 -2
- package/dist/build/types.d.ts +48 -4
- package/dist/build/types.js +7 -1
- package/dist/bundles/catladder-gitlab/index.js +2 -2
- package/dist/constants.js +1 -1
- package/dist/context/createAllComponentsContext.d.ts +12 -0
- package/dist/context/createAllComponentsContext.js +159 -0
- package/dist/context/createComponentContext.d.ts +1 -5
- package/dist/context/createComponentContext.js +82 -20
- package/dist/context/createWorkspaceContext.d.ts +16 -0
- package/dist/context/createWorkspaceContext.js +173 -0
- package/dist/context/getBuildInfoVariables.d.ts +1 -1
- package/dist/context/getEnvironmentContext.d.ts +1 -1
- package/dist/context/getEnvironmentVariables.d.ts +2 -2
- package/dist/context/getEnvironmentVariables.js +5 -4
- package/dist/context/getLabels.js +5 -5
- package/dist/deploy/base/deploy.d.ts +1 -1
- package/dist/deploy/base/deploy.js +18 -5
- package/dist/deploy/cloudRun/artifactsRegistry.js +2 -2
- package/dist/deploy/cloudRun/createJobs/common.d.ts +4 -4
- package/dist/deploy/cloudRun/index.d.ts +2 -2
- package/dist/deploy/custom/index.d.ts +2 -2
- package/dist/deploy/dockerTag/index.d.ts +2 -2
- package/dist/deploy/index.d.ts +7 -7
- package/dist/deploy/kubernetes/additionalSecretKeys.d.ts +3 -1
- package/dist/deploy/kubernetes/cloudSql/index.js +1 -1
- package/dist/deploy/kubernetes/deployJob.js +2 -2
- package/dist/deploy/kubernetes/index.d.ts +2 -2
- package/dist/deploy/sbom.d.ts +1 -1
- package/dist/deploy/sbom.js +4 -3
- package/dist/deploy/types/index.d.ts +3 -3
- package/dist/pipeline/createAllJobs.d.ts +12 -10
- package/dist/pipeline/createAllJobs.js +94 -51
- package/dist/pipeline/createJobsForComponent.js +2 -3
- package/dist/pipeline/createJobsForWorkspace.d.ts +3 -0
- package/dist/pipeline/createJobsForWorkspace.js +12 -0
- package/dist/pipeline/createMainPipeline.js +26 -6
- package/dist/pipeline/gitlab/createGitlabJobs.d.ts +3 -16
- package/dist/pipeline/gitlab/createGitlabJobs.js +191 -73
- package/dist/pipeline/packageManager.d.ts +3 -2
- package/dist/pipeline/packageManager.js +43 -15
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/config.d.ts +5 -4
- package/dist/types/context.d.ts +80 -12
- package/dist/types/context.js +10 -1
- package/dist/types/environmentContext.d.ts +5 -6
- package/dist/types/jobs.d.ts +5 -0
- package/examples/__snapshots__/cloud-run-memory-limit.ts.snap +8 -8
- package/examples/__snapshots__/cloud-run-meteor-with-worker.ts.snap +8 -0
- package/examples/__snapshots__/cloud-run-no-cpu-throttling.ts.snap +8 -8
- package/examples/__snapshots__/cloud-run-no-service.ts.snap +8 -8
- package/examples/__snapshots__/cloud-run-non-public.ts.snap +8 -8
- package/examples/__snapshots__/cloud-run-post-stop-job.ts.snap +8 -8
- package/examples/__snapshots__/cloud-run-service-gen2.ts.snap +8 -8
- package/examples/__snapshots__/cloud-run-service-increase-timout.ts.snap +8 -8
- package/examples/__snapshots__/cloud-run-service-with-volumes.ts.snap +8 -8
- package/examples/__snapshots__/cloud-run-storybook.ts.snap +4 -8
- package/examples/__snapshots__/cloud-run-with-ngnix.ts.snap +4 -8
- package/examples/__snapshots__/cloud-run-with-sql-reuse-db.ts.snap +16 -16
- package/examples/__snapshots__/cloud-run-with-sql.ts.snap +589 -1097
- package/examples/__snapshots__/cloud-run-with-worker.ts.snap +8 -8
- package/examples/__snapshots__/custom-build-job-with-tests.ts.snap +4 -0
- package/examples/__snapshots__/custom-build-job.ts.snap +4 -0
- package/examples/__snapshots__/custom-deploy.ts.snap +8 -8
- package/examples/__snapshots__/custom-envs.ts.snap +18 -12
- package/examples/__snapshots__/custom-sbom-java.ts.snap +4 -0
- package/examples/__snapshots__/kubernetes-application-customization.ts.snap +8 -8
- package/examples/__snapshots__/kubernetes-with-cloud-sql-legacy.ts.snap +8 -8
- package/examples/__snapshots__/kubernetes-with-cloud-sql.ts.snap +8 -8
- package/examples/__snapshots__/kubernetes-with-jobs.ts.snap +16 -16
- package/examples/__snapshots__/kubernetes-with-mongodb.ts.snap +8 -8
- package/examples/__snapshots__/local-dot-env.ts.snap +8 -8
- package/examples/__snapshots__/meteor-kubernetes.ts.snap +8 -0
- package/examples/__snapshots__/multiline-var.ts.snap +16 -16
- package/examples/__snapshots__/native-app.ts.snap +24 -16
- package/examples/__snapshots__/node-build-with-custom-image.ts.snap +8 -8
- package/examples/__snapshots__/node-build-with-docker-additions.ts.snap +8 -8
- package/examples/__snapshots__/wait-for-other-deploy.ts.snap +16 -16
- package/examples/cloud-run-with-sql.ts +9 -2
- package/package.json +1 -1
- package/src/build/artifacts/createBuildJobArtifact.ts +61 -0
- package/src/build/base/createAppBuildJob.ts +26 -22
- package/src/build/base/index.ts +31 -4
- package/src/build/base/writeDotEnv.ts +6 -2
- package/src/build/custom/__tests__/testJob.test.ts +4 -4
- package/src/build/custom/buildJob.ts +2 -13
- package/src/build/docker.ts +6 -8
- package/src/build/index.ts +39 -7
- package/src/build/node/buildJob.ts +68 -56
- package/src/build/node/cache.ts +17 -8
- package/src/build/node/index.ts +4 -2
- package/src/build/node/meteor.ts +3 -9
- package/src/build/node/testJob.ts +21 -7
- package/src/build/node/yarn.ts +2 -2
- package/src/build/rails/build.ts +14 -4
- package/src/build/rails/test.ts +9 -1
- package/src/build/sbom.ts +7 -2
- package/src/build/types.ts +68 -4
- package/src/context/createAllComponentsContext.ts +31 -0
- package/src/context/createComponentContext.ts +59 -20
- package/src/context/createWorkspaceContext.ts +56 -0
- package/src/context/getBuildInfoVariables.ts +2 -1
- package/src/context/getEnvironmentContext.ts +2 -2
- package/src/context/getEnvironmentVariables.ts +12 -7
- package/src/context/getLabels.ts +3 -3
- package/src/deploy/base/deploy.ts +33 -7
- package/src/deploy/cloudRun/artifactsRegistry.ts +3 -4
- package/src/deploy/cloudRun/createJobs/common.ts +4 -4
- package/src/deploy/cloudRun/index.ts +68 -67
- package/src/deploy/custom/index.ts +2 -2
- package/src/deploy/dockerTag/index.ts +8 -7
- package/src/deploy/index.ts +11 -9
- package/src/deploy/kubernetes/additionalSecretKeys.ts +3 -1
- package/src/deploy/kubernetes/cloudSql/index.ts +1 -1
- package/src/deploy/kubernetes/deployJob.ts +2 -2
- package/src/deploy/kubernetes/index.ts +42 -41
- package/src/deploy/sbom.ts +9 -4
- package/src/pipeline/createAllJobs.ts +56 -55
- package/src/pipeline/createChildPipeline.ts +1 -0
- package/src/pipeline/createJobsForComponent.ts +5 -4
- package/src/pipeline/createJobsForWorkspace.ts +12 -0
- package/src/pipeline/createMainPipeline.ts +38 -23
- package/src/pipeline/gitlab/createGitlabJobs.ts +283 -119
- package/src/pipeline/packageManager.ts +25 -9
- package/src/types/config.ts +4 -1
- package/src/types/context.ts +108 -12
- package/src/types/environmentContext.ts +6 -7
- package/src/types/jobs.ts +3 -1
|
@@ -62,8 +62,8 @@ exports[`matches snapshot 1`] = `
|
|
|
62
62
|
"expire_in": "1 day",
|
|
63
63
|
"paths": [
|
|
64
64
|
"api/__build_info.json",
|
|
65
|
-
"api/dist",
|
|
66
65
|
"api/.next",
|
|
66
|
+
"api/dist",
|
|
67
67
|
],
|
|
68
68
|
"reports": {
|
|
69
69
|
"junit": undefined,
|
|
@@ -88,7 +88,7 @@ exports[`matches snapshot 1`] = `
|
|
|
88
88
|
{
|
|
89
89
|
"key": "api-next-cache",
|
|
90
90
|
"paths": [
|
|
91
|
-
"api/.next/cache
|
|
91
|
+
"api/.next/cache",
|
|
92
92
|
],
|
|
93
93
|
"policy": "pull-push",
|
|
94
94
|
},
|
|
@@ -570,8 +570,8 @@ EOF
|
|
|
570
570
|
"expire_in": "1 day",
|
|
571
571
|
"paths": [
|
|
572
572
|
"app/__build_info.json",
|
|
573
|
-
"app/dist",
|
|
574
573
|
"app/.next",
|
|
574
|
+
"app/dist",
|
|
575
575
|
],
|
|
576
576
|
"reports": {
|
|
577
577
|
"junit": undefined,
|
|
@@ -606,7 +606,7 @@ EOF
|
|
|
606
606
|
{
|
|
607
607
|
"key": "app-next-cache",
|
|
608
608
|
"paths": [
|
|
609
|
-
"app/.next/cache
|
|
609
|
+
"app/.next/cache",
|
|
610
610
|
],
|
|
611
611
|
"policy": "pull-push",
|
|
612
612
|
},
|
|
@@ -642,6 +642,7 @@ EOF
|
|
|
642
642
|
"export LC_A="L=en_US.UTF-8"",
|
|
643
643
|
"export LANG="en_US.UTF-8"",
|
|
644
644
|
"echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
|
|
645
|
+
"echo -e "\\e[0Ksection_start:$(date +%s):write-dotenv-app[collapsed=true]\\r\\e[0Kwrite dot env"",
|
|
645
646
|
"cat <<EOF > app/.env
|
|
646
647
|
ENV_SHORT=dev
|
|
647
648
|
APP_DIR=app
|
|
@@ -660,6 +661,7 @@ APP_STORE_CONNECT_API_KEY_ID=$CL_dev_app_APP_STORE_CONNECT_API_KEY_ID
|
|
|
660
661
|
GRAPHQL_URL=https://$(printf %s "pan-test-app-dev-api-$CL_dev_api_GCLOUD_RUN_canonicalHostSuffix" | awk '{print tolower($0)}')/graphql
|
|
661
662
|
_ALL_ENV_VAR_KEYS=["ENV_SHORT","APP_DIR","ENV_TYPE","BUILD_INFO_BUILD_ID","BUILD_INFO_BUILD_TIME","BUILD_INFO_CURRENT_VERSION","HOST","ROOT_URL","HOST_INTERNAL","HOST_CANONICAL","ROOT_URL_INTERNAL","APP_STORE_CONNECT_API_KEY_CONTENT","APP_STORE_CONNECT_ISSUER_ID","APP_STORE_CONNECT_API_KEY_ID","GRAPHQL_URL"]
|
|
662
663
|
EOF",
|
|
664
|
+
"echo -e "\\e[0Ksection_end:$(date +%s):write-dotenv-app\\r\\e[0K"",
|
|
663
665
|
"echo '{"id":"$(git describe --tags 2>/dev/null || git rev-parse HEAD)","time":"$CI_JOB_STARTED_AT"}' > app/__build_info.json",
|
|
664
666
|
"echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
|
|
665
667
|
"if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
|
|
@@ -1012,8 +1014,8 @@ EOF",
|
|
|
1012
1014
|
"expire_in": "1 day",
|
|
1013
1015
|
"paths": [
|
|
1014
1016
|
"api/__build_info.json",
|
|
1015
|
-
"api/dist",
|
|
1016
1017
|
"api/.next",
|
|
1018
|
+
"api/dist",
|
|
1017
1019
|
],
|
|
1018
1020
|
"reports": {
|
|
1019
1021
|
"junit": undefined,
|
|
@@ -1038,7 +1040,7 @@ EOF",
|
|
|
1038
1040
|
{
|
|
1039
1041
|
"key": "api-next-cache",
|
|
1040
1042
|
"paths": [
|
|
1041
|
-
"api/.next/cache
|
|
1043
|
+
"api/.next/cache",
|
|
1042
1044
|
],
|
|
1043
1045
|
"policy": "pull-push",
|
|
1044
1046
|
},
|
|
@@ -1526,8 +1528,8 @@ EOF
|
|
|
1526
1528
|
"expire_in": "1 day",
|
|
1527
1529
|
"paths": [
|
|
1528
1530
|
"app/__build_info.json",
|
|
1529
|
-
"app/dist",
|
|
1530
1531
|
"app/.next",
|
|
1532
|
+
"app/dist",
|
|
1531
1533
|
],
|
|
1532
1534
|
"reports": {
|
|
1533
1535
|
"junit": undefined,
|
|
@@ -1562,7 +1564,7 @@ EOF
|
|
|
1562
1564
|
{
|
|
1563
1565
|
"key": "app-next-cache",
|
|
1564
1566
|
"paths": [
|
|
1565
|
-
"app/.next/cache
|
|
1567
|
+
"app/.next/cache",
|
|
1566
1568
|
],
|
|
1567
1569
|
"policy": "pull-push",
|
|
1568
1570
|
},
|
|
@@ -1598,6 +1600,7 @@ EOF
|
|
|
1598
1600
|
"export LC_A="L=en_US.UTF-8"",
|
|
1599
1601
|
"export LANG="en_US.UTF-8"",
|
|
1600
1602
|
"echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
|
|
1603
|
+
"echo -e "\\e[0Ksection_start:$(date +%s):write-dotenv-app[collapsed=true]\\r\\e[0Kwrite dot env"",
|
|
1601
1604
|
"cat <<EOF > app/.env
|
|
1602
1605
|
ENV_SHORT=review
|
|
1603
1606
|
APP_DIR=app
|
|
@@ -1616,6 +1619,7 @@ APP_STORE_CONNECT_API_KEY_ID=$CL_review_app_APP_STORE_CONNECT_API_KEY_ID
|
|
|
1616
1619
|
GRAPHQL_URL=https://$(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-$CL_review_api_GCLOUD_RUN_canonicalHostSuffix" | awk '{print tolower($0)}')/graphql
|
|
1617
1620
|
_ALL_ENV_VAR_KEYS=["ENV_SHORT","APP_DIR","ENV_TYPE","BUILD_INFO_BUILD_ID","BUILD_INFO_BUILD_TIME","BUILD_INFO_CURRENT_VERSION","HOST","ROOT_URL","HOST_INTERNAL","HOST_CANONICAL","ROOT_URL_INTERNAL","APP_STORE_CONNECT_API_KEY_CONTENT","APP_STORE_CONNECT_ISSUER_ID","APP_STORE_CONNECT_API_KEY_ID","GRAPHQL_URL"]
|
|
1618
1621
|
EOF",
|
|
1622
|
+
"echo -e "\\e[0Ksection_end:$(date +%s):write-dotenv-app\\r\\e[0K"",
|
|
1619
1623
|
"echo '{"id":"$(git describe --tags 2>/dev/null || git rev-parse HEAD)","time":"$CI_JOB_STARTED_AT"}' > app/__build_info.json",
|
|
1620
1624
|
"echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
|
|
1621
1625
|
"if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
|
|
@@ -1916,8 +1920,8 @@ EOF",
|
|
|
1916
1920
|
"expire_in": "1 day",
|
|
1917
1921
|
"paths": [
|
|
1918
1922
|
"api/__build_info.json",
|
|
1919
|
-
"api/dist",
|
|
1920
1923
|
"api/.next",
|
|
1924
|
+
"api/dist",
|
|
1921
1925
|
],
|
|
1922
1926
|
"reports": {
|
|
1923
1927
|
"junit": undefined,
|
|
@@ -1942,7 +1946,7 @@ EOF",
|
|
|
1942
1946
|
{
|
|
1943
1947
|
"key": "api-next-cache",
|
|
1944
1948
|
"paths": [
|
|
1945
|
-
"api/.next/cache
|
|
1949
|
+
"api/.next/cache",
|
|
1946
1950
|
],
|
|
1947
1951
|
"policy": "pull-push",
|
|
1948
1952
|
},
|
|
@@ -2003,8 +2007,8 @@ EOF",
|
|
|
2003
2007
|
"expire_in": "1 day",
|
|
2004
2008
|
"paths": [
|
|
2005
2009
|
"api/__build_info.json",
|
|
2006
|
-
"api/dist",
|
|
2007
2010
|
"api/.next",
|
|
2011
|
+
"api/dist",
|
|
2008
2012
|
],
|
|
2009
2013
|
"reports": {
|
|
2010
2014
|
"junit": undefined,
|
|
@@ -2029,7 +2033,7 @@ EOF",
|
|
|
2029
2033
|
{
|
|
2030
2034
|
"key": "api-next-cache",
|
|
2031
2035
|
"paths": [
|
|
2032
|
-
"api/.next/cache
|
|
2036
|
+
"api/.next/cache",
|
|
2033
2037
|
],
|
|
2034
2038
|
"policy": "pull-push",
|
|
2035
2039
|
},
|
|
@@ -2641,8 +2645,8 @@ EOF
|
|
|
2641
2645
|
"expire_in": "1 day",
|
|
2642
2646
|
"paths": [
|
|
2643
2647
|
"app/__build_info.json",
|
|
2644
|
-
"app/dist",
|
|
2645
2648
|
"app/.next",
|
|
2649
|
+
"app/dist",
|
|
2646
2650
|
],
|
|
2647
2651
|
"reports": {
|
|
2648
2652
|
"junit": undefined,
|
|
@@ -2677,7 +2681,7 @@ EOF
|
|
|
2677
2681
|
{
|
|
2678
2682
|
"key": "app-next-cache",
|
|
2679
2683
|
"paths": [
|
|
2680
|
-
"app/.next/cache
|
|
2684
|
+
"app/.next/cache",
|
|
2681
2685
|
],
|
|
2682
2686
|
"policy": "pull-push",
|
|
2683
2687
|
},
|
|
@@ -2713,6 +2717,7 @@ EOF
|
|
|
2713
2717
|
"export LC_A="L=en_US.UTF-8"",
|
|
2714
2718
|
"export LANG="en_US.UTF-8"",
|
|
2715
2719
|
"echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
|
|
2720
|
+
"echo -e "\\e[0Ksection_start:$(date +%s):write-dotenv-app[collapsed=true]\\r\\e[0Kwrite dot env"",
|
|
2716
2721
|
"cat <<EOF > app/.env
|
|
2717
2722
|
ENV_SHORT=prod
|
|
2718
2723
|
APP_DIR=app
|
|
@@ -2731,6 +2736,7 @@ APP_STORE_CONNECT_API_KEY_ID=$CL_prod_app_APP_STORE_CONNECT_API_KEY_ID
|
|
|
2731
2736
|
GRAPHQL_URL=https://$(printf %s "pan-test-app-prod-api-$CL_prod_api_GCLOUD_RUN_canonicalHostSuffix" | awk '{print tolower($0)}')/graphql
|
|
2732
2737
|
_ALL_ENV_VAR_KEYS=["ENV_SHORT","APP_DIR","ENV_TYPE","BUILD_INFO_BUILD_ID","BUILD_INFO_BUILD_TIME","BUILD_INFO_CURRENT_VERSION","HOST","ROOT_URL","HOST_INTERNAL","HOST_CANONICAL","ROOT_URL_INTERNAL","APP_STORE_CONNECT_API_KEY_CONTENT","APP_STORE_CONNECT_ISSUER_ID","APP_STORE_CONNECT_API_KEY_ID","GRAPHQL_URL"]
|
|
2733
2738
|
EOF",
|
|
2739
|
+
"echo -e "\\e[0Ksection_end:$(date +%s):write-dotenv-app\\r\\e[0K"",
|
|
2734
2740
|
"echo '{"id":"$(git describe --tags 2>/dev/null || git rev-parse HEAD)","time":"$CI_JOB_STARTED_AT"}' > app/__build_info.json",
|
|
2735
2741
|
"echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
|
|
2736
2742
|
"if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
|
|
@@ -2768,8 +2774,8 @@ EOF",
|
|
|
2768
2774
|
"expire_in": "1 day",
|
|
2769
2775
|
"paths": [
|
|
2770
2776
|
"app/__build_info.json",
|
|
2771
|
-
"app/dist",
|
|
2772
2777
|
"app/.next",
|
|
2778
|
+
"app/dist",
|
|
2773
2779
|
],
|
|
2774
2780
|
"reports": {
|
|
2775
2781
|
"junit": undefined,
|
|
@@ -2804,7 +2810,7 @@ EOF",
|
|
|
2804
2810
|
{
|
|
2805
2811
|
"key": "app-next-cache",
|
|
2806
2812
|
"paths": [
|
|
2807
|
-
"app/.next/cache
|
|
2813
|
+
"app/.next/cache",
|
|
2808
2814
|
],
|
|
2809
2815
|
"policy": "pull-push",
|
|
2810
2816
|
},
|
|
@@ -2840,6 +2846,7 @@ EOF",
|
|
|
2840
2846
|
"export LC_A="L=en_US.UTF-8"",
|
|
2841
2847
|
"export LANG="en_US.UTF-8"",
|
|
2842
2848
|
"echo -e "\\e[0Ksection_end:$(date +%s):injectvars\\r\\e[0K"",
|
|
2849
|
+
"echo -e "\\e[0Ksection_start:$(date +%s):write-dotenv-app[collapsed=true]\\r\\e[0Kwrite dot env"",
|
|
2843
2850
|
"cat <<EOF > app/.env
|
|
2844
2851
|
ENV_SHORT=stage
|
|
2845
2852
|
APP_DIR=app
|
|
@@ -2858,6 +2865,7 @@ APP_STORE_CONNECT_API_KEY_ID=$CL_stage_app_APP_STORE_CONNECT_API_KEY_ID
|
|
|
2858
2865
|
GRAPHQL_URL=https://$(printf %s "pan-test-app-stage-api-$CL_stage_api_GCLOUD_RUN_canonicalHostSuffix" | awk '{print tolower($0)}')/graphql
|
|
2859
2866
|
_ALL_ENV_VAR_KEYS=["ENV_SHORT","APP_DIR","ENV_TYPE","BUILD_INFO_BUILD_ID","BUILD_INFO_BUILD_TIME","BUILD_INFO_CURRENT_VERSION","HOST","ROOT_URL","HOST_INTERNAL","HOST_CANONICAL","ROOT_URL_INTERNAL","APP_STORE_CONNECT_API_KEY_CONTENT","APP_STORE_CONNECT_ISSUER_ID","APP_STORE_CONNECT_API_KEY_ID","GRAPHQL_URL"]
|
|
2860
2867
|
EOF",
|
|
2868
|
+
"echo -e "\\e[0Ksection_end:$(date +%s):write-dotenv-app\\r\\e[0K"",
|
|
2861
2869
|
"echo '{"id":"$(git describe --tags 2>/dev/null || git rev-parse HEAD)","time":"$CI_JOB_STARTED_AT"}' > app/__build_info.json",
|
|
2862
2870
|
"echo -e "\\e[0Ksection_start:$(date +%s):nodeinstall[collapsed=true]\\r\\e[0KEnsure node version"",
|
|
2863
2871
|
"if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi",
|
|
@@ -62,8 +62,8 @@ exports[`matches snapshot 1`] = `
|
|
|
62
62
|
"expire_in": "1 day",
|
|
63
63
|
"paths": [
|
|
64
64
|
"www/__build_info.json",
|
|
65
|
-
"www/dist",
|
|
66
65
|
"www/.next",
|
|
66
|
+
"www/dist",
|
|
67
67
|
],
|
|
68
68
|
"reports": {
|
|
69
69
|
"junit": undefined,
|
|
@@ -88,7 +88,7 @@ exports[`matches snapshot 1`] = `
|
|
|
88
88
|
{
|
|
89
89
|
"key": "www-next-cache",
|
|
90
90
|
"paths": [
|
|
91
|
-
"www/.next/cache
|
|
91
|
+
"www/.next/cache",
|
|
92
92
|
],
|
|
93
93
|
"policy": "pull-push",
|
|
94
94
|
},
|
|
@@ -635,8 +635,8 @@ EOF
|
|
|
635
635
|
"expire_in": "1 day",
|
|
636
636
|
"paths": [
|
|
637
637
|
"www/__build_info.json",
|
|
638
|
-
"www/dist",
|
|
639
638
|
"www/.next",
|
|
639
|
+
"www/dist",
|
|
640
640
|
],
|
|
641
641
|
"reports": {
|
|
642
642
|
"junit": undefined,
|
|
@@ -661,7 +661,7 @@ EOF
|
|
|
661
661
|
{
|
|
662
662
|
"key": "www-next-cache",
|
|
663
663
|
"paths": [
|
|
664
|
-
"www/.next/cache
|
|
664
|
+
"www/.next/cache",
|
|
665
665
|
],
|
|
666
666
|
"policy": "pull-push",
|
|
667
667
|
},
|
|
@@ -1162,8 +1162,8 @@ EOF
|
|
|
1162
1162
|
"expire_in": "1 day",
|
|
1163
1163
|
"paths": [
|
|
1164
1164
|
"www/__build_info.json",
|
|
1165
|
-
"www/dist",
|
|
1166
1165
|
"www/.next",
|
|
1166
|
+
"www/dist",
|
|
1167
1167
|
],
|
|
1168
1168
|
"reports": {
|
|
1169
1169
|
"junit": undefined,
|
|
@@ -1188,7 +1188,7 @@ EOF
|
|
|
1188
1188
|
{
|
|
1189
1189
|
"key": "www-next-cache",
|
|
1190
1190
|
"paths": [
|
|
1191
|
-
"www/.next/cache
|
|
1191
|
+
"www/.next/cache",
|
|
1192
1192
|
],
|
|
1193
1193
|
"policy": "pull-push",
|
|
1194
1194
|
},
|
|
@@ -1249,8 +1249,8 @@ EOF
|
|
|
1249
1249
|
"expire_in": "1 day",
|
|
1250
1250
|
"paths": [
|
|
1251
1251
|
"www/__build_info.json",
|
|
1252
|
-
"www/dist",
|
|
1253
1252
|
"www/.next",
|
|
1253
|
+
"www/dist",
|
|
1254
1254
|
],
|
|
1255
1255
|
"reports": {
|
|
1256
1256
|
"junit": undefined,
|
|
@@ -1275,7 +1275,7 @@ EOF
|
|
|
1275
1275
|
{
|
|
1276
1276
|
"key": "www-next-cache",
|
|
1277
1277
|
"paths": [
|
|
1278
|
-
"www/.next/cache
|
|
1278
|
+
"www/.next/cache",
|
|
1279
1279
|
],
|
|
1280
1280
|
"policy": "pull-push",
|
|
1281
1281
|
},
|
|
@@ -62,8 +62,8 @@ exports[`matches snapshot 1`] = `
|
|
|
62
62
|
"expire_in": "1 day",
|
|
63
63
|
"paths": [
|
|
64
64
|
"www/__build_info.json",
|
|
65
|
-
"www/dist",
|
|
66
65
|
"www/.next",
|
|
66
|
+
"www/dist",
|
|
67
67
|
],
|
|
68
68
|
"reports": {
|
|
69
69
|
"junit": undefined,
|
|
@@ -88,7 +88,7 @@ exports[`matches snapshot 1`] = `
|
|
|
88
88
|
{
|
|
89
89
|
"key": "www-next-cache",
|
|
90
90
|
"paths": [
|
|
91
|
-
"www/.next/cache
|
|
91
|
+
"www/.next/cache",
|
|
92
92
|
],
|
|
93
93
|
"policy": "pull-push",
|
|
94
94
|
},
|
|
@@ -637,8 +637,8 @@ EOF
|
|
|
637
637
|
"expire_in": "1 day",
|
|
638
638
|
"paths": [
|
|
639
639
|
"www/__build_info.json",
|
|
640
|
-
"www/dist",
|
|
641
640
|
"www/.next",
|
|
641
|
+
"www/dist",
|
|
642
642
|
],
|
|
643
643
|
"reports": {
|
|
644
644
|
"junit": undefined,
|
|
@@ -663,7 +663,7 @@ EOF
|
|
|
663
663
|
{
|
|
664
664
|
"key": "www-next-cache",
|
|
665
665
|
"paths": [
|
|
666
|
-
"www/.next/cache
|
|
666
|
+
"www/.next/cache",
|
|
667
667
|
],
|
|
668
668
|
"policy": "pull-push",
|
|
669
669
|
},
|
|
@@ -1166,8 +1166,8 @@ EOF
|
|
|
1166
1166
|
"expire_in": "1 day",
|
|
1167
1167
|
"paths": [
|
|
1168
1168
|
"www/__build_info.json",
|
|
1169
|
-
"www/dist",
|
|
1170
1169
|
"www/.next",
|
|
1170
|
+
"www/dist",
|
|
1171
1171
|
],
|
|
1172
1172
|
"reports": {
|
|
1173
1173
|
"junit": undefined,
|
|
@@ -1192,7 +1192,7 @@ EOF
|
|
|
1192
1192
|
{
|
|
1193
1193
|
"key": "www-next-cache",
|
|
1194
1194
|
"paths": [
|
|
1195
|
-
"www/.next/cache
|
|
1195
|
+
"www/.next/cache",
|
|
1196
1196
|
],
|
|
1197
1197
|
"policy": "pull-push",
|
|
1198
1198
|
},
|
|
@@ -1253,8 +1253,8 @@ EOF
|
|
|
1253
1253
|
"expire_in": "1 day",
|
|
1254
1254
|
"paths": [
|
|
1255
1255
|
"www/__build_info.json",
|
|
1256
|
-
"www/dist",
|
|
1257
1256
|
"www/.next",
|
|
1257
|
+
"www/dist",
|
|
1258
1258
|
],
|
|
1259
1259
|
"reports": {
|
|
1260
1260
|
"junit": undefined,
|
|
@@ -1279,7 +1279,7 @@ EOF
|
|
|
1279
1279
|
{
|
|
1280
1280
|
"key": "www-next-cache",
|
|
1281
1281
|
"paths": [
|
|
1282
|
-
"www/.next/cache
|
|
1282
|
+
"www/.next/cache",
|
|
1283
1283
|
],
|
|
1284
1284
|
"policy": "pull-push",
|
|
1285
1285
|
},
|
|
@@ -62,8 +62,8 @@ exports[`matches snapshot 1`] = `
|
|
|
62
62
|
"expire_in": "1 day",
|
|
63
63
|
"paths": [
|
|
64
64
|
"api/__build_info.json",
|
|
65
|
-
"api/dist",
|
|
66
65
|
"api/.next",
|
|
66
|
+
"api/dist",
|
|
67
67
|
],
|
|
68
68
|
"reports": {
|
|
69
69
|
"junit": undefined,
|
|
@@ -88,7 +88,7 @@ exports[`matches snapshot 1`] = `
|
|
|
88
88
|
{
|
|
89
89
|
"key": "api-next-cache",
|
|
90
90
|
"paths": [
|
|
91
|
-
"api/.next/cache
|
|
91
|
+
"api/.next/cache",
|
|
92
92
|
],
|
|
93
93
|
"policy": "pull-push",
|
|
94
94
|
},
|
|
@@ -366,8 +366,8 @@ exports[`matches snapshot 1`] = `
|
|
|
366
366
|
"expire_in": "1 day",
|
|
367
367
|
"paths": [
|
|
368
368
|
"www/__build_info.json",
|
|
369
|
-
"www/dist",
|
|
370
369
|
"www/.next",
|
|
370
|
+
"www/dist",
|
|
371
371
|
],
|
|
372
372
|
"reports": {
|
|
373
373
|
"junit": undefined,
|
|
@@ -392,7 +392,7 @@ exports[`matches snapshot 1`] = `
|
|
|
392
392
|
{
|
|
393
393
|
"key": "www-next-cache",
|
|
394
394
|
"paths": [
|
|
395
|
-
"www/.next/cache
|
|
395
|
+
"www/.next/cache",
|
|
396
396
|
],
|
|
397
397
|
"policy": "pull-push",
|
|
398
398
|
},
|
|
@@ -744,8 +744,8 @@ exports[`matches snapshot 1`] = `
|
|
|
744
744
|
"expire_in": "1 day",
|
|
745
745
|
"paths": [
|
|
746
746
|
"api/__build_info.json",
|
|
747
|
-
"api/dist",
|
|
748
747
|
"api/.next",
|
|
748
|
+
"api/dist",
|
|
749
749
|
],
|
|
750
750
|
"reports": {
|
|
751
751
|
"junit": undefined,
|
|
@@ -770,7 +770,7 @@ exports[`matches snapshot 1`] = `
|
|
|
770
770
|
{
|
|
771
771
|
"key": "api-next-cache",
|
|
772
772
|
"paths": [
|
|
773
|
-
"api/.next/cache
|
|
773
|
+
"api/.next/cache",
|
|
774
774
|
],
|
|
775
775
|
"policy": "pull-push",
|
|
776
776
|
},
|
|
@@ -1048,8 +1048,8 @@ exports[`matches snapshot 1`] = `
|
|
|
1048
1048
|
"expire_in": "1 day",
|
|
1049
1049
|
"paths": [
|
|
1050
1050
|
"www/__build_info.json",
|
|
1051
|
-
"www/dist",
|
|
1052
1051
|
"www/.next",
|
|
1052
|
+
"www/dist",
|
|
1053
1053
|
],
|
|
1054
1054
|
"reports": {
|
|
1055
1055
|
"junit": undefined,
|
|
@@ -1074,7 +1074,7 @@ exports[`matches snapshot 1`] = `
|
|
|
1074
1074
|
{
|
|
1075
1075
|
"key": "www-next-cache",
|
|
1076
1076
|
"paths": [
|
|
1077
|
-
"www/.next/cache
|
|
1077
|
+
"www/.next/cache",
|
|
1078
1078
|
],
|
|
1079
1079
|
"policy": "pull-push",
|
|
1080
1080
|
},
|
|
@@ -1374,8 +1374,8 @@ exports[`matches snapshot 1`] = `
|
|
|
1374
1374
|
"expire_in": "1 day",
|
|
1375
1375
|
"paths": [
|
|
1376
1376
|
"api/__build_info.json",
|
|
1377
|
-
"api/dist",
|
|
1378
1377
|
"api/.next",
|
|
1378
|
+
"api/dist",
|
|
1379
1379
|
],
|
|
1380
1380
|
"reports": {
|
|
1381
1381
|
"junit": undefined,
|
|
@@ -1400,7 +1400,7 @@ exports[`matches snapshot 1`] = `
|
|
|
1400
1400
|
{
|
|
1401
1401
|
"key": "api-next-cache",
|
|
1402
1402
|
"paths": [
|
|
1403
|
-
"api/.next/cache
|
|
1403
|
+
"api/.next/cache",
|
|
1404
1404
|
],
|
|
1405
1405
|
"policy": "pull-push",
|
|
1406
1406
|
},
|
|
@@ -1457,8 +1457,8 @@ exports[`matches snapshot 1`] = `
|
|
|
1457
1457
|
"expire_in": "1 day",
|
|
1458
1458
|
"paths": [
|
|
1459
1459
|
"api/__build_info.json",
|
|
1460
|
-
"api/dist",
|
|
1461
1460
|
"api/.next",
|
|
1461
|
+
"api/dist",
|
|
1462
1462
|
],
|
|
1463
1463
|
"reports": {
|
|
1464
1464
|
"junit": undefined,
|
|
@@ -1483,7 +1483,7 @@ exports[`matches snapshot 1`] = `
|
|
|
1483
1483
|
{
|
|
1484
1484
|
"key": "api-next-cache",
|
|
1485
1485
|
"paths": [
|
|
1486
|
-
"api/.next/cache
|
|
1486
|
+
"api/.next/cache",
|
|
1487
1487
|
],
|
|
1488
1488
|
"policy": "pull-push",
|
|
1489
1489
|
},
|
|
@@ -1698,8 +1698,8 @@ exports[`matches snapshot 1`] = `
|
|
|
1698
1698
|
"expire_in": "1 day",
|
|
1699
1699
|
"paths": [
|
|
1700
1700
|
"www/__build_info.json",
|
|
1701
|
-
"www/dist",
|
|
1702
1701
|
"www/.next",
|
|
1702
|
+
"www/dist",
|
|
1703
1703
|
],
|
|
1704
1704
|
"reports": {
|
|
1705
1705
|
"junit": undefined,
|
|
@@ -1724,7 +1724,7 @@ exports[`matches snapshot 1`] = `
|
|
|
1724
1724
|
{
|
|
1725
1725
|
"key": "www-next-cache",
|
|
1726
1726
|
"paths": [
|
|
1727
|
-
"www/.next/cache
|
|
1727
|
+
"www/.next/cache",
|
|
1728
1728
|
],
|
|
1729
1729
|
"policy": "pull-push",
|
|
1730
1730
|
},
|
|
@@ -1781,8 +1781,8 @@ exports[`matches snapshot 1`] = `
|
|
|
1781
1781
|
"expire_in": "1 day",
|
|
1782
1782
|
"paths": [
|
|
1783
1783
|
"www/__build_info.json",
|
|
1784
|
-
"www/dist",
|
|
1785
1784
|
"www/.next",
|
|
1785
|
+
"www/dist",
|
|
1786
1786
|
],
|
|
1787
1787
|
"reports": {
|
|
1788
1788
|
"junit": undefined,
|
|
@@ -1807,7 +1807,7 @@ exports[`matches snapshot 1`] = `
|
|
|
1807
1807
|
{
|
|
1808
1808
|
"key": "www-next-cache",
|
|
1809
1809
|
"paths": [
|
|
1810
|
-
"www/.next/cache
|
|
1810
|
+
"www/.next/cache",
|
|
1811
1811
|
],
|
|
1812
1812
|
"policy": "pull-push",
|
|
1813
1813
|
},
|
|
@@ -3,11 +3,17 @@ import { createAllPipelines } from "./__utils__/helpers";
|
|
|
3
3
|
const config: Config = {
|
|
4
4
|
appName: "test-app",
|
|
5
5
|
customerName: "pan",
|
|
6
|
+
builds: {
|
|
7
|
+
myWorkspace: {
|
|
8
|
+
type: "node",
|
|
9
|
+
},
|
|
10
|
+
},
|
|
6
11
|
components: {
|
|
7
12
|
api: {
|
|
13
|
+
dotEnv: true,
|
|
8
14
|
dir: "api",
|
|
9
15
|
build: {
|
|
10
|
-
|
|
16
|
+
from: "myWorkspace",
|
|
11
17
|
},
|
|
12
18
|
deploy: {
|
|
13
19
|
type: "google-cloudrun",
|
|
@@ -39,9 +45,10 @@ const config: Config = {
|
|
|
39
45
|
},
|
|
40
46
|
},
|
|
41
47
|
www: {
|
|
48
|
+
dotEnv: true,
|
|
42
49
|
dir: "www",
|
|
43
50
|
build: {
|
|
44
|
-
|
|
51
|
+
from: "myWorkspace",
|
|
45
52
|
},
|
|
46
53
|
deploy: {
|
|
47
54
|
type: "google-cloudrun",
|
package/package.json
CHANGED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { join } from "path";
|
|
2
|
+
import {
|
|
3
|
+
componentContextIsStandaloneBuild,
|
|
4
|
+
type ComponentContext,
|
|
5
|
+
type Context,
|
|
6
|
+
} from "../../types";
|
|
7
|
+
import type { CatladderJob } from "../../types/jobs";
|
|
8
|
+
import { uniq } from "lodash";
|
|
9
|
+
import { componentContextNeedsBuildTimeDotEnv } from "../base/writeDotEnv";
|
|
10
|
+
|
|
11
|
+
export const createBuildJobArtifacts = (
|
|
12
|
+
context: Context,
|
|
13
|
+
): CatladderJob["artifacts"] => {
|
|
14
|
+
const paths =
|
|
15
|
+
context.type === "workspace"
|
|
16
|
+
? context.components.flatMap((c) => getArtifactsPathForComponent(c))
|
|
17
|
+
: getArtifactsPathForComponent(context, ["__build_info.json"]);
|
|
18
|
+
// esxclude .env files if generated
|
|
19
|
+
const exclude =
|
|
20
|
+
context.type === "workspace"
|
|
21
|
+
? context.components.flatMap((c) => getDotEnvPathsForComponent(c))
|
|
22
|
+
: getDotEnvPathsForComponent(context);
|
|
23
|
+
return {
|
|
24
|
+
paths: uniq(paths).sort((a, b) => a.localeCompare(b)),
|
|
25
|
+
...(exclude.length > 0 ? { exclude } : {}),
|
|
26
|
+
expire_in: "1 day",
|
|
27
|
+
when: "always",
|
|
28
|
+
reports:
|
|
29
|
+
// TODO: support for junit reports in other builds
|
|
30
|
+
context.type === "component" && componentContextIsStandaloneBuild(context)
|
|
31
|
+
? {
|
|
32
|
+
junit: context.build.config.artifactsReports?.junit?.map((p) =>
|
|
33
|
+
join(context.build.dir, p),
|
|
34
|
+
),
|
|
35
|
+
}
|
|
36
|
+
: {},
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
const getArtifactsPathForComponent = (
|
|
40
|
+
c: ComponentContext,
|
|
41
|
+
additionalPaths?: string[],
|
|
42
|
+
): string[] => {
|
|
43
|
+
return [
|
|
44
|
+
...(c.build.config.artifactsPaths ?? []),
|
|
45
|
+
...(additionalPaths ?? []),
|
|
46
|
+
]?.flatMap((artifact) =>
|
|
47
|
+
c.build
|
|
48
|
+
// in theory, we only need "direct",
|
|
49
|
+
// but in some cases project may have packages in the workspace that create build artifacts, which aren't components
|
|
50
|
+
// this highly depends on the build tool. To be safe, we get all
|
|
51
|
+
.getComponentDirs("all")
|
|
52
|
+
.flatMap((cDir) => join(cDir, artifact)),
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const getDotEnvPathsForComponent = (c: ComponentContext): string[] => {
|
|
57
|
+
if (componentContextNeedsBuildTimeDotEnv(c)) {
|
|
58
|
+
return [join(c.build.dir, ".env")];
|
|
59
|
+
}
|
|
60
|
+
return [];
|
|
61
|
+
};
|