@catladder/pipeline 2.2.1 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants.js +1 -1
- package/dist/context/getEnvironmentVariables.d.ts +1 -1
- package/dist/context/getEnvironmentVariables.js +3 -4
- package/dist/deploy/kubernetes/kubeValues.js +1 -1
- package/dist/deploy/sbom.js +2 -2
- package/dist/pipeline/gitlab/createGitlabJobs.js +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/context.d.ts +0 -4
- package/examples/__snapshots__/rails-k8s-with-worker-dockerfile.test.ts.snap +36 -16
- package/examples/__snapshots__/rails-k8s-with-worker.test.ts.snap +36 -16
- package/package.json +1 -1
- package/src/context/getEnvironmentVariables.ts +2 -10
- package/src/deploy/kubernetes/kubeValues.ts +1 -1
- package/src/deploy/sbom.ts +2 -2
- package/src/pipeline/gitlab/createGitlabJobs.ts +2 -2
- package/src/types/context.ts +0 -5
package/package.json
CHANGED
|
@@ -40,7 +40,7 @@ type BasePredefinedVariables = ReturnType<typeof getBasePredefinedVariables>;
|
|
|
40
40
|
|
|
41
41
|
// we export so that we have later nice autocomplete
|
|
42
42
|
export type PredefinedVariables = BasePredefinedVariables & {
|
|
43
|
-
HOSTNAME
|
|
43
|
+
HOSTNAME: StringOrBashExpression;
|
|
44
44
|
ROOT_URL: StringOrBashExpression;
|
|
45
45
|
HOSTNAME_INTERNAL: StringOrBashExpression;
|
|
46
46
|
ROOT_URL_INTERNAL: StringOrBashExpression;
|
|
@@ -92,14 +92,9 @@ export const getEnvironmentVariables = async (
|
|
|
92
92
|
|
|
93
93
|
predefinedVariables = {
|
|
94
94
|
...basePredefinedVariables,
|
|
95
|
-
|
|
96
|
-
...(isStandaloneBuildConfig(buildConfigRaw) &&
|
|
97
|
-
buildConfigRaw.type === "rails"
|
|
98
|
-
? {}
|
|
99
|
-
: { HOSTNAME: host }),
|
|
95
|
+
HOSTNAME: host,
|
|
100
96
|
ROOT_URL: url,
|
|
101
97
|
HOSTNAME_INTERNAL,
|
|
102
|
-
|
|
103
98
|
ROOT_URL_INTERNAL: joinBashExpressions(["https://", HOSTNAME_INTERNAL]),
|
|
104
99
|
...additionalEnvVars,
|
|
105
100
|
};
|
|
@@ -176,9 +171,6 @@ export const getEnvironmentVariables = async (
|
|
|
176
171
|
(deployConfigRaw && deployConfigRaw.jobVars) || null,
|
|
177
172
|
),
|
|
178
173
|
},
|
|
179
|
-
|
|
180
|
-
host,
|
|
181
|
-
url,
|
|
182
174
|
};
|
|
183
175
|
};
|
|
184
176
|
|
package/src/deploy/sbom.ts
CHANGED
|
@@ -16,7 +16,7 @@ export const getDependencyTrackUploadScript = (
|
|
|
16
16
|
? []
|
|
17
17
|
: [
|
|
18
18
|
"echo 'Uploading SBOM to Dependency Track'",
|
|
19
|
-
`/dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" upload "${context.fullConfig.customerName}-${context.fullConfig.appName}/${context.name}" "${context.environment.
|
|
19
|
+
`/dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" upload "${context.fullConfig.customerName}-${context.fullConfig.appName}/${context.name}" "${context.environment.envVars.ROOT_URL}" "${SBOM_FILE}" vex.json || true`,
|
|
20
20
|
];
|
|
21
21
|
};
|
|
22
22
|
|
|
@@ -27,6 +27,6 @@ export const getDependencyTrackDeleteScript = (
|
|
|
27
27
|
? []
|
|
28
28
|
: [
|
|
29
29
|
"echo 'Disabling component in Dependency Track'",
|
|
30
|
-
`/dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" disable "${context.fullConfig.customerName}-${context.fullConfig.appName}/${context.name}" "${context.environment.
|
|
30
|
+
`/dtrackuploader https://dep.panter.swiss/ "$DT_KEY_PROD" disable "${context.fullConfig.customerName}-${context.fullConfig.appName}/${context.name}" "${context.environment.envVars.ROOT_URL}" || true`,
|
|
31
31
|
];
|
|
32
32
|
};
|
|
@@ -222,14 +222,14 @@ const addGitlabEnvironment = (
|
|
|
222
222
|
return job;
|
|
223
223
|
}
|
|
224
224
|
const { env, name, environment } = context;
|
|
225
|
-
const {
|
|
225
|
+
const { envVars, envType } = environment;
|
|
226
226
|
const { on_stop, ...restEnvironment } = catladderJobEnvironment;
|
|
227
227
|
// those can be dynamic, so we therefore have to do this: https://docs.gitlab.com/ee/ci/environments/#set-a-dynamic-environment-url
|
|
228
228
|
|
|
229
229
|
const dotEnvFile = "gitlab_environment.env";
|
|
230
230
|
|
|
231
231
|
const scriptToAdd = [
|
|
232
|
-
`echo "${GITLAB_ENVIRONMENT_URL_VARIABLE}=${
|
|
232
|
+
`echo "${GITLAB_ENVIRONMENT_URL_VARIABLE}=${envVars.ROOT_URL}" >> ${dotEnvFile}`,
|
|
233
233
|
];
|
|
234
234
|
|
|
235
235
|
// this is NOT a bashVariable since it NEEDS to be used as a string in gitlab
|
package/src/types/context.ts
CHANGED
|
@@ -28,9 +28,6 @@ export type EnvironmentEnvVars<
|
|
|
28
28
|
secretEnvVarKeys: SecretEnvVar[];
|
|
29
29
|
};
|
|
30
30
|
export type EnvironmentEnvVarPart = {
|
|
31
|
-
host: StringOrBashExpression;
|
|
32
|
-
url: StringOrBashExpression;
|
|
33
|
-
|
|
34
31
|
/**
|
|
35
32
|
* vars that only are injected in certain jobs, but not elsewhere
|
|
36
33
|
*/
|
|
@@ -41,8 +38,6 @@ export type EnvironmentEnvVarPart = {
|
|
|
41
38
|
} & EnvironmentEnvVars<PredefinedVariables>;
|
|
42
39
|
// FIXME: align with EnvironmentContext
|
|
43
40
|
export type Environment = {
|
|
44
|
-
host: StringOrBashExpression;
|
|
45
|
-
url: StringOrBashExpression;
|
|
46
41
|
/**
|
|
47
42
|
* the full name of the app. We use this as RELEASE_NAME in kubernetes and the service name in google cloud run
|
|
48
43
|
*/
|