@catladder/pipeline 1.111.4 → 1.112.1
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/createAppBuildJob.d.ts +8 -0
- package/dist/build/base/{createBuildJob.js → createAppBuildJob.js} +3 -3
- package/dist/build/base/index.d.ts +8 -0
- package/dist/build/base/index.js +57 -0
- package/dist/build/custom/buildJob.js +19 -22
- package/dist/build/docker.d.ts +2 -4
- package/dist/build/docker.js +4 -39
- package/dist/build/node/buildJob.js +30 -32
- package/dist/build/node/meteor.js +19 -21
- package/dist/build/rails/build.js +12 -19
- package/dist/build/types.d.ts +4 -3
- package/dist/bundles/catladder-gitlab/index.js +1 -1
- package/dist/constants.js +1 -1
- package/dist/deploy/base/deploy.d.ts +3 -2
- package/dist/deploy/base/deploy.js +9 -4
- package/dist/deploy/base/index.d.ts +10 -3
- package/dist/deploy/base/index.js +37 -16
- package/dist/deploy/base/rollback.d.ts +3 -2
- package/dist/deploy/base/rollback.js +8 -6
- package/dist/deploy/base/stop.d.ts +3 -2
- package/dist/deploy/base/stop.js +8 -6
- package/dist/deploy/cloudRun/deployJob.js +28 -26
- package/dist/deploy/custom/deployJob.js +14 -11
- package/dist/deploy/dockerTag/deployJob.js +15 -5
- package/dist/deploy/kubernetes/deployJob.js +14 -26
- package/dist/deploy/kubernetes/mongodb.d.ts +1 -1
- package/dist/deploy/kubernetes/mongodb.js +8 -7
- package/dist/deploy/types/index.d.ts +1 -1
- package/dist/pipeline/gitlab/createGitlabJobs.d.ts +1 -0
- package/dist/pipeline/gitlab/createGitlabJobs.js +4 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/gitlab-ci-yml.d.ts +769 -0
- package/dist/types/gitlab-ci-yml.js +9 -0
- package/dist/types/gitlab-types.d.ts +12 -85
- package/dist/types/jobs.d.ts +3 -3
- package/examples/__snapshots__/kubernetes-application-customization.ts.snap +0 -36
- package/examples/__snapshots__/kubernetes-with-cloud-sql-legacy.ts.snap +0 -36
- package/examples/__snapshots__/kubernetes-with-cloud-sql.ts.snap +0 -36
- package/examples/__snapshots__/kubernetes-with-jobs.ts.snap +0 -72
- package/examples/__snapshots__/kubernetes-with-mongodb.ts.snap +0 -36
- package/examples/__snapshots__/meteor-kubernetes.ts.snap +0 -36
- package/examples/__snapshots__/rails-k8s-with-worker.ts.snap +0 -36
- package/package.json +4 -2
- package/scripts/generate-gitlab-ci-types.ts +51 -0
- package/src/build/base/{createBuildJob.ts → createAppBuildJob.ts} +3 -2
- package/src/build/base/index.ts +35 -0
- package/src/build/custom/buildJob.ts +32 -45
- package/src/build/docker.ts +14 -17
- package/src/build/node/buildJob.ts +50 -61
- package/src/build/node/meteor.ts +31 -36
- package/src/build/rails/build.ts +8 -10
- package/src/build/types.ts +4 -8
- package/src/deploy/base/deploy.ts +16 -2
- package/src/deploy/base/index.ts +22 -3
- package/src/deploy/base/rollback.ts +13 -2
- package/src/deploy/base/stop.ts +13 -4
- package/src/deploy/cloudRun/deployJob.ts +13 -15
- package/src/deploy/custom/deployJob.ts +17 -20
- package/src/deploy/dockerTag/deployJob.ts +6 -7
- package/src/deploy/kubernetes/deployJob.ts +17 -34
- package/src/deploy/kubernetes/mongodb.ts +3 -2
- package/src/pipeline/gitlab/createGitlabJobs.ts +3 -0
- package/src/types/gitlab-ci-yml.ts +892 -0
- package/src/types/gitlab-types.ts +49 -86
- package/src/types/jobs.ts +3 -4
- package/dist/build/base/createBuildJob.d.ts +0 -7
|
@@ -1,105 +1,68 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
accessibility?: string | string[];
|
|
8
|
-
coverage_report?: { coverage_format: string; path: string };
|
|
9
|
-
codequality?: string | string[];
|
|
10
|
-
cyclonedx?: string | string[];
|
|
11
|
-
dotenv?: string | string[];
|
|
12
|
-
junit?: string | string[];
|
|
13
|
-
sast?: string;
|
|
14
|
-
secret_detection?: string;
|
|
15
|
-
terraform?: string;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export type GitlabJobCache = {
|
|
19
|
-
key: GitlabJobCacheKey;
|
|
20
|
-
policy?: string;
|
|
21
|
-
paths: string[];
|
|
22
|
-
};
|
|
23
|
-
export type GitlabJobCacheKey =
|
|
24
|
-
| string
|
|
25
|
-
| {
|
|
26
|
-
files: string[];
|
|
27
|
-
prefix?: string;
|
|
28
|
-
};
|
|
29
|
-
export type GitlabRule = {
|
|
30
|
-
if?: string;
|
|
31
|
-
when?: "always" | "on_success" | "manual" | "never"; // todo
|
|
32
|
-
allow_failure?: boolean;
|
|
33
|
-
};
|
|
34
|
-
export type Retry = {
|
|
35
|
-
max: number;
|
|
36
|
-
when: string[];
|
|
37
|
-
};
|
|
1
|
+
import type {
|
|
2
|
+
Artifacts as GitlabCiArtifacts,
|
|
3
|
+
JobTemplate,
|
|
4
|
+
Cache,
|
|
5
|
+
Rules,
|
|
6
|
+
} from "./gitlab-ci-yml";
|
|
38
7
|
|
|
39
|
-
export
|
|
40
|
-
name: string;
|
|
41
|
-
command?: string[];
|
|
42
|
-
entrypoint?: string[];
|
|
43
|
-
alias?: string;
|
|
44
|
-
};
|
|
8
|
+
export { Retry, Image as GitlabJobImage } from "./gitlab-ci-yml";
|
|
45
9
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
10
|
+
// Reports won't show up on MRs until https://gitlab.com/groups/gitlab-org/-/epics/8205
|
|
11
|
+
export interface Artifacts extends Omit<GitlabCiArtifacts, "paths"> {
|
|
12
|
+
paths: string[];
|
|
13
|
+
}
|
|
14
|
+
export type GitlabJobCache = Cache;
|
|
15
|
+
export type GitlabRule = Exclude<Rules, null>[number];
|
|
16
|
+
export type GitlabEnvironment = Omit<
|
|
17
|
+
Exclude<JobTemplate["environment"], undefined | string>,
|
|
18
|
+
"deployment_tier"
|
|
19
|
+
>;
|
|
52
20
|
|
|
53
|
-
export
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
21
|
+
export interface GitlabJobDef
|
|
22
|
+
extends Pick<
|
|
23
|
+
JobTemplate,
|
|
24
|
+
| "after_script"
|
|
25
|
+
| "allow_failure"
|
|
26
|
+
| "artifacts"
|
|
27
|
+
| "before_script"
|
|
28
|
+
| "coverage"
|
|
29
|
+
| "dependencies"
|
|
30
|
+
| "environment"
|
|
31
|
+
| "except"
|
|
32
|
+
| "hooks"
|
|
33
|
+
| "image"
|
|
34
|
+
| "interruptible"
|
|
35
|
+
| "needs"
|
|
36
|
+
| "only"
|
|
37
|
+
| "parallel"
|
|
38
|
+
| "release"
|
|
39
|
+
| "resource_group"
|
|
40
|
+
| "retry"
|
|
41
|
+
| "rules"
|
|
42
|
+
| "script"
|
|
43
|
+
| "services"
|
|
44
|
+
| "stage"
|
|
45
|
+
| "tags"
|
|
46
|
+
| "trigger"
|
|
47
|
+
| "variables"
|
|
48
|
+
> {
|
|
49
|
+
stage: JobTemplate["stage"];
|
|
69
50
|
rules?: GitlabRule[];
|
|
70
51
|
cache?: GitlabJobCache | GitlabJobCache[];
|
|
71
52
|
artifacts?: Artifacts;
|
|
72
|
-
retry?: Retry;
|
|
73
|
-
services?: GitlabJobService[];
|
|
74
|
-
image?: GitlabJobImage;
|
|
75
|
-
variables?: GitlabVariables;
|
|
76
|
-
dependencies?: string[];
|
|
77
|
-
environment?: GitlabEnvironment;
|
|
78
|
-
allow_failure?: boolean;
|
|
79
|
-
parallel?: number;
|
|
80
53
|
tags?: string[];
|
|
81
|
-
|
|
82
|
-
strategy: "depend";
|
|
83
|
-
include: Array<{
|
|
84
|
-
artifact: string;
|
|
85
|
-
job: string;
|
|
86
|
-
}>;
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
export type GitlabVariables = Record<string, string | undefined>;
|
|
54
|
+
}
|
|
91
55
|
|
|
92
56
|
/**
|
|
93
57
|
* this is not precicily the type of a gitlab-pipeline
|
|
94
58
|
* the jobs nee to be merge into the object.
|
|
95
59
|
* Problem is, that this type cannot be represented properly with typescript, see https://github.com/microsoft/TypeScript/issues/17867
|
|
96
60
|
*/
|
|
97
|
-
export
|
|
61
|
+
export interface GitlabPipeline extends Pick<JobTemplate, "variables"> {
|
|
98
62
|
image: string;
|
|
99
|
-
variables: GitlabVariables;
|
|
100
63
|
workflow?: {
|
|
101
64
|
rules: GitlabRule[];
|
|
102
65
|
};
|
|
103
66
|
stages: string[];
|
|
104
67
|
jobs: Record<string, GitlabJobDef>;
|
|
105
|
-
}
|
|
68
|
+
}
|
package/src/types/jobs.ts
CHANGED
|
@@ -3,9 +3,8 @@ import type {
|
|
|
3
3
|
GitlabEnvironment,
|
|
4
4
|
GitlabJobCache,
|
|
5
5
|
GitlabRule,
|
|
6
|
-
GitlabVariables,
|
|
7
|
-
GitlabJobService,
|
|
8
6
|
GitlabJobImage,
|
|
7
|
+
GitlabJobDef,
|
|
9
8
|
} from "./gitlab-types";
|
|
10
9
|
|
|
11
10
|
export const BASE_STAGES = [
|
|
@@ -82,7 +81,7 @@ export type CatladderJob<S = BaseStage> = {
|
|
|
82
81
|
/**
|
|
83
82
|
* additional services, mainly used for docker
|
|
84
83
|
*/
|
|
85
|
-
services?:
|
|
84
|
+
services?: GitlabJobDef["services"];
|
|
86
85
|
|
|
87
86
|
/**
|
|
88
87
|
* image to use
|
|
@@ -92,7 +91,7 @@ export type CatladderJob<S = BaseStage> = {
|
|
|
92
91
|
/**
|
|
93
92
|
* variables to pass
|
|
94
93
|
*/
|
|
95
|
-
variables:
|
|
94
|
+
variables: GitlabJobDef["variables"];
|
|
96
95
|
|
|
97
96
|
/**
|
|
98
97
|
* whether failures are allowed
|