@catladder/pipeline 1.81.0 → 1.81.2
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/bundles/catladder-gitlab/index.js +1 -1
- package/dist/constants.js +1 -1
- package/dist/context/__tests__/resolveReferences.test.js +15 -20
- package/dist/context/getEnvironmentVariables.js +2 -2
- package/dist/context/resolveReferences.d.ts +1 -1
- package/dist/context/resolveReferences.js +3 -1
- package/dist/deploy/cloudRun/index.js +2 -1
- package/dist/deploy/types/googleCloudRun.d.ts +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/examples/__snapshots__/cloud-run-non-public.ts.snap +44 -44
- package/examples/__snapshots__/cloud-run-with-sql.ts.snap +100 -100
- package/examples/__snapshots__/custom-build-job.ts.snap +44 -44
- package/examples/cloud-run-with-sql.ts +1 -1
- package/package.json +1 -1
- package/src/context/__tests__/resolveReferences.test.ts +15 -30
- package/src/context/getEnvironmentVariables.ts +7 -5
- package/src/context/resolveReferences.ts +3 -6
- package/src/deploy/cloudRun/index.ts +2 -2
- package/src/deploy/types/googleCloudRun.ts +1 -1
|
@@ -39,13 +39,13 @@ exports[`matches snapshot 1`] = `
|
|
|
39
39
|
"ENV_SHORT": "dev",
|
|
40
40
|
"ENV_TYPE": "dev",
|
|
41
41
|
"GCLOUD_DEPLOY_credentialsKey": "$CL_dev_www_GCLOUD_DEPLOY_credentialsKey",
|
|
42
|
-
"HOST": "pan-test-app-dev-www-
|
|
43
|
-
"HOST_CANONICAL": "pan-test-app-dev-www-
|
|
42
|
+
"HOST": "pan-test-app-dev-www-unknown-host.example.com",
|
|
43
|
+
"HOST_CANONICAL": "pan-test-app-dev-www-unknown-host.example.com",
|
|
44
44
|
"KUBERNETES_CPU_LIMIT": "2",
|
|
45
45
|
"KUBERNETES_CPU_REQUEST": "0.5",
|
|
46
46
|
"KUBERNETES_MEMORY_LIMIT": "4Gi",
|
|
47
47
|
"KUBERNETES_MEMORY_REQUEST": "2Gi",
|
|
48
|
-
"ROOT_URL": "https://pan-test-app-dev-www-
|
|
48
|
+
"ROOT_URL": "https://pan-test-app-dev-www-unknown-host.example.com",
|
|
49
49
|
"_ALL_ENV_VAR_KEYS": "["ENV_SHORT","APP_DIR","ENV_TYPE","HOST","ROOT_URL","HOST_CANONICAL","GCLOUD_DEPLOY_credentialsKey"]",
|
|
50
50
|
},
|
|
51
51
|
},
|
|
@@ -113,7 +113,7 @@ exports[`matches snapshot 1`] = `
|
|
|
113
113
|
"auto_stop_in": "4 weeks",
|
|
114
114
|
"name": "dev/www",
|
|
115
115
|
"on_stop": "www 🛑 Stop ⚠️ | dev ",
|
|
116
|
-
"url": "https://pan-test-app-dev-www-
|
|
116
|
+
"url": "https://pan-test-app-dev-www-unknown-host.example.com",
|
|
117
117
|
},
|
|
118
118
|
"image": "path/to/docker/gcloud:the-version",
|
|
119
119
|
"interruptible": true,
|
|
@@ -184,19 +184,19 @@ exports[`matches snapshot 1`] = `
|
|
|
184
184
|
"ENV_VARS": "ENV_SHORT: 'dev'
|
|
185
185
|
APP_DIR: 'www'
|
|
186
186
|
ENV_TYPE: 'dev'
|
|
187
|
-
HOST: 'pan-test-app-dev-www-
|
|
188
|
-
ROOT_URL: 'https://pan-test-app-dev-www-
|
|
189
|
-
HOST_CANONICAL: 'pan-test-app-dev-www-
|
|
187
|
+
HOST: 'pan-test-app-dev-www-unknown-host.example.com'
|
|
188
|
+
ROOT_URL: 'https://pan-test-app-dev-www-unknown-host.example.com'
|
|
189
|
+
HOST_CANONICAL: 'pan-test-app-dev-www-unknown-host.example.com'
|
|
190
190
|
_ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","HOST","ROOT_URL","HOST_CANONICAL","GCLOUD_DEPLOY_credentialsKey"]'
|
|
191
191
|
",
|
|
192
192
|
"GCLOUD_DEPLOY_credentialsKey": "$CL_dev_www_GCLOUD_DEPLOY_credentialsKey",
|
|
193
|
-
"HOST": "pan-test-app-dev-www-
|
|
194
|
-
"HOST_CANONICAL": "pan-test-app-dev-www-
|
|
193
|
+
"HOST": "pan-test-app-dev-www-unknown-host.example.com",
|
|
194
|
+
"HOST_CANONICAL": "pan-test-app-dev-www-unknown-host.example.com",
|
|
195
195
|
"KUBERNETES_CPU_LIMIT": "1",
|
|
196
196
|
"KUBERNETES_CPU_REQUEST": "0.5",
|
|
197
197
|
"KUBERNETES_MEMORY_LIMIT": "2Gi",
|
|
198
198
|
"KUBERNETES_MEMORY_REQUEST": "1Gi",
|
|
199
|
-
"ROOT_URL": "https://pan-test-app-dev-www-
|
|
199
|
+
"ROOT_URL": "https://pan-test-app-dev-www-unknown-host.example.com",
|
|
200
200
|
"_ALL_ENV_VAR_KEYS": "["ENV_SHORT","APP_DIR","ENV_TYPE","HOST","ROOT_URL","HOST_CANONICAL","GCLOUD_DEPLOY_credentialsKey"]",
|
|
201
201
|
},
|
|
202
202
|
},
|
|
@@ -204,7 +204,7 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","HOST","ROOT_URL","HOST_CA
|
|
|
204
204
|
"environment": {
|
|
205
205
|
"action": "stop",
|
|
206
206
|
"name": "dev/www",
|
|
207
|
-
"url": "https://pan-test-app-dev-www-
|
|
207
|
+
"url": "https://pan-test-app-dev-www-unknown-host.example.com",
|
|
208
208
|
},
|
|
209
209
|
"image": "path/to/docker/gcloud:the-version",
|
|
210
210
|
"interruptible": true,
|
|
@@ -349,13 +349,13 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","HOST","ROOT_URL","HOST_CA
|
|
|
349
349
|
"ENV_SHORT": "review",
|
|
350
350
|
"ENV_TYPE": "review",
|
|
351
351
|
"GCLOUD_DEPLOY_credentialsKey": "$CL_review_www_GCLOUD_DEPLOY_credentialsKey",
|
|
352
|
-
"HOST": "pan-test-app-review-mr1234-www-
|
|
353
|
-
"HOST_CANONICAL": "pan-test-app-review-mr1234-www-
|
|
352
|
+
"HOST": "pan-test-app-review-mr1234-www-unknown-host.example.com",
|
|
353
|
+
"HOST_CANONICAL": "pan-test-app-review-mr1234-www-unknown-host.example.com",
|
|
354
354
|
"KUBERNETES_CPU_LIMIT": "2",
|
|
355
355
|
"KUBERNETES_CPU_REQUEST": "0.5",
|
|
356
356
|
"KUBERNETES_MEMORY_LIMIT": "4Gi",
|
|
357
357
|
"KUBERNETES_MEMORY_REQUEST": "2Gi",
|
|
358
|
-
"ROOT_URL": "https://pan-test-app-review-mr1234-www-
|
|
358
|
+
"ROOT_URL": "https://pan-test-app-review-mr1234-www-unknown-host.example.com",
|
|
359
359
|
"_ALL_ENV_VAR_KEYS": "["ENV_SHORT","APP_DIR","ENV_TYPE","HOST","ROOT_URL","HOST_CANONICAL","GCLOUD_DEPLOY_credentialsKey"]",
|
|
360
360
|
},
|
|
361
361
|
},
|
|
@@ -423,7 +423,7 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","HOST","ROOT_URL","HOST_CA
|
|
|
423
423
|
"auto_stop_in": "2 week",
|
|
424
424
|
"name": "review/some-commit/www",
|
|
425
425
|
"on_stop": "www 🛑 Stop ⚠️ | review ",
|
|
426
|
-
"url": "https://pan-test-app-review-mr1234-www-
|
|
426
|
+
"url": "https://pan-test-app-review-mr1234-www-unknown-host.example.com",
|
|
427
427
|
},
|
|
428
428
|
"image": "path/to/docker/gcloud:the-version",
|
|
429
429
|
"interruptible": true,
|
|
@@ -494,19 +494,19 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","HOST","ROOT_URL","HOST_CA
|
|
|
494
494
|
"ENV_VARS": "ENV_SHORT: 'review'
|
|
495
495
|
APP_DIR: 'www'
|
|
496
496
|
ENV_TYPE: 'review'
|
|
497
|
-
HOST: 'pan-test-app-review-mr1234-www-
|
|
498
|
-
ROOT_URL: 'https://pan-test-app-review-mr1234-www-
|
|
499
|
-
HOST_CANONICAL: 'pan-test-app-review-mr1234-www-
|
|
497
|
+
HOST: 'pan-test-app-review-mr1234-www-unknown-host.example.com'
|
|
498
|
+
ROOT_URL: 'https://pan-test-app-review-mr1234-www-unknown-host.example.com'
|
|
499
|
+
HOST_CANONICAL: 'pan-test-app-review-mr1234-www-unknown-host.example.com'
|
|
500
500
|
_ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","HOST","ROOT_URL","HOST_CANONICAL","GCLOUD_DEPLOY_credentialsKey"]'
|
|
501
501
|
",
|
|
502
502
|
"GCLOUD_DEPLOY_credentialsKey": "$CL_review_www_GCLOUD_DEPLOY_credentialsKey",
|
|
503
|
-
"HOST": "pan-test-app-review-mr1234-www-
|
|
504
|
-
"HOST_CANONICAL": "pan-test-app-review-mr1234-www-
|
|
503
|
+
"HOST": "pan-test-app-review-mr1234-www-unknown-host.example.com",
|
|
504
|
+
"HOST_CANONICAL": "pan-test-app-review-mr1234-www-unknown-host.example.com",
|
|
505
505
|
"KUBERNETES_CPU_LIMIT": "1",
|
|
506
506
|
"KUBERNETES_CPU_REQUEST": "0.5",
|
|
507
507
|
"KUBERNETES_MEMORY_LIMIT": "2Gi",
|
|
508
508
|
"KUBERNETES_MEMORY_REQUEST": "1Gi",
|
|
509
|
-
"ROOT_URL": "https://pan-test-app-review-mr1234-www-
|
|
509
|
+
"ROOT_URL": "https://pan-test-app-review-mr1234-www-unknown-host.example.com",
|
|
510
510
|
"_ALL_ENV_VAR_KEYS": "["ENV_SHORT","APP_DIR","ENV_TYPE","HOST","ROOT_URL","HOST_CANONICAL","GCLOUD_DEPLOY_credentialsKey"]",
|
|
511
511
|
},
|
|
512
512
|
},
|
|
@@ -514,7 +514,7 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","HOST","ROOT_URL","HOST_CA
|
|
|
514
514
|
"environment": {
|
|
515
515
|
"action": "stop",
|
|
516
516
|
"name": "review/some-commit/www",
|
|
517
|
-
"url": "https://pan-test-app-review-mr1234-www-
|
|
517
|
+
"url": "https://pan-test-app-review-mr1234-www-unknown-host.example.com",
|
|
518
518
|
},
|
|
519
519
|
"image": "path/to/docker/gcloud:the-version",
|
|
520
520
|
"interruptible": true,
|
|
@@ -659,13 +659,13 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","HOST","ROOT_URL","HOST_CA
|
|
|
659
659
|
"ENV_SHORT": "prod",
|
|
660
660
|
"ENV_TYPE": "prod",
|
|
661
661
|
"GCLOUD_DEPLOY_credentialsKey": "$CL_prod_www_GCLOUD_DEPLOY_credentialsKey",
|
|
662
|
-
"HOST": "pan-test-app-prod-www-
|
|
663
|
-
"HOST_CANONICAL": "pan-test-app-prod-www-
|
|
662
|
+
"HOST": "pan-test-app-prod-www-unknown-host.example.com",
|
|
663
|
+
"HOST_CANONICAL": "pan-test-app-prod-www-unknown-host.example.com",
|
|
664
664
|
"KUBERNETES_CPU_LIMIT": "2",
|
|
665
665
|
"KUBERNETES_CPU_REQUEST": "0.5",
|
|
666
666
|
"KUBERNETES_MEMORY_LIMIT": "4Gi",
|
|
667
667
|
"KUBERNETES_MEMORY_REQUEST": "2Gi",
|
|
668
|
-
"ROOT_URL": "https://pan-test-app-prod-www-
|
|
668
|
+
"ROOT_URL": "https://pan-test-app-prod-www-unknown-host.example.com",
|
|
669
669
|
"_ALL_ENV_VAR_KEYS": "["ENV_SHORT","APP_DIR","ENV_TYPE","HOST","ROOT_URL","HOST_CANONICAL","GCLOUD_DEPLOY_credentialsKey"]",
|
|
670
670
|
},
|
|
671
671
|
},
|
|
@@ -703,13 +703,13 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","HOST","ROOT_URL","HOST_CA
|
|
|
703
703
|
"ENV_SHORT": "stage",
|
|
704
704
|
"ENV_TYPE": "stage",
|
|
705
705
|
"GCLOUD_DEPLOY_credentialsKey": "$CL_stage_www_GCLOUD_DEPLOY_credentialsKey",
|
|
706
|
-
"HOST": "pan-test-app-stage-www-
|
|
707
|
-
"HOST_CANONICAL": "pan-test-app-stage-www-
|
|
706
|
+
"HOST": "pan-test-app-stage-www-unknown-host.example.com",
|
|
707
|
+
"HOST_CANONICAL": "pan-test-app-stage-www-unknown-host.example.com",
|
|
708
708
|
"KUBERNETES_CPU_LIMIT": "2",
|
|
709
709
|
"KUBERNETES_CPU_REQUEST": "0.5",
|
|
710
710
|
"KUBERNETES_MEMORY_LIMIT": "4Gi",
|
|
711
711
|
"KUBERNETES_MEMORY_REQUEST": "2Gi",
|
|
712
|
-
"ROOT_URL": "https://pan-test-app-stage-www-
|
|
712
|
+
"ROOT_URL": "https://pan-test-app-stage-www-unknown-host.example.com",
|
|
713
713
|
"_ALL_ENV_VAR_KEYS": "["ENV_SHORT","APP_DIR","ENV_TYPE","HOST","ROOT_URL","HOST_CANONICAL","GCLOUD_DEPLOY_credentialsKey"]",
|
|
714
714
|
},
|
|
715
715
|
},
|
|
@@ -830,7 +830,7 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","HOST","ROOT_URL","HOST_CA
|
|
|
830
830
|
"auto_stop_in": undefined,
|
|
831
831
|
"name": "prod/www",
|
|
832
832
|
"on_stop": "www 🛑 Stop ⚠️ | prod ",
|
|
833
|
-
"url": "https://pan-test-app-prod-www-
|
|
833
|
+
"url": "https://pan-test-app-prod-www-unknown-host.example.com",
|
|
834
834
|
},
|
|
835
835
|
"image": "path/to/docker/gcloud:the-version",
|
|
836
836
|
"interruptible": true,
|
|
@@ -901,19 +901,19 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","HOST","ROOT_URL","HOST_CA
|
|
|
901
901
|
"ENV_VARS": "ENV_SHORT: 'prod'
|
|
902
902
|
APP_DIR: 'www'
|
|
903
903
|
ENV_TYPE: 'prod'
|
|
904
|
-
HOST: 'pan-test-app-prod-www-
|
|
905
|
-
ROOT_URL: 'https://pan-test-app-prod-www-
|
|
906
|
-
HOST_CANONICAL: 'pan-test-app-prod-www-
|
|
904
|
+
HOST: 'pan-test-app-prod-www-unknown-host.example.com'
|
|
905
|
+
ROOT_URL: 'https://pan-test-app-prod-www-unknown-host.example.com'
|
|
906
|
+
HOST_CANONICAL: 'pan-test-app-prod-www-unknown-host.example.com'
|
|
907
907
|
_ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","HOST","ROOT_URL","HOST_CANONICAL","GCLOUD_DEPLOY_credentialsKey"]'
|
|
908
908
|
",
|
|
909
909
|
"GCLOUD_DEPLOY_credentialsKey": "$CL_prod_www_GCLOUD_DEPLOY_credentialsKey",
|
|
910
|
-
"HOST": "pan-test-app-prod-www-
|
|
911
|
-
"HOST_CANONICAL": "pan-test-app-prod-www-
|
|
910
|
+
"HOST": "pan-test-app-prod-www-unknown-host.example.com",
|
|
911
|
+
"HOST_CANONICAL": "pan-test-app-prod-www-unknown-host.example.com",
|
|
912
912
|
"KUBERNETES_CPU_LIMIT": "1",
|
|
913
913
|
"KUBERNETES_CPU_REQUEST": "0.5",
|
|
914
914
|
"KUBERNETES_MEMORY_LIMIT": "2Gi",
|
|
915
915
|
"KUBERNETES_MEMORY_REQUEST": "1Gi",
|
|
916
|
-
"ROOT_URL": "https://pan-test-app-prod-www-
|
|
916
|
+
"ROOT_URL": "https://pan-test-app-prod-www-unknown-host.example.com",
|
|
917
917
|
"_ALL_ENV_VAR_KEYS": "["ENV_SHORT","APP_DIR","ENV_TYPE","HOST","ROOT_URL","HOST_CANONICAL","GCLOUD_DEPLOY_credentialsKey"]",
|
|
918
918
|
},
|
|
919
919
|
},
|
|
@@ -928,7 +928,7 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","HOST","ROOT_URL","HOST_CA
|
|
|
928
928
|
"auto_stop_in": undefined,
|
|
929
929
|
"name": "stage/www",
|
|
930
930
|
"on_stop": "www 🛑 Stop ⚠️ | stage ",
|
|
931
|
-
"url": "https://pan-test-app-stage-www-
|
|
931
|
+
"url": "https://pan-test-app-stage-www-unknown-host.example.com",
|
|
932
932
|
},
|
|
933
933
|
"image": "path/to/docker/gcloud:the-version",
|
|
934
934
|
"interruptible": true,
|
|
@@ -999,19 +999,19 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","HOST","ROOT_URL","HOST_CA
|
|
|
999
999
|
"ENV_VARS": "ENV_SHORT: 'stage'
|
|
1000
1000
|
APP_DIR: 'www'
|
|
1001
1001
|
ENV_TYPE: 'stage'
|
|
1002
|
-
HOST: 'pan-test-app-stage-www-
|
|
1003
|
-
ROOT_URL: 'https://pan-test-app-stage-www-
|
|
1004
|
-
HOST_CANONICAL: 'pan-test-app-stage-www-
|
|
1002
|
+
HOST: 'pan-test-app-stage-www-unknown-host.example.com'
|
|
1003
|
+
ROOT_URL: 'https://pan-test-app-stage-www-unknown-host.example.com'
|
|
1004
|
+
HOST_CANONICAL: 'pan-test-app-stage-www-unknown-host.example.com'
|
|
1005
1005
|
_ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","HOST","ROOT_URL","HOST_CANONICAL","GCLOUD_DEPLOY_credentialsKey"]'
|
|
1006
1006
|
",
|
|
1007
1007
|
"GCLOUD_DEPLOY_credentialsKey": "$CL_stage_www_GCLOUD_DEPLOY_credentialsKey",
|
|
1008
|
-
"HOST": "pan-test-app-stage-www-
|
|
1009
|
-
"HOST_CANONICAL": "pan-test-app-stage-www-
|
|
1008
|
+
"HOST": "pan-test-app-stage-www-unknown-host.example.com",
|
|
1009
|
+
"HOST_CANONICAL": "pan-test-app-stage-www-unknown-host.example.com",
|
|
1010
1010
|
"KUBERNETES_CPU_LIMIT": "1",
|
|
1011
1011
|
"KUBERNETES_CPU_REQUEST": "0.5",
|
|
1012
1012
|
"KUBERNETES_MEMORY_LIMIT": "2Gi",
|
|
1013
1013
|
"KUBERNETES_MEMORY_REQUEST": "1Gi",
|
|
1014
|
-
"ROOT_URL": "https://pan-test-app-stage-www-
|
|
1014
|
+
"ROOT_URL": "https://pan-test-app-stage-www-unknown-host.example.com",
|
|
1015
1015
|
"_ALL_ENV_VAR_KEYS": "["ENV_SHORT","APP_DIR","ENV_TYPE","HOST","ROOT_URL","HOST_CANONICAL","GCLOUD_DEPLOY_credentialsKey"]",
|
|
1016
1016
|
},
|
|
1017
1017
|
},
|
|
@@ -1019,7 +1019,7 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","HOST","ROOT_URL","HOST_CA
|
|
|
1019
1019
|
"environment": {
|
|
1020
1020
|
"action": "stop",
|
|
1021
1021
|
"name": "prod/www",
|
|
1022
|
-
"url": "https://pan-test-app-prod-www-
|
|
1022
|
+
"url": "https://pan-test-app-prod-www-unknown-host.example.com",
|
|
1023
1023
|
},
|
|
1024
1024
|
"image": "path/to/docker/gcloud:the-version",
|
|
1025
1025
|
"interruptible": true,
|
|
@@ -1062,7 +1062,7 @@ _ALL_ENV_VAR_KEYS: '["ENV_SHORT","APP_DIR","ENV_TYPE","HOST","ROOT_URL","HOST_CA
|
|
|
1062
1062
|
"environment": {
|
|
1063
1063
|
"action": "stop",
|
|
1064
1064
|
"name": "stage/www",
|
|
1065
|
-
"url": "https://pan-test-app-stage-www-
|
|
1065
|
+
"url": "https://pan-test-app-stage-www-unknown-host.example.com",
|
|
1066
1066
|
},
|
|
1067
1067
|
"image": "path/to/docker/gcloud:the-version",
|
|
1068
1068
|
"interruptible": true,
|
package/package.json
CHANGED
|
@@ -17,12 +17,9 @@ describe("resolveReferences", () => {
|
|
|
17
17
|
FOO: "foo from frontend",
|
|
18
18
|
},
|
|
19
19
|
};
|
|
20
|
-
const result = await resolveReferences(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return otherVariables[componentName]?.[variableName];
|
|
24
|
-
}
|
|
25
|
-
);
|
|
20
|
+
const result = await resolveReferences(variables, async (componentName) => {
|
|
21
|
+
return otherVariables[componentName];
|
|
22
|
+
});
|
|
26
23
|
|
|
27
24
|
expect(result).toEqual({
|
|
28
25
|
a: "hello world",
|
|
@@ -53,12 +50,9 @@ describe("resolveReferences", () => {
|
|
|
53
50
|
FOO: "foo from api",
|
|
54
51
|
},
|
|
55
52
|
};
|
|
56
|
-
const result = await resolveReferences(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return otherVariables[componentName]?.[variableName];
|
|
60
|
-
}
|
|
61
|
-
);
|
|
53
|
+
const result = await resolveReferences(variables, async (componentName) => {
|
|
54
|
+
return otherVariables[componentName];
|
|
55
|
+
});
|
|
62
56
|
|
|
63
57
|
expect(result).toEqual({
|
|
64
58
|
FOO: "hello from foo from api",
|
|
@@ -72,12 +66,9 @@ describe("resolveReferences", () => {
|
|
|
72
66
|
b: "a not found value looks like this: '${api:FOO}'",
|
|
73
67
|
};
|
|
74
68
|
const otherVariables: Record<string, Record<string, string>> = {};
|
|
75
|
-
const result = await resolveReferences(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
return otherVariables[componentName]?.[variableName];
|
|
79
|
-
}
|
|
80
|
-
);
|
|
69
|
+
const result = await resolveReferences(variables, async (componentName) => {
|
|
70
|
+
return otherVariables[componentName];
|
|
71
|
+
});
|
|
81
72
|
|
|
82
73
|
expect(result).toEqual({
|
|
83
74
|
a: "hello world",
|
|
@@ -97,12 +88,9 @@ describe("resolveReferences", () => {
|
|
|
97
88
|
FOO: "hi, ${api:FOO}",
|
|
98
89
|
},
|
|
99
90
|
};
|
|
100
|
-
const result = await resolveReferences(
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
return otherVariables[componentName]?.[variableName] ?? "";
|
|
104
|
-
}
|
|
105
|
-
);
|
|
91
|
+
const result = await resolveReferences(variables, async (componentName) => {
|
|
92
|
+
return otherVariables[componentName];
|
|
93
|
+
});
|
|
106
94
|
|
|
107
95
|
expect(result).toEqual({
|
|
108
96
|
a: "value is hi, foo from api!",
|
|
@@ -121,12 +109,9 @@ describe("resolveReferences", () => {
|
|
|
121
109
|
FOO: "frontend ${api:FOO}",
|
|
122
110
|
},
|
|
123
111
|
};
|
|
124
|
-
const result = await resolveReferences(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
return otherVariables[componentName]?.[variableName] ?? "";
|
|
128
|
-
}
|
|
129
|
-
);
|
|
112
|
+
const result = await resolveReferences(variables, async (componentName) => {
|
|
113
|
+
return otherVariables[componentName];
|
|
114
|
+
});
|
|
130
115
|
|
|
131
116
|
expect(result).toEqual({
|
|
132
117
|
a: "value is frontend api ${frontend:FOO}!",
|
|
@@ -53,7 +53,7 @@ export const getEnvironmentVariables = async (
|
|
|
53
53
|
} else {
|
|
54
54
|
const additionalEnvVars = deployConfigRaw
|
|
55
55
|
? DEPLOY_TYPES[deployConfigRaw.type].getAdditionalEnvVars(
|
|
56
|
-
environmentContext
|
|
56
|
+
environmentContext as never
|
|
57
57
|
)
|
|
58
58
|
: {};
|
|
59
59
|
|
|
@@ -66,7 +66,9 @@ export const getEnvironmentVariables = async (
|
|
|
66
66
|
predefinedVariables = {
|
|
67
67
|
...basePredefinedVariables,
|
|
68
68
|
// Rails before 6.1 (mis)uses the `HOST` environment variable to specify the IP to bind to
|
|
69
|
-
...(config.components[componentName].build.type === "rails"
|
|
69
|
+
...(config.components[componentName].build.type === "rails"
|
|
70
|
+
? {}
|
|
71
|
+
: { HOST: host }),
|
|
70
72
|
ROOT_URL: url,
|
|
71
73
|
...additionalEnvVars,
|
|
72
74
|
};
|
|
@@ -75,7 +77,7 @@ export const getEnvironmentVariables = async (
|
|
|
75
77
|
|
|
76
78
|
const additionalSecretKeys = deployConfigRaw
|
|
77
79
|
? DEPLOY_TYPES[deployConfigRaw.type].additionalSecretKeys(
|
|
78
|
-
environmentContext
|
|
80
|
+
environmentContext as never
|
|
79
81
|
)
|
|
80
82
|
: [];
|
|
81
83
|
|
|
@@ -115,7 +117,7 @@ export const getEnvironmentVariables = async (
|
|
|
115
117
|
|
|
116
118
|
const envVars = await resolveReferences(
|
|
117
119
|
envVarsRaw,
|
|
118
|
-
async (otherComponentName,
|
|
120
|
+
async (otherComponentName, alreadyVisited) => {
|
|
119
121
|
const { envVars: otherEnvVars } = await getEnvironmentVariables(
|
|
120
122
|
config,
|
|
121
123
|
otherComponentName,
|
|
@@ -123,7 +125,7 @@ export const getEnvironmentVariables = async (
|
|
|
123
125
|
commitInfo,
|
|
124
126
|
alreadyVisited
|
|
125
127
|
);
|
|
126
|
-
return otherEnvVars
|
|
128
|
+
return otherEnvVars;
|
|
127
129
|
},
|
|
128
130
|
alreadyVisited
|
|
129
131
|
);
|
|
@@ -7,9 +7,8 @@ export const resolveReferences = async (
|
|
|
7
7
|
vars: Record<string, string>,
|
|
8
8
|
getOtherVariables?: (
|
|
9
9
|
componentName: string,
|
|
10
|
-
variableName: string,
|
|
11
10
|
alreadyVisited: Record<string, Record<string, boolean>>
|
|
12
|
-
) => Promise<string | null
|
|
11
|
+
) => Promise<Record<string, string | null>>,
|
|
13
12
|
alreadyVisitedBase: Record<string, Record<string, boolean>> = {}
|
|
14
13
|
) => {
|
|
15
14
|
const replaceSingleValue = async (
|
|
@@ -30,10 +29,8 @@ export const resolveReferences = async (
|
|
|
30
29
|
},
|
|
31
30
|
});
|
|
32
31
|
const result = componentName
|
|
33
|
-
? (await getOtherVariables?.(
|
|
34
|
-
|
|
35
|
-
variableName,
|
|
36
|
-
newAlreadyVisited
|
|
32
|
+
? (await getOtherVariables?.(componentName, newAlreadyVisited).then(
|
|
33
|
+
(r) => r?.[variableName]
|
|
37
34
|
)) ?? null
|
|
38
35
|
: vars[variableName]; // is self reference
|
|
39
36
|
|
|
@@ -67,9 +67,9 @@ export const GCLOUD_RUN_DEPLOY_TYPE: DeployTypeDefinition<"google-cloudrun"> = {
|
|
|
67
67
|
const HOST_CANONICAL =
|
|
68
68
|
fullName.toLowerCase() +
|
|
69
69
|
"-" +
|
|
70
|
-
process.env[
|
|
70
|
+
(process.env[
|
|
71
71
|
getSecretVarName(env, componentName, GCLOUD_RUN_CANONICAL_HOST_SUFFIX)
|
|
72
|
-
];
|
|
72
|
+
] ?? "unknown-host.example.com");
|
|
73
73
|
|
|
74
74
|
const jobTriggers =
|
|
75
75
|
deployConfigRaw && deployConfigRaw.jobs
|