@catladder/pipeline 0.0.0-refactor-needs-c896b98e → 0.0.0-refactor-args-52277d47
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/node/cache.js +10 -2
- package/dist/build/rails/test.js +2 -1
- package/dist/bundles/catladder-gitlab/index.js +138 -58
- package/dist/constants.js +1 -1
- package/dist/deploy/base.js +1 -1
- package/dist/deploy/cloudRun/deployJob.js +7 -12
- package/dist/deploy/cloudRun/index.js +2 -2
- package/dist/deploy/cloudRun/utils/createArgsString.d.ts +11 -0
- package/dist/deploy/cloudRun/utils/createArgsString.js +50 -0
- package/dist/deploy/kubernetes/kubeValues.d.ts +13 -10
- package/dist/deploy/kubernetes/kubeValues.js +47 -2
- package/dist/deploy/kubernetes/processSecretsAsFiles.d.ts +2 -2
- package/dist/deploy/types/googleCloudRun.d.ts +4 -0
- package/dist/deploy/types/kubernetes.d.ts +3 -2
- package/dist/pipeline/createJobs.js +9 -4
- package/dist/pipeline/gitlab/makeGitlabJob.js +2 -33
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/jobs.d.ts +6 -7
- package/examples/__snapshots__/cloud-run-with-sql.ts.snap +1778 -416
- package/examples/__snapshots__/custom-build-job.ts.snap +8 -8
- package/examples/__snapshots__/kubernetes-with-jobs.ts.snap +4077 -0
- package/examples/cloud-run-with-sql.ts +23 -0
- package/examples/kubernetes-with-jobs.ts +68 -0
- package/package.json +1 -1
- package/src/build/node/cache.ts +5 -2
- package/src/build/rails/test.ts +1 -1
- package/src/deploy/base.ts +1 -1
- package/src/deploy/cloudRun/deployJob.ts +8 -7
- package/src/deploy/cloudRun/index.ts +2 -1
- package/src/deploy/cloudRun/utils/createArgsString.ts +19 -0
- package/src/deploy/kubernetes/kubeValues.ts +14 -2
- package/src/deploy/types/googleCloudRun.ts +5 -0
- package/src/deploy/types/kubernetes.ts +20 -17
- package/src/pipeline/createJobs.ts +17 -14
- package/src/pipeline/gitlab/makeGitlabJob.ts +1 -3
- package/src/types/jobs.ts +8 -9
|
@@ -13,9 +13,16 @@ const config: Config = {
|
|
|
13
13
|
type: "google-cloudrun",
|
|
14
14
|
projectId: "google-project-id",
|
|
15
15
|
region: "europe-west6",
|
|
16
|
+
// optional, set min and max instances
|
|
17
|
+
// defaults to 0-100
|
|
18
|
+
service: {
|
|
19
|
+
minInstances: 0,
|
|
20
|
+
maxInstances: 5,
|
|
21
|
+
},
|
|
16
22
|
cloudSql: {
|
|
17
23
|
type: "unmanaged",
|
|
18
24
|
instanceConnectionName: "projectId:region:instancename",
|
|
25
|
+
dbUser: "my-user",
|
|
19
26
|
},
|
|
20
27
|
jobs: {
|
|
21
28
|
migration: {
|
|
@@ -30,6 +37,22 @@ const config: Config = {
|
|
|
30
37
|
},
|
|
31
38
|
},
|
|
32
39
|
},
|
|
40
|
+
www: {
|
|
41
|
+
dir: "www",
|
|
42
|
+
build: {
|
|
43
|
+
type: "node",
|
|
44
|
+
},
|
|
45
|
+
deploy: {
|
|
46
|
+
type: "google-cloudrun",
|
|
47
|
+
projectId: "google-project-id",
|
|
48
|
+
region: "europe-west6",
|
|
49
|
+
},
|
|
50
|
+
vars: {
|
|
51
|
+
public: {
|
|
52
|
+
API_URL: "${api:ROOT_URL}",
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
33
56
|
},
|
|
34
57
|
};
|
|
35
58
|
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { Config } from "../src";
|
|
2
|
+
import { createAllPipelines } from "./__utils__/helpers";
|
|
3
|
+
const config: Config = {
|
|
4
|
+
appName: "test-app",
|
|
5
|
+
customerName: "pan",
|
|
6
|
+
components: {
|
|
7
|
+
api: {
|
|
8
|
+
dir: "api",
|
|
9
|
+
build: {
|
|
10
|
+
type: "node",
|
|
11
|
+
},
|
|
12
|
+
deploy: {
|
|
13
|
+
type: "kubernetes",
|
|
14
|
+
cluster: {
|
|
15
|
+
name: "some-cluster-name",
|
|
16
|
+
region: "europe-west6",
|
|
17
|
+
projectId: "some-project-id",
|
|
18
|
+
type: "gcloud",
|
|
19
|
+
domainCanonical: "panter.cloud",
|
|
20
|
+
},
|
|
21
|
+
values: {
|
|
22
|
+
jobs: {
|
|
23
|
+
migration: {
|
|
24
|
+
command: "yarn migrate",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
cronjobs: {
|
|
28
|
+
["send-emails"]: {
|
|
29
|
+
command: "yarn send emails",
|
|
30
|
+
schedule: "0 * * * *",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
env: {
|
|
36
|
+
review: {
|
|
37
|
+
deploy: {
|
|
38
|
+
values: {
|
|
39
|
+
cronjobs: {
|
|
40
|
+
["send-emails"]: false,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
www: {
|
|
48
|
+
dir: "www",
|
|
49
|
+
build: {
|
|
50
|
+
type: "node",
|
|
51
|
+
},
|
|
52
|
+
deploy: {
|
|
53
|
+
type: "kubernetes",
|
|
54
|
+
cluster: {
|
|
55
|
+
name: "some-cluster-name",
|
|
56
|
+
region: "europe-west6",
|
|
57
|
+
projectId: "some-project-id",
|
|
58
|
+
type: "gcloud",
|
|
59
|
+
domainCanonical: "panter.cloud",
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
it("matches snapshot", async () => {
|
|
67
|
+
expect(await createAllPipelines(config)).toMatchSnapshot();
|
|
68
|
+
});
|
package/package.json
CHANGED
package/src/build/node/cache.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { join } from "path";
|
|
2
|
+
import slugify from "slugify";
|
|
2
3
|
import type { Context } from "../../types/context";
|
|
3
4
|
import type { GitlabJobCache } from "../../types/gitlab-types";
|
|
4
5
|
|
|
@@ -16,7 +17,7 @@ export const getYarnCache = (
|
|
|
16
17
|
paths: [".yarn"],
|
|
17
18
|
}
|
|
18
19
|
: {
|
|
19
|
-
key: context.componentConfig.dir + "-yarn",
|
|
20
|
+
key: slugify(context.componentConfig.dir) + "-yarn",
|
|
20
21
|
policy,
|
|
21
22
|
paths: [join(context.componentConfig.dir, ".yarn")],
|
|
22
23
|
},
|
|
@@ -30,12 +31,14 @@ export const getNodeModulesCache = (
|
|
|
30
31
|
const componentIsInWorkspace =
|
|
31
32
|
context.packageManagerInfo?.componentIsInWorkspace;
|
|
32
33
|
|
|
34
|
+
// We intentionally do not use the contents of yarn.lock as a cache key, as yarn install should always guarantee that the files are updated, but it can still use part of the cache if not all packages are up-to-date.
|
|
35
|
+
// It would slow down all pipelines whenever one adds a new dependency as it will need to download all node_modules again.
|
|
33
36
|
return [
|
|
34
37
|
{
|
|
35
38
|
// if component is in a shared workspace, use workspace cache. use individual cache else
|
|
36
39
|
key: componentIsInWorkspace
|
|
37
40
|
? "node-modules-workspace"
|
|
38
|
-
: context.componentConfig.dir + "-node-modules", // we use the dirname, not the component name, because in certain cases we have two apps in the same directory and want to share the cache, e.g. when having storybook in the same package.json
|
|
41
|
+
: slugify(context.componentConfig.dir) + "-node-modules", // we use the dirname, not the component name, because in certain cases we have two apps in the same directory and want to share the cache, e.g. when having storybook in the same package.json
|
|
39
42
|
policy,
|
|
40
43
|
paths: [
|
|
41
44
|
...(componentIsInWorkspace
|
package/src/build/rails/test.ts
CHANGED
|
@@ -25,7 +25,7 @@ export const createRailsTestJobs = (context: Context): CatladderJob[] => {
|
|
|
25
25
|
const bundlerCache = {
|
|
26
26
|
key: {
|
|
27
27
|
files: ["Gemfile.lock"],
|
|
28
|
-
prefix: "$CI_JOB_IMAGE"
|
|
28
|
+
prefix: "$CI_JOB_IMAGE" // a changed image might have different OS libraries which no longer work with the cached gems
|
|
29
29
|
},
|
|
30
30
|
paths: [bundlerCacheDir]
|
|
31
31
|
}
|
package/src/deploy/base.ts
CHANGED
|
@@ -44,7 +44,7 @@ export const getBaseDeploymentJob = (context: Context): JobWithoutScript => {
|
|
|
44
44
|
name: DEPLOY_JOB_NAME,
|
|
45
45
|
envMode: "stagePerEnv", // makes it easier to run manual tasks er env
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
needsOtherComponent: context.componentConfig.deploy
|
|
48
48
|
? context.componentConfig.deploy.waitFor?.map((c) => ({
|
|
49
49
|
componentName: c,
|
|
50
50
|
job: DEPLOY_JOB_NAME,
|
|
@@ -21,11 +21,13 @@ import {
|
|
|
21
21
|
} from "./utils/database";
|
|
22
22
|
import { allowFailureInScripts } from "../../utils/gitlab";
|
|
23
23
|
import { getCloudRunJobName } from "./utils/jobName";
|
|
24
|
+
import { createArgsString } from "./utils/createArgsString";
|
|
24
25
|
|
|
25
26
|
const setExtraVarsScripts = (deployConfig: DeployConfigCloudRun) => [
|
|
26
27
|
`export GCLOUD_PROJECT_NUMBER=$(gcloud projects describe ${deployConfig.projectId} --format="value(projectNumber)")`,
|
|
27
28
|
`echo "GCLOUD_PROJECT_NUMBER: $GCLOUD_PROJECT_NUMBER"`,
|
|
28
29
|
];
|
|
30
|
+
|
|
29
31
|
export const createGoogleCloudRunDeployJobs = (
|
|
30
32
|
context: Context
|
|
31
33
|
): CatladderJob[] => {
|
|
@@ -60,11 +62,14 @@ export const createGoogleCloudRunDeployJobs = (
|
|
|
60
62
|
.map(([key, value]) => `${key}=${value}`)
|
|
61
63
|
.join(",");
|
|
62
64
|
|
|
63
|
-
const commonArgs =
|
|
65
|
+
const commonArgs = createArgsString({
|
|
66
|
+
project: deployConfig.projectId,
|
|
67
|
+
region: deployConfig.region,
|
|
68
|
+
});
|
|
64
69
|
const cloudRunArgs = deployConfig.cloudSql
|
|
65
70
|
? `--set-cloudsql-instances=${deployConfig.cloudSql.instanceConnectionName}`
|
|
66
71
|
: "";
|
|
67
|
-
const commonDeployArgs = `--image
|
|
72
|
+
const commonDeployArgs = `--image=${gcloudImageName} ${commonArgs} ${cloudRunArgs} --labels=${labelsString}`;
|
|
68
73
|
const serviceName = context.environment.fullName.toLowerCase();
|
|
69
74
|
|
|
70
75
|
const getFullJobName = (name: string) =>
|
|
@@ -115,11 +120,7 @@ export const createGoogleCloudRunDeployJobs = (
|
|
|
115
120
|
"no-cpu-throttling": customConfig?.noCpuThrottling,
|
|
116
121
|
} as const;
|
|
117
122
|
|
|
118
|
-
const argsString =
|
|
119
|
-
.filter(([, value]) => !isNil(value))
|
|
120
|
-
.map(([key, value]) => `--${key}${value !== true ? `=${value}` : ""}`)
|
|
121
|
-
.join(" ");
|
|
122
|
-
|
|
123
|
+
const argsString = createArgsString(args);
|
|
123
124
|
return `gcloud run deploy ${serviceName}${
|
|
124
125
|
nameSuffix ?? ""
|
|
125
126
|
} ${commandArg} ${commonDeployArgs} --env-vars-file=____envvars.yaml ${argsString}`;
|
|
@@ -31,11 +31,12 @@ const getCloudSqlVariables = ({
|
|
|
31
31
|
)
|
|
32
32
|
.map(([key, value]) => `&${key}=${value}`)
|
|
33
33
|
.join("");
|
|
34
|
+
|
|
34
35
|
return {
|
|
35
36
|
CLOUD_SQL_INSTANCE_CONNECTION_NAME:
|
|
36
37
|
deployConfigRaw.cloudSql.instanceConnectionName,
|
|
37
38
|
DB_NAME: DB_NAME,
|
|
38
|
-
DB_USER: "postgres",
|
|
39
|
+
DB_USER: deployConfigRaw.cloudSql.dbUser ?? "postgres",
|
|
39
40
|
DB_PASSWORD: "$" + getSecretVarName(env, componentName, "DB_PASSWORD"),
|
|
40
41
|
DATABASE_URL: `postgresql://$DB_USER:$DB_PASSWORD@localhost/$DB_NAME?host=/cloudsql/$CLOUD_SQL_INSTANCE_CONNECTION_NAME${additionalQueryParamsString}`,
|
|
41
42
|
DATABASE_JDBC_URL: `jdbc:postgresql:///$DB_NAME?cloudSqlInstance=$CLOUD_SQL_INSTANCE_CONNECTION_NAME&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=$DB_USER&password=$DB_PASSWORD${additionalQueryParamsString}`,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { isNil } from "lodash";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* creates arguments string:
|
|
5
|
+
*
|
|
6
|
+
* --key=value
|
|
7
|
+
*
|
|
8
|
+
* - undefined or null values will get removed completly
|
|
9
|
+
* - true will just be "--key"
|
|
10
|
+
* @param args args record
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
export const createArgsString = (
|
|
14
|
+
args: Record<string, string | number | true | undefined>
|
|
15
|
+
) =>
|
|
16
|
+
Object.entries(args)
|
|
17
|
+
.filter(([, value]) => !isNil(value))
|
|
18
|
+
.map(([key, value]) => `--${key}${value !== true ? `=${value}` : ""}`)
|
|
19
|
+
.join(" ");
|
|
@@ -44,6 +44,13 @@ const createAppConfig = (
|
|
|
44
44
|
);
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
+
const removeFalsy = <T>(record?: Record<string, false | T>) => {
|
|
48
|
+
if (!record) return undefined;
|
|
49
|
+
return Object.fromEntries(
|
|
50
|
+
Object.entries(record).filter(([, value]) => value !== false)
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
47
54
|
export const createKubeValues = (context: Context) => {
|
|
48
55
|
const deployConfig = context.componentConfig.deploy;
|
|
49
56
|
if (deployConfig === false) {
|
|
@@ -59,7 +66,7 @@ export const createKubeValues = (context: Context) => {
|
|
|
59
66
|
// we remove the application config because it can be just the value `false` which is a convenience feature, but not supported in the helm chart
|
|
60
67
|
// we only merge the rest of the values in
|
|
61
68
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
62
|
-
const { application, ...rest } = values ?? {};
|
|
69
|
+
const { application, jobs, cronjobs, ...rest } = values ?? {};
|
|
63
70
|
|
|
64
71
|
const env = createKubeEnv(context);
|
|
65
72
|
|
|
@@ -75,7 +82,12 @@ export const createKubeValues = (context: Context) => {
|
|
|
75
82
|
);
|
|
76
83
|
|
|
77
84
|
const kubeValues = processSecretsAsFiles(
|
|
78
|
-
mergeWithMergingArrays(defaultKubeValues,
|
|
85
|
+
mergeWithMergingArrays(defaultKubeValues, {
|
|
86
|
+
jobs: removeFalsy(jobs),
|
|
87
|
+
cronjobs: removeFalsy(cronjobs),
|
|
88
|
+
|
|
89
|
+
...rest,
|
|
90
|
+
})
|
|
79
91
|
);
|
|
80
92
|
|
|
81
93
|
return kubeValues;
|
|
@@ -40,6 +40,11 @@ export type Gcloudregion =
|
|
|
40
40
|
export type DeployConfigCloudRunCloudSql = {
|
|
41
41
|
type: "unmanaged";
|
|
42
42
|
instanceConnectionName: string;
|
|
43
|
+
/**
|
|
44
|
+
* the database username, defaults to "postgres"
|
|
45
|
+
*/
|
|
46
|
+
dbUser?: string;
|
|
47
|
+
|
|
43
48
|
/**
|
|
44
49
|
* the prefix of the database, the full db name is this plus the environment slug
|
|
45
50
|
*
|
|
@@ -112,6 +112,7 @@ export type DeployConfigMongodbBase = {
|
|
|
112
112
|
*/
|
|
113
113
|
size?: string;
|
|
114
114
|
};
|
|
115
|
+
resources?: KubernetesResourcesDef;
|
|
115
116
|
};
|
|
116
117
|
|
|
117
118
|
export type DeployConfigMongodbStandalone = {
|
|
@@ -159,29 +160,31 @@ export type DeployConfigKubernetesValues = AllowUnknownProps<{
|
|
|
159
160
|
*/
|
|
160
161
|
jobs?: Record<
|
|
161
162
|
string,
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
163
|
+
| false
|
|
164
|
+
| AllowUnknownProps<{
|
|
165
|
+
/**
|
|
166
|
+
* the command to execute
|
|
167
|
+
*/
|
|
168
|
+
command: string;
|
|
169
|
+
/**
|
|
170
|
+
* comma-separated list of helm hooks, see https://helm.sh/docs/topics/charts_hooks/
|
|
171
|
+
*
|
|
172
|
+
* defaults to post-install,post-upgrade
|
|
173
|
+
*/
|
|
174
|
+
hook?: string;
|
|
175
|
+
}>
|
|
174
176
|
>;
|
|
175
177
|
/**
|
|
176
178
|
* cronjobs that run periodically. These use the app image have all env vars available.
|
|
177
179
|
*/
|
|
178
180
|
cronjobs?: Record<
|
|
179
181
|
string,
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
182
|
+
| false
|
|
183
|
+
| AllowUnknownProps<{
|
|
184
|
+
schedule: string;
|
|
185
|
+
command: string;
|
|
186
|
+
concurrencyPolicy?: "Forbid" | "Allow" | "Replace";
|
|
187
|
+
}>
|
|
185
188
|
>;
|
|
186
189
|
/**
|
|
187
190
|
* configuration for the application ("Deployment" in kubernetes)
|
|
@@ -5,7 +5,7 @@ import { DEPLOY_TYPES } from "../deploy";
|
|
|
5
5
|
import type { PipelineJob, PipelineType } from "../types";
|
|
6
6
|
import type { Config, PipelineTrigger } from "../types/config";
|
|
7
7
|
import type { CommitInfo, Context } from "../types/context";
|
|
8
|
-
import type { CatladderJob } from "../types/jobs";
|
|
8
|
+
import type { CatladderJob, CatladderJobNeed } from "../types/jobs";
|
|
9
9
|
import { notNil } from "../utils";
|
|
10
10
|
import { getBaseCommitInfo } from "./commitInfo/getCommitInfo";
|
|
11
11
|
import { makeGitlabJob } from "./gitlab/makeGitlabJob";
|
|
@@ -78,25 +78,28 @@ const replaceReferences = (
|
|
|
78
78
|
const stage =
|
|
79
79
|
job.envMode === "stagePerEnv" ? `${job.stage} ${env}` : job.stage;
|
|
80
80
|
|
|
81
|
-
const
|
|
82
|
-
...(job.needs ?? []),
|
|
83
|
-
// pull in legacy needs from other component, which is now identical to needs
|
|
84
|
-
...(job.needsOtherComponent ?? []),
|
|
85
|
-
];
|
|
86
|
-
const needs: CatladderJob["needs"] = cleanedNeeds?.map((n) =>
|
|
81
|
+
const needsFromNeeds: CatladderJob["needs"] = job.needs?.map((n) =>
|
|
87
82
|
isObject(n)
|
|
88
83
|
? {
|
|
89
|
-
job: getFullReferencedJobName(
|
|
90
|
-
n.job,
|
|
91
|
-
n.componentName ?? componentName,
|
|
92
|
-
env,
|
|
93
|
-
allRawJobs
|
|
94
|
-
),
|
|
84
|
+
job: getFullReferencedJobName(n.job, componentName, env, allRawJobs),
|
|
95
85
|
artifacts: n.artifacts,
|
|
96
86
|
}
|
|
97
87
|
: getFullReferencedJobName(n, componentName, env, allRawJobs)
|
|
98
88
|
);
|
|
99
|
-
|
|
89
|
+
const needsFromOtherComponents: CatladderJob["needs"] =
|
|
90
|
+
job.needsOtherComponent?.map((other) => ({
|
|
91
|
+
artifacts: other.artifacts,
|
|
92
|
+
job: getFullReferencedJobName(
|
|
93
|
+
other.job,
|
|
94
|
+
other.componentName,
|
|
95
|
+
env,
|
|
96
|
+
allRawJobs
|
|
97
|
+
),
|
|
98
|
+
}));
|
|
99
|
+
const needs = [
|
|
100
|
+
...(needsFromNeeds ?? []),
|
|
101
|
+
...(needsFromOtherComponents ?? []),
|
|
102
|
+
];
|
|
100
103
|
return {
|
|
101
104
|
...job,
|
|
102
105
|
stage,
|
|
@@ -16,9 +16,7 @@ export const makeGitlabJob = ({
|
|
|
16
16
|
return {
|
|
17
17
|
...rest,
|
|
18
18
|
// sort in a predictable manner for snapshot tests
|
|
19
|
-
needs: needs
|
|
20
|
-
? [...needs].sort((a, b) => getJobName(a).localeCompare(getJobName(b)))
|
|
21
|
-
: undefined,
|
|
19
|
+
needs: needs?.sort((a, b) => getJobName(a).localeCompare(getJobName(b))),
|
|
22
20
|
retry: BASE_RETRY,
|
|
23
21
|
interruptible: true,
|
|
24
22
|
};
|
package/src/types/jobs.ts
CHANGED
|
@@ -18,9 +18,7 @@ export const BASE_STAGES = [
|
|
|
18
18
|
] as const;
|
|
19
19
|
export type BaseStage = typeof BASE_STAGES[number];
|
|
20
20
|
|
|
21
|
-
export type CatladderJobNeed =
|
|
22
|
-
| string
|
|
23
|
-
| { job: string; artifacts: boolean; componentName?: string };
|
|
21
|
+
export type CatladderJobNeed = string | { job: string; artifacts: boolean };
|
|
24
22
|
export type CatladderJob<S = BaseStage> = {
|
|
25
23
|
/**
|
|
26
24
|
* the name of the job (without any env or app prefix and suffix)
|
|
@@ -54,15 +52,9 @@ export type CatladderJob<S = BaseStage> = {
|
|
|
54
52
|
|
|
55
53
|
/**
|
|
56
54
|
* does this require another job (from the same component)?
|
|
57
|
-
*
|
|
58
|
-
* You can also require a job from another component if you set `componentName`
|
|
59
|
-
*
|
|
60
55
|
*/
|
|
61
56
|
needs?: Array<CatladderJobNeed>;
|
|
62
57
|
|
|
63
|
-
/**
|
|
64
|
-
* @deprecated set `componentName` to `needs` if you want to wait for a job from another component
|
|
65
|
-
*/
|
|
66
58
|
needsOtherComponent?: Array<{
|
|
67
59
|
componentName: string;
|
|
68
60
|
job: string;
|
|
@@ -101,4 +93,11 @@ export type CatladderJob<S = BaseStage> = {
|
|
|
101
93
|
environment?: GitlabEnvironment;
|
|
102
94
|
|
|
103
95
|
rules?: GitlabRule[];
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* How many instances of a job should be run in parallel.
|
|
99
|
+
* Useful for big test suites that can be split into multiple pipeline jobs.
|
|
100
|
+
* We use the same shape as GitLab itself.
|
|
101
|
+
*/
|
|
102
|
+
parallel?: number;
|
|
104
103
|
};
|