@catladder/pipeline 1.101.4 → 1.102.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/base/createBuildJob.js +1 -1
- package/dist/build/custom/testJob.js +2 -2
- package/dist/build/node/testJob.js +2 -2
- package/dist/build/rails/build.js +11 -1
- package/dist/build/rails/test.js +1 -1
- package/dist/build/types.d.ts +8 -1
- package/dist/bundles/catladder-gitlab/index.js +3 -3
- package/dist/constants.js +1 -1
- package/dist/context/getEnvironment.js +18 -12
- package/dist/context/getEnvironmentVariables.d.ts +2 -7
- package/dist/context/getEnvironmentVariables.js +27 -31
- package/dist/context/transformJobOnlyVars.d.ts +10 -0
- package/dist/context/transformJobOnlyVars.js +160 -0
- package/dist/context/utils/envVars.d.ts +8 -0
- package/dist/context/utils/envVars.js +52 -0
- package/dist/deploy/base.js +3 -3
- package/dist/deploy/types/base.d.ts +8 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/context.d.ts +16 -6
- package/examples/__snapshots__/custom-deploy.ts.snap +8 -0
- package/examples/custom-deploy.ts +3 -0
- package/package.json +1 -1
- package/src/build/base/createBuildJob.ts +1 -0
- package/src/build/custom/testJob.ts +1 -0
- package/src/build/node/testJob.ts +1 -0
- package/src/build/rails/build.ts +4 -1
- package/src/build/rails/test.ts +4 -1
- package/src/build/types.ts +9 -1
- package/src/context/getEnvironment.ts +9 -7
- package/src/context/getEnvironmentVariables.ts +36 -24
- package/src/context/transformJobOnlyVars.ts +42 -0
- package/src/context/utils/envVars.ts +26 -0
- package/src/deploy/base.ts +3 -0
- package/src/deploy/types/base.ts +10 -0
- package/src/types/context.ts +18 -6
package/src/deploy/base.ts
CHANGED
|
@@ -76,6 +76,7 @@ export const getBaseDeploymentJob = (context: Context): JobWithoutScript => {
|
|
|
76
76
|
...DEPLOY_RUNNER_VARIABLES,
|
|
77
77
|
...context.environment.envVars,
|
|
78
78
|
...(hasDocker ? getDockerImageVariables(context) : {}),
|
|
79
|
+
...context.environment.jobOnlyVars.deploy.envVars,
|
|
79
80
|
...(context.componentConfig.deploy
|
|
80
81
|
? context.componentConfig.deploy.extraVars ?? {}
|
|
81
82
|
: {}),
|
|
@@ -115,6 +116,7 @@ export const getBaseDeploymentStopJob = (
|
|
|
115
116
|
],
|
|
116
117
|
variables: {
|
|
117
118
|
...DEPLOY_RUNNER_VARIABLES,
|
|
119
|
+
...context.environment.jobOnlyVars.deploy.envVars,
|
|
118
120
|
GIT_STRATEGY: "none",
|
|
119
121
|
},
|
|
120
122
|
stage: "stop",
|
|
@@ -138,6 +140,7 @@ export const getBaseRollbackJob = (context: Context): JobWithoutScript => {
|
|
|
138
140
|
],
|
|
139
141
|
variables: {
|
|
140
142
|
...DEPLOY_RUNNER_VARIABLES,
|
|
143
|
+
...context.environment.jobOnlyVars.deploy.envVars,
|
|
141
144
|
GIT_STRATEGY: "none",
|
|
142
145
|
},
|
|
143
146
|
stage: "rollback",
|
package/src/deploy/types/base.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { EnvVars } from "../../types/config";
|
|
2
|
+
|
|
1
3
|
export type DeployConfigBase = {
|
|
2
4
|
/**
|
|
3
5
|
* whether to deploy automatically or manual. If not defined, these rules apply:
|
|
@@ -17,8 +19,16 @@ export type DeployConfigBase = {
|
|
|
17
19
|
*/
|
|
18
20
|
jobTags?: string[];
|
|
19
21
|
|
|
22
|
+
/**
|
|
23
|
+
* vars that only exist in the deploy job.
|
|
24
|
+
* Can curently not reference other variables from other components
|
|
25
|
+
*/
|
|
26
|
+
jobVars?: EnvVars;
|
|
27
|
+
|
|
20
28
|
/**
|
|
21
29
|
* additional env vars for the deploy job
|
|
30
|
+
*
|
|
31
|
+
* @deprecated use deploy.jobVars for deploy job specific variables
|
|
22
32
|
*/
|
|
23
33
|
extraVars?: Record<string, string>;
|
|
24
34
|
};
|
package/src/types/context.ts
CHANGED
|
@@ -6,6 +6,22 @@ import type {
|
|
|
6
6
|
EnvType,
|
|
7
7
|
} from "./config";
|
|
8
8
|
|
|
9
|
+
export type EnvironmentEnvVars = {
|
|
10
|
+
envVars: Record<string, string>;
|
|
11
|
+
secretEnvVarKeys: SecretEnvVar[];
|
|
12
|
+
};
|
|
13
|
+
export type EnvironmentEnvVarPart = {
|
|
14
|
+
host: string;
|
|
15
|
+
url: string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* vars that only are injected in certain jobs, but not elsewhere
|
|
19
|
+
*/
|
|
20
|
+
jobOnlyVars: {
|
|
21
|
+
deploy: EnvironmentEnvVars;
|
|
22
|
+
build: EnvironmentEnvVars;
|
|
23
|
+
};
|
|
24
|
+
} & EnvironmentEnvVars;
|
|
9
25
|
export type Environment = {
|
|
10
26
|
host: string;
|
|
11
27
|
url: string;
|
|
@@ -21,13 +37,9 @@ export type Environment = {
|
|
|
21
37
|
shortName: string;
|
|
22
38
|
slugPrefix: string;
|
|
23
39
|
slug: string;
|
|
24
|
-
|
|
25
|
-
* env vars contain all build-time env vars. secrets have to be resolved (they are stored in gitlab)
|
|
26
|
-
*/
|
|
27
|
-
envVars: Record<string, string>;
|
|
40
|
+
|
|
28
41
|
envType: EnvType;
|
|
29
|
-
|
|
30
|
-
};
|
|
42
|
+
} & EnvironmentEnvVarPart;
|
|
31
43
|
|
|
32
44
|
export type CommitInfo = {
|
|
33
45
|
refName: string;
|