@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/package.json CHANGED
@@ -53,7 +53,7 @@
53
53
  }
54
54
  ],
55
55
  "license": "MIT",
56
- "version": "2.2.1",
56
+ "version": "2.2.3",
57
57
  "scripts": {
58
58
  "build:tsc": "yarn tsc",
59
59
  "build": "yarn build:compile && yarn build:inline-variables",
@@ -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?: StringOrBashExpression;
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
- // Rails before 6.1 (mis)uses the `HOST` environment variable to specify the IP to bind to
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
 
@@ -26,7 +26,7 @@ const createAppConfig = (
26
26
 
27
27
  return mergeWithMergingArrays(
28
28
  {
29
- host: context.environment.host,
29
+ host: context.environment.envVars.HOSTNAME,
30
30
  command: command ?? context.build.config.startCommand,
31
31
  livenessProbe: {
32
32
  httpGet: {
@@ -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.url}" "${SBOM_FILE}" vex.json || true`,
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.url}" || true`,
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 { url, envType } = environment;
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}=${url}" >> ${dotEnvFile}`,
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
@@ -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
  */