@catladder/pipeline 1.144.1 → 1.145.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/bash/BashExpression.d.ts +40 -0
- package/dist/bash/BashExpression.js +124 -0
- package/dist/bash/bashExpressionPerPipelineType.d.ts +6 -0
- package/dist/bash/bashExpressionPerPipelineType.js +11 -0
- package/dist/bash/bashYaml.d.ts +10 -0
- package/dist/bash/bashYaml.js +46 -0
- package/dist/bash/getInjectVarsScript.d.ts +2 -0
- package/dist/bash/getInjectVarsScript.js +45 -0
- package/dist/bash/replaceAsync.d.ts +2 -0
- package/dist/{pipeline/commitInfo/getCommitInfo.js → bash/replaceAsync.js} +49 -21
- package/dist/build/base/__tests__/createArtifactsConfig.test.js +3 -1
- package/dist/build/base/constants.js +3 -1
- package/dist/build/base/createAppBuildJob.d.ts +2 -1
- package/dist/build/base/createAppBuildJob.js +10 -6
- package/dist/build/base/createArtifactsConfig.d.ts +1 -1
- package/dist/build/base/createArtifactsConfig.js +3 -1
- package/dist/build/base/index.js +3 -1
- package/dist/build/base/writeBuildInfo.js +4 -3
- package/dist/build/base/writeDotEnv.js +12 -3
- package/dist/build/custom/__tests__/testJob.test.js +3 -1
- package/dist/build/custom/buildJob.js +4 -12
- package/dist/build/custom/index.js +3 -1
- package/dist/build/custom/testJob.d.ts +1 -1
- package/dist/build/custom/testJob.js +18 -14
- package/dist/build/docker.d.ts +5 -31
- package/dist/build/docker.js +16 -9
- package/dist/build/index.d.ts +1 -1
- package/dist/build/index.js +13 -7
- package/dist/build/node/buildJob.js +4 -12
- package/dist/build/node/cache.js +6 -3
- package/dist/build/node/constants.js +3 -1
- package/dist/build/node/index.js +3 -1
- package/dist/build/node/meteor.js +5 -2
- package/dist/build/node/testJob.js +18 -14
- package/dist/build/node/yarn.d.ts +3 -2
- package/dist/build/node/yarn.js +6 -3
- package/dist/build/rails/build.js +3 -1
- package/dist/build/rails/index.js +3 -1
- package/dist/build/rails/test.js +15 -11
- package/dist/build/sbom.js +3 -1
- package/dist/build/types.d.ts +24 -18
- package/dist/build/types.js +3 -1
- package/dist/bundles/catladder-gitlab/index.js +3 -3
- package/dist/catladder-gitlab.js +10 -54
- package/dist/config/__tests__/configruedEnvs.test.js +3 -1
- package/dist/config/configruedEnvs.js +3 -1
- package/dist/config/index.js +13 -7
- package/dist/config/readConfig.js +6 -5
- package/dist/constants.js +5 -3
- package/dist/context/__tests__/resolveReferences.test.js +40 -8
- package/dist/context/getBuildInfoVariables.d.ts +7 -0
- package/dist/context/getBuildInfoVariables.js +29 -0
- package/dist/context/getEnvConfig.js +3 -1
- package/dist/context/getEnvType.js +3 -1
- package/dist/context/getEnvironment.d.ts +3 -3
- package/dist/context/getEnvironment.js +10 -14
- package/dist/context/getEnvironmentContext.d.ts +7 -3
- package/dist/context/getEnvironmentContext.js +21 -11
- package/dist/context/getEnvironmentVariables.d.ts +26 -5
- package/dist/context/getEnvironmentVariables.js +41 -25
- package/dist/context/getLabels.js +4 -2
- package/dist/context/getReviewSlug.d.ts +4 -0
- package/dist/context/getReviewSlug.js +22 -0
- package/dist/context/index.d.ts +12 -3
- package/dist/context/index.js +21 -15
- package/dist/context/resolveReferences.d.ts +3 -1
- package/dist/context/resolveReferences.js +53 -21
- package/dist/context/transformJobOnlyVars.d.ts +5 -2
- package/dist/context/transformJobOnlyVars.js +4 -2
- package/dist/context/utils/envVars.d.ts +1 -1
- package/dist/context/utils/envVars.js +5 -2
- package/dist/defaults/index.js +3 -1
- package/dist/deploy/base/deploy.d.ts +1 -1
- package/dist/deploy/base/deploy.js +12 -11
- package/dist/deploy/base/index.js +3 -1
- package/dist/deploy/base/rollback.d.ts +1 -1
- package/dist/deploy/base/rollback.js +13 -9
- package/dist/deploy/base/stop.d.ts +1 -1
- package/dist/deploy/base/stop.js +16 -11
- package/dist/deploy/base/types.d.ts +1 -1
- package/dist/deploy/base/types.js +3 -1
- package/dist/deploy/base/variables.js +3 -1
- package/dist/deploy/cloudRun/artifactsRegistry.d.ts +2 -1
- package/dist/deploy/cloudRun/artifactsRegistry.js +6 -4
- package/dist/deploy/cloudRun/cleanup.js +3 -1
- package/dist/deploy/cloudRun/cloudRunRevisions.js +3 -1
- package/dist/deploy/cloudRun/createJobs/cloudRunJobs.js +8 -5
- package/dist/deploy/cloudRun/createJobs/cloudRunServices.d.ts +2 -2
- package/dist/deploy/cloudRun/createJobs/cloudRunServices.js +6 -3
- package/dist/deploy/cloudRun/createJobs/common.d.ts +3 -3
- package/dist/deploy/cloudRun/createJobs/common.js +3 -1
- package/dist/deploy/cloudRun/createJobs/constants.d.ts +1 -0
- package/dist/deploy/cloudRun/createJobs/constants.js +7 -0
- package/dist/deploy/cloudRun/createJobs/getCloudRunDeployScripts.js +9 -2
- package/dist/deploy/cloudRun/createJobs/getCloudRunStopScripts.js +3 -1
- package/dist/deploy/cloudRun/createJobs/index.js +25 -8
- package/dist/deploy/cloudRun/createJobs/volumes.js +3 -1
- package/dist/deploy/cloudRun/index.js +5 -3
- package/dist/deploy/cloudRun/utils/createArgsString.d.ts +2 -1
- package/dist/deploy/cloudRun/utils/createArgsString.js +3 -1
- package/dist/deploy/cloudRun/utils/database.js +13 -13
- package/dist/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.js +3 -1
- package/dist/deploy/cloudRun/utils/getServiceName.d.ts +1 -1
- package/dist/deploy/cloudRun/utils/getServiceName.js +3 -1
- package/dist/deploy/cloudRun/utils/jobName.d.ts +2 -1
- package/dist/deploy/cloudRun/utils/jobName.js +4 -2
- package/dist/deploy/cloudRun/utils/removeFirstLinesFromCommandOutput.js +3 -1
- package/dist/deploy/cloudSql/utils.d.ts +2 -1
- package/dist/deploy/cloudSql/utils.js +7 -2
- package/dist/deploy/custom/deployJob.js +3 -1
- package/dist/deploy/custom/index.js +3 -1
- package/dist/deploy/dockerTag/deployJob.js +3 -1
- package/dist/deploy/dockerTag/index.js +3 -1
- package/dist/deploy/index.d.ts +4 -3
- package/dist/deploy/index.js +13 -7
- package/dist/deploy/kubernetes/additionalSecretKeys.js +3 -1
- package/dist/deploy/kubernetes/cloudSql/index.d.ts +3 -2
- package/dist/deploy/kubernetes/cloudSql/index.js +6 -4
- package/dist/deploy/kubernetes/deployJob.js +22 -15
- package/dist/deploy/kubernetes/index.js +51 -14
- package/dist/deploy/kubernetes/kubeEnv.d.ts +3 -2
- package/dist/deploy/kubernetes/kubeEnv.js +7 -4
- package/dist/deploy/kubernetes/kubeValues.d.ts +2 -2
- package/dist/deploy/kubernetes/kubeValues.js +3 -2
- package/dist/deploy/kubernetes/mongodb.js +3 -1
- package/dist/deploy/kubernetes/processSecretsAsFiles.d.ts +2 -1
- package/dist/deploy/kubernetes/processSecretsAsFiles.js +3 -1
- package/dist/deploy/sbom.js +3 -1
- package/dist/deploy/types/base.d.ts +8 -2
- package/dist/deploy/types/base.js +3 -1
- package/dist/deploy/types/custom.d.ts +1 -1
- package/dist/deploy/types/custom.js +3 -1
- package/dist/deploy/types/dockerTag.d.ts +1 -1
- package/dist/deploy/types/dockerTag.js +3 -1
- package/dist/deploy/types/googleCloudRun.d.ts +19 -18
- package/dist/deploy/types/googleCloudRun.js +3 -1
- package/dist/deploy/types/index.d.ts +6 -6
- package/dist/deploy/types/index.js +13 -7
- package/dist/deploy/types/kubernetes.d.ts +22 -22
- package/dist/deploy/types/kubernetes.js +3 -1
- package/dist/deploy/utils.js +3 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +16 -9
- package/dist/packageInfos.d.ts +2 -0
- package/dist/packageInfos.js +14 -0
- package/dist/pipeline/createAllJobs.d.ts +13 -5
- package/dist/pipeline/createAllJobs.js +21 -10
- package/dist/pipeline/createChildPipeline.d.ts +1 -1
- package/dist/pipeline/createChildPipeline.js +24 -7
- package/dist/pipeline/createJobsForComponent.d.ts +3 -3
- package/dist/pipeline/createJobsForComponent.js +19 -18
- package/dist/pipeline/createMainPipeline.d.ts +3 -0
- package/dist/pipeline/createMainPipeline.js +248 -0
- package/dist/pipeline/generatePipelineFiles.d.ts +2 -0
- package/dist/pipeline/generatePipelineFiles.js +178 -0
- package/dist/pipeline/getPipelineStages.js +3 -1
- package/dist/pipeline/gitlab/createGitlabJobs.d.ts +15 -5
- package/dist/pipeline/gitlab/createGitlabJobs.js +98 -25
- package/dist/pipeline/gitlab/createGitlabPipeline.d.ts +7 -2
- package/dist/pipeline/gitlab/createGitlabPipeline.js +34 -17
- package/dist/pipeline/gitlab/getPipelineTriggerForGitlabChildPipeline.d.ts +1 -0
- package/dist/pipeline/gitlab/getPipelineTriggerForGitlabChildPipeline.js +29 -0
- package/dist/pipeline/gitlab/gitlabReleaseJobs.d.ts +33 -0
- package/dist/pipeline/gitlab/gitlabReleaseJobs.js +24 -0
- package/dist/pipeline/index.d.ts +3 -1
- package/dist/pipeline/index.js +16 -8
- package/dist/pipeline/packageManager.js +4 -2
- package/dist/pipeline/yarn/yarnUtils.js +6 -4
- package/dist/rules/index.d.ts +4 -1
- package/dist/rules/index.js +25 -18
- package/dist/runner/index.d.ts +1 -1
- package/dist/runner/index.js +3 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/config.d.ts +18 -15
- package/dist/types/config.js +5 -2
- package/dist/types/context.d.ts +37 -32
- package/dist/types/context.js +3 -1
- package/dist/types/environmentContext.d.ts +11 -7
- package/dist/types/environmentContext.js +3 -1
- package/dist/types/gitlab-ci-yml.d.ts +30 -30
- package/dist/types/gitlab-ci-yml.js +3 -2
- package/dist/types/gitlab-types.d.ts +4 -6
- package/dist/types/gitlab-types.js +3 -1
- package/dist/types/index.js +13 -7
- package/dist/types/jobs.d.ts +23 -6
- package/dist/types/jobs.js +3 -1
- package/dist/types/pipeline.d.ts +4 -3
- package/dist/types/pipeline.js +3 -1
- package/dist/types/utils.d.ts +1 -1
- package/dist/types/utils.js +3 -1
- package/dist/utils/gitlab.js +3 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +3 -1
- package/dist/utils/writeFiles.d.ts +7 -0
- package/dist/{pipeline/commitInfo/getBuildId.js → utils/writeFiles.js} +39 -22
- package/examples/__snapshots__/cloud-run-memory-limit.ts.snap +480 -384
- package/examples/__snapshots__/cloud-run-meteor-with-worker.ts.snap +462 -366
- package/examples/__snapshots__/cloud-run-no-cpu-throttling.ts.snap +480 -384
- package/examples/__snapshots__/cloud-run-no-service.ts.snap +501 -393
- package/examples/__snapshots__/cloud-run-non-public.ts.snap +480 -384
- package/examples/__snapshots__/cloud-run-post-stop-job.ts.snap +489 -392
- package/examples/__snapshots__/cloud-run-service-gen2.ts.snap +480 -384
- package/examples/__snapshots__/cloud-run-service-with-volumes.ts.snap +501 -401
- package/examples/__snapshots__/cloud-run-with-sql-reuse-db.ts.snap +1155 -915
- package/examples/__snapshots__/cloud-run-with-sql.ts.snap +1116 -888
- package/examples/__snapshots__/cloud-run-with-worker.ts.snap +482 -386
- package/examples/__snapshots__/custom-build-job-with-tests.ts.snap +452 -356
- package/examples/__snapshots__/custom-build-job.ts.snap +434 -350
- package/examples/__snapshots__/custom-deploy.ts.snap +319 -223
- package/examples/__snapshots__/custom-envs.ts.snap +123 -81
- package/examples/__snapshots__/custom-sbom-java.ts.snap +434 -350
- package/examples/__snapshots__/kubernetes-application-customization.ts.snap +846 -969
- package/examples/__snapshots__/kubernetes-with-cloud-sql-legacy.ts.snap +886 -957
- package/examples/__snapshots__/kubernetes-with-cloud-sql.ts.snap +894 -969
- package/examples/__snapshots__/kubernetes-with-jobs.ts.snap +1626 -1728
- package/examples/__snapshots__/kubernetes-with-mongodb.ts.snap +974 -1137
- package/examples/__snapshots__/local-dot-env.ts.snap +480 -384
- package/examples/__snapshots__/meteor-kubernetes.ts.snap +906 -1069
- package/examples/__snapshots__/multiline-var.ts.snap +4500 -0
- package/examples/__snapshots__/native-app.ts.snap +706 -578
- package/examples/__snapshots__/node-build-with-custom-image.ts.snap +480 -384
- package/examples/__snapshots__/node-build-with-docker-additions.ts.snap +488 -384
- package/examples/__snapshots__/rails-k8s-with-worker.ts.snap +1656 -1942
- package/examples/__snapshots__/wait-for-other-deploy.ts.snap +287 -231
- package/examples/custom-deploy.ts +7 -7
- package/examples/multiline-var.ts +64 -0
- package/package.json +5 -8
- package/src/bash/BashExpression.ts +81 -0
- package/src/bash/bashExpressionPerPipelineType.ts +16 -0
- package/src/bash/bashYaml.ts +46 -0
- package/src/bash/getInjectVarsScript.ts +12 -0
- package/src/bash/replaceAsync.ts +50 -0
- package/src/build/base/createAppBuildJob.ts +6 -2
- package/src/build/base/writeBuildInfo.ts +1 -1
- package/src/build/base/writeDotEnv.ts +6 -1
- package/src/build/custom/buildJob.ts +2 -4
- package/src/build/custom/testJob.ts +3 -2
- package/src/build/docker.ts +15 -7
- package/src/build/node/buildJob.ts +1 -3
- package/src/build/node/testJob.ts +3 -2
- package/src/build/node/yarn.ts +9 -4
- package/src/build/rails/test.ts +2 -1
- package/src/build/types.ts +8 -1
- package/src/catladder-gitlab.ts +8 -55
- package/src/config/readConfig.ts +2 -3
- package/src/constants.ts +5 -2
- package/src/context/__tests__/resolveReferences.test.ts +11 -6
- package/src/context/getBuildInfoVariables.ts +40 -0
- package/src/context/getEnvironment.ts +7 -30
- package/src/context/getEnvironmentContext.ts +25 -29
- package/src/context/getEnvironmentVariables.ts +61 -36
- package/src/context/getReviewSlug.ts +27 -0
- package/src/context/index.ts +24 -23
- package/src/context/resolveReferences.ts +28 -8
- package/src/context/transformJobOnlyVars.ts +5 -2
- package/src/context/utils/envVars.ts +2 -1
- package/src/deploy/base/deploy.ts +20 -18
- package/src/deploy/base/rollback.ts +8 -10
- package/src/deploy/base/stop.ts +8 -9
- package/src/deploy/cloudRun/artifactsRegistry.ts +9 -4
- package/src/deploy/cloudRun/createJobs/cloudRunJobs.ts +12 -7
- package/src/deploy/cloudRun/createJobs/cloudRunServices.ts +3 -2
- package/src/deploy/cloudRun/createJobs/constants.ts +1 -0
- package/src/deploy/cloudRun/createJobs/getCloudRunDeployScripts.ts +20 -2
- package/src/deploy/cloudRun/createJobs/index.ts +17 -8
- package/src/deploy/cloudRun/index.ts +14 -6
- package/src/deploy/cloudRun/utils/createArgsString.ts +2 -1
- package/src/deploy/cloudRun/utils/database.ts +2 -2
- package/src/deploy/cloudRun/utils/jobName.ts +7 -2
- package/src/deploy/cloudSql/utils.ts +12 -9
- package/src/deploy/index.ts +2 -1
- package/src/deploy/kubernetes/cloudSql/index.ts +3 -2
- package/src/deploy/kubernetes/deployJob.ts +24 -10
- package/src/deploy/kubernetes/index.ts +15 -8
- package/src/deploy/kubernetes/kubeEnv.ts +8 -6
- package/src/deploy/kubernetes/kubeValues.ts +0 -1
- package/src/deploy/kubernetes/processSecretsAsFiles.ts +2 -1
- package/src/deploy/types/base.ts +6 -0
- package/src/deploy/types/googleCloudRun.ts +2 -0
- package/src/index.ts +2 -1
- package/src/packageInfos.ts +10 -0
- package/src/pipeline/createAllJobs.ts +24 -10
- package/src/pipeline/createChildPipeline.ts +19 -8
- package/src/pipeline/createJobsForComponent.ts +14 -22
- package/src/pipeline/createMainPipeline.ts +88 -0
- package/src/pipeline/generatePipelineFiles.ts +29 -0
- package/src/pipeline/gitlab/createGitlabJobs.ts +174 -51
- package/src/pipeline/gitlab/createGitlabPipeline.ts +16 -14
- package/src/pipeline/gitlab/getPipelineTriggerForGitlabChildPipeline.ts +46 -0
- package/src/pipeline/gitlab/gitlabReleaseJobs.ts +20 -0
- package/src/pipeline/index.ts +2 -0
- package/src/rules/index.ts +15 -9
- package/src/types/config.ts +11 -2
- package/src/types/context.ts +39 -26
- package/src/types/environmentContext.ts +12 -6
- package/src/types/gitlab-ci-yml.ts +0 -1
- package/src/types/gitlab-types.ts +5 -4
- package/src/types/jobs.ts +28 -3
- package/src/types/pipeline.ts +4 -0
- package/src/utils/writeFiles.ts +40 -0
- package/dist/deploy/cloudRun/createJobs/variables.d.ts +0 -5
- package/dist/deploy/cloudRun/createJobs/variables.js +0 -19
- package/dist/pipeline/commitInfo/getBuildId.d.ts +0 -6
- package/dist/pipeline/commitInfo/getCommitInfo.d.ts +0 -2
- package/src/deploy/cloudRun/createJobs/variables.ts +0 -21
- package/src/pipeline/commitInfo/getBuildId.ts +0 -17
- package/src/pipeline/commitInfo/getCommitInfo.ts +0 -15
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
|
|
8
8
|
* via the `definition` "image".
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export type Image = string | {
|
|
11
11
|
/**
|
|
12
12
|
* Full name of the image that should be used. It should contain the Registry part if needed.
|
|
13
13
|
*/
|
|
@@ -24,7 +24,7 @@ export declare type Image = string | {
|
|
|
24
24
|
* This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
|
|
25
25
|
* via the `definition` "services".
|
|
26
26
|
*/
|
|
27
|
-
export
|
|
27
|
+
export type Services = (string | {
|
|
28
28
|
/**
|
|
29
29
|
* Full name of the image that should be used. It should contain the Registry part if needed.
|
|
30
30
|
*/
|
|
@@ -45,27 +45,27 @@ export declare type Services = (string | {
|
|
|
45
45
|
* This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
|
|
46
46
|
* via the `definition` "before_script".
|
|
47
47
|
*/
|
|
48
|
-
export
|
|
48
|
+
export type BeforeScript = (string | string[])[];
|
|
49
49
|
/**
|
|
50
50
|
* This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
|
|
51
51
|
* via the `definition` "after_script".
|
|
52
52
|
*/
|
|
53
|
-
export
|
|
53
|
+
export type AfterScript = (string | string[])[];
|
|
54
54
|
/**
|
|
55
55
|
* This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
|
|
56
56
|
* via the `definition` "!reference".
|
|
57
57
|
*/
|
|
58
|
-
export
|
|
58
|
+
export type Reference = string[];
|
|
59
59
|
/**
|
|
60
60
|
* This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
|
|
61
61
|
* via the `definition` "interruptible".
|
|
62
62
|
*/
|
|
63
|
-
export
|
|
63
|
+
export type Interruptible = boolean;
|
|
64
64
|
/**
|
|
65
65
|
* This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
|
|
66
66
|
* via the `definition` "retry".
|
|
67
67
|
*/
|
|
68
|
-
export
|
|
68
|
+
export type Retry = RetryMax | {
|
|
69
69
|
max?: RetryMax;
|
|
70
70
|
when?: RetryErrors | RetryErrors[];
|
|
71
71
|
};
|
|
@@ -75,27 +75,27 @@ export declare type Retry = RetryMax | {
|
|
|
75
75
|
* This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
|
|
76
76
|
* via the `definition` "retry_max".
|
|
77
77
|
*/
|
|
78
|
-
export
|
|
78
|
+
export type RetryMax = number;
|
|
79
79
|
/**
|
|
80
80
|
* This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
|
|
81
81
|
* via the `definition` "retry_errors".
|
|
82
82
|
*/
|
|
83
|
-
export
|
|
83
|
+
export type RetryErrors = "always" | "unknown_failure" | "script_failure" | "api_failure" | "stuck_or_timeout_failure" | "runner_system_failure" | "runner_unsupported" | "stale_schedule" | "job_execution_timeout" | "archived_failure" | "unmet_prerequisites" | "scheduler_failure" | "data_integrity_failure";
|
|
84
84
|
/**
|
|
85
85
|
* This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
|
|
86
86
|
* via the `definition` "tags".
|
|
87
87
|
*/
|
|
88
|
-
export
|
|
88
|
+
export type Tags = (string | string[])[];
|
|
89
89
|
/**
|
|
90
90
|
* This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
|
|
91
91
|
* via the `definition` "timeout".
|
|
92
92
|
*/
|
|
93
|
-
export
|
|
93
|
+
export type Timeout = string;
|
|
94
94
|
/**
|
|
95
95
|
* This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
|
|
96
96
|
* via the `definition` "include_item".
|
|
97
97
|
*/
|
|
98
|
-
export
|
|
98
|
+
export type IncludeItem = string | {
|
|
99
99
|
/**
|
|
100
100
|
* Relative path from local repository root (`/`) to the `yaml`/`yml` file template. The file must be on the same branch, and does not work across git submodules.
|
|
101
101
|
*/
|
|
@@ -140,7 +140,7 @@ export declare type IncludeItem = string | {
|
|
|
140
140
|
* This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
|
|
141
141
|
* via the `definition` "includeRules".
|
|
142
142
|
*/
|
|
143
|
-
export
|
|
143
|
+
export type IncludeRules = ({
|
|
144
144
|
if?: If;
|
|
145
145
|
exists?: Exists;
|
|
146
146
|
when?: ("never" | "always") | null;
|
|
@@ -149,13 +149,13 @@ export declare type IncludeRules = ({
|
|
|
149
149
|
* This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
|
|
150
150
|
* via the `definition` "if".
|
|
151
151
|
*/
|
|
152
|
-
export
|
|
152
|
+
export type If = string;
|
|
153
153
|
/**
|
|
154
154
|
* This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
|
|
155
155
|
* via the `definition` "exists".
|
|
156
156
|
*/
|
|
157
|
-
export
|
|
158
|
-
export
|
|
157
|
+
export type Exists = string[];
|
|
158
|
+
export type JobTemplate = {
|
|
159
159
|
image?: Image;
|
|
160
160
|
services?: Services;
|
|
161
161
|
before_script?: BeforeScript;
|
|
@@ -434,7 +434,7 @@ export declare type JobTemplate = {
|
|
|
434
434
|
* This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
|
|
435
435
|
* via the `definition` "rules".
|
|
436
436
|
*/
|
|
437
|
-
export
|
|
437
|
+
export type Rules = ({
|
|
438
438
|
if?: If;
|
|
439
439
|
changes?: Changes;
|
|
440
440
|
exists?: Exists;
|
|
@@ -448,7 +448,7 @@ export declare type Rules = ({
|
|
|
448
448
|
* This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
|
|
449
449
|
* via the `definition` "changes".
|
|
450
450
|
*/
|
|
451
|
-
export
|
|
451
|
+
export type Changes = {
|
|
452
452
|
/**
|
|
453
453
|
* List of file paths.
|
|
454
454
|
*/
|
|
@@ -462,17 +462,17 @@ export declare type Changes = {
|
|
|
462
462
|
* This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
|
|
463
463
|
* via the `definition` "when".
|
|
464
464
|
*/
|
|
465
|
-
export
|
|
465
|
+
export type When = "on_success" | "on_failure" | "always" | "never" | "manual" | "delayed";
|
|
466
466
|
/**
|
|
467
467
|
* This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
|
|
468
468
|
* via the `definition` "start_in".
|
|
469
469
|
*/
|
|
470
|
-
export
|
|
470
|
+
export type StartIn = string;
|
|
471
471
|
/**
|
|
472
472
|
* This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
|
|
473
473
|
* via the `definition` "allow_failure".
|
|
474
474
|
*/
|
|
475
|
-
export
|
|
475
|
+
export type AllowFailure = boolean | {
|
|
476
476
|
exit_codes: number;
|
|
477
477
|
} | {
|
|
478
478
|
/**
|
|
@@ -484,7 +484,7 @@ export declare type AllowFailure = boolean | {
|
|
|
484
484
|
* This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
|
|
485
485
|
* via the `definition` "rulesNeeds".
|
|
486
486
|
*/
|
|
487
|
-
export
|
|
487
|
+
export type RulesNeeds = (string | {
|
|
488
488
|
/**
|
|
489
489
|
* Name of a job that is defined in the pipeline.
|
|
490
490
|
*/
|
|
@@ -504,14 +504,14 @@ export declare type RulesNeeds = (string | {
|
|
|
504
504
|
* This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
|
|
505
505
|
* via the `definition` "filter_refs".
|
|
506
506
|
*/
|
|
507
|
-
export
|
|
507
|
+
export type FilterRefs = (("branches" | "tags" | "api" | "external" | "pipelines" | "pushes" | "schedules" | "triggers" | "web") | string)[];
|
|
508
508
|
/**
|
|
509
509
|
* Use the `needs:parallel:matrix` keyword to specify parallelized jobs needed to be completed for the job to run. [Learn More](https://docs.gitlab.com/ee/ci/yaml/#needsparallelmatrix)
|
|
510
510
|
*
|
|
511
511
|
* This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
|
|
512
512
|
* via the `definition` "parallel_matrix".
|
|
513
513
|
*/
|
|
514
|
-
export
|
|
514
|
+
export type ParallelMatrix = {
|
|
515
515
|
/**
|
|
516
516
|
* Defines different variables for jobs that are running in parallel.
|
|
517
517
|
*
|
|
@@ -527,7 +527,7 @@ export declare type ParallelMatrix = {
|
|
|
527
527
|
* This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
|
|
528
528
|
* via the `definition` "parallel".
|
|
529
529
|
*/
|
|
530
|
-
export
|
|
530
|
+
export type Parallel = number | {
|
|
531
531
|
/**
|
|
532
532
|
* Defines different variables for jobs that are running in parallel.
|
|
533
533
|
*
|
|
@@ -541,7 +541,7 @@ export declare type Parallel = number | {
|
|
|
541
541
|
* This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
|
|
542
542
|
* via the `definition` "job_template".
|
|
543
543
|
*/
|
|
544
|
-
export
|
|
544
|
+
export type JobTemplate1 = {
|
|
545
545
|
when: "delayed";
|
|
546
546
|
[k: string]: any | undefined;
|
|
547
547
|
} | {
|
|
@@ -554,17 +554,17 @@ export declare type JobTemplate1 = {
|
|
|
554
554
|
* This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
|
|
555
555
|
* via the `definition` "workflowName".
|
|
556
556
|
*/
|
|
557
|
-
export
|
|
557
|
+
export type WorkflowName = string;
|
|
558
558
|
/**
|
|
559
559
|
* This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
|
|
560
560
|
* via the `definition` "string_file_list".
|
|
561
561
|
*/
|
|
562
|
-
export
|
|
562
|
+
export type StringFileList = string | string[];
|
|
563
563
|
/**
|
|
564
564
|
* This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
|
|
565
565
|
* via the `definition` "filter".
|
|
566
566
|
*/
|
|
567
|
-
export
|
|
567
|
+
export type Filter = null | FilterRefs | {
|
|
568
568
|
refs?: FilterRefs;
|
|
569
569
|
/**
|
|
570
570
|
* Filter job based on if Kubernetes integration is active.
|
|
@@ -580,7 +580,7 @@ export declare type Filter = null | FilterRefs | {
|
|
|
580
580
|
* This interface was referenced by `HttpsGitlabComGitlabCiYml`'s JSON-Schema
|
|
581
581
|
* via the `definition` "job".
|
|
582
582
|
*/
|
|
583
|
-
export
|
|
583
|
+
export type Job = JobTemplate1;
|
|
584
584
|
export interface JobVariables {
|
|
585
585
|
[k: string]: any | undefined;
|
|
586
586
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
/* eslint-disable */
|
|
4
3
|
/**
|
|
5
4
|
* This file was automatically generated by json-schema-to-typescript.
|
|
6
5
|
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
7
6
|
* and run json-schema-to-typescript to regenerate this file.
|
|
8
7
|
*/
|
|
9
|
-
exports
|
|
8
|
+
Object.defineProperty(exports, "__esModule", {
|
|
9
|
+
value: true
|
|
10
|
+
});
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import type { Artifacts as GitlabCiArtifacts, JobTemplate, Cache, Rules } from "./gitlab-ci-yml";
|
|
2
2
|
export { Retry, Image as GitlabJobImage } from "./gitlab-ci-yml";
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
export declare type GitlabRule = Exclude<Rules, null>[number];
|
|
8
|
-
export declare type GitlabEnvironment = Omit<Exclude<JobTemplate["environment"], undefined | string>, "deployment_tier">;
|
|
3
|
+
export type Artifacts = GitlabCiArtifacts;
|
|
4
|
+
export type GitlabJobCache = Cache;
|
|
5
|
+
export type GitlabRule = Exclude<Exclude<Rules, null>[number], string | string[]>;
|
|
6
|
+
export type GitlabEnvironment = Omit<Exclude<JobTemplate["environment"], undefined | string>, "deployment_tier">;
|
|
9
7
|
export interface GitlabJobDef extends Pick<JobTemplate, "after_script" | "allow_failure" | "artifacts" | "before_script" | "coverage" | "dependencies" | "environment" | "except" | "hooks" | "image" | "interruptible" | "needs" | "only" | "parallel" | "release" | "resource_group" | "retry" | "rules" | "script" | "services" | "stage" | "tags" | "trigger" | "variables"> {
|
|
10
8
|
stage: JobTemplate["stage"];
|
|
11
9
|
rules?: GitlabRule[];
|
package/dist/types/index.js
CHANGED
|
@@ -2,12 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
4
4
|
if (k2 === undefined) k2 = k;
|
|
5
|
-
Object.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return m[k];
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
11
15
|
} : function (o, m, k, k2) {
|
|
12
16
|
if (k2 === undefined) k2 = k;
|
|
13
17
|
o[k2] = m[k];
|
|
@@ -15,7 +19,9 @@ var __createBinding = this && this.__createBinding || (Object.create ? function
|
|
|
15
19
|
var __exportStar = this && this.__exportStar || function (m, exports) {
|
|
16
20
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
17
21
|
};
|
|
18
|
-
exports
|
|
22
|
+
Object.defineProperty(exports, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
});
|
|
19
25
|
__exportStar(require("./config"), exports);
|
|
20
26
|
__exportStar(require("./gitlab-types"), exports);
|
|
21
27
|
__exportStar(require("./context"), exports);
|
package/dist/types/jobs.d.ts
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { UnspecifiedEnvVars } from "..";
|
|
2
|
+
import type { Artifacts, GitlabJobCache, GitlabRule, GitlabJobImage, GitlabJobDef, GitlabEnvironment } from "./gitlab-types";
|
|
2
3
|
export declare const BASE_STAGES: readonly ["setup", "test", "build", "deploy", "verify", "rollback", "stop"];
|
|
3
|
-
export
|
|
4
|
-
export
|
|
4
|
+
export type BaseStage = typeof BASE_STAGES[number];
|
|
5
|
+
export type CatladderJobNeed = string | {
|
|
5
6
|
job: string;
|
|
6
7
|
artifacts: boolean;
|
|
7
8
|
componentName?: string;
|
|
8
9
|
};
|
|
9
|
-
export
|
|
10
|
+
export type CatladderJobEnvironmentConfig = {
|
|
11
|
+
action?: GitlabEnvironment["action"];
|
|
12
|
+
on_stop?: GitlabEnvironment["on_stop"];
|
|
13
|
+
auto_stop_in?: string;
|
|
14
|
+
};
|
|
15
|
+
export type CatladderJob<S = BaseStage> = {
|
|
10
16
|
/**
|
|
11
17
|
* the name of the job (without any env or app prefix and suffix)
|
|
12
18
|
*/
|
|
@@ -67,12 +73,23 @@ export declare type CatladderJob<S = BaseStage> = {
|
|
|
67
73
|
/**
|
|
68
74
|
* variables to pass
|
|
69
75
|
*/
|
|
70
|
-
variables:
|
|
76
|
+
variables: UnspecifiedEnvVars | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* additional vars only for the runner.
|
|
79
|
+
* Also if you use services: that require env vars, you need to set them here.
|
|
80
|
+
*
|
|
81
|
+
*/
|
|
82
|
+
runnerVariables?: Record<string, string>;
|
|
71
83
|
/**
|
|
72
84
|
* whether failures are allowed
|
|
73
85
|
*/
|
|
74
86
|
allow_failure?: boolean;
|
|
75
|
-
|
|
87
|
+
/**
|
|
88
|
+
* gitlab environment config, subject to change
|
|
89
|
+
*/
|
|
90
|
+
environment?: CatladderJobEnvironmentConfig;
|
|
91
|
+
/** */
|
|
92
|
+
when?: GitlabRule["when"];
|
|
76
93
|
rules?: GitlabRule[];
|
|
77
94
|
/**
|
|
78
95
|
* How many instances of a job should be run in parallel.
|
package/dist/types/jobs.js
CHANGED
package/dist/types/pipeline.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { GitlabJobDef, GitlabPipeline } from "./gitlab-types";
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
2
|
+
export type PipelineType = "gitlab";
|
|
3
|
+
export type PipelineMode<T extends PipelineType> = T extends "gitlab" ? "childpipeline" | "local" : "local";
|
|
4
|
+
export type PipelineJob<T extends PipelineType> = T extends "gitlab" ? GitlabJobDef : never;
|
|
5
|
+
export type Pipeline<T extends PipelineType> = T extends "gitlab" ? GitlabPipeline : never;
|
package/dist/types/pipeline.js
CHANGED
package/dist/types/utils.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type PartialDeep<T> = T extends any[] ? T : T extends Record<string, any> ? { [P in keyof T]?: PartialDeep<T[P]> } : T;
|
package/dist/types/utils.js
CHANGED
package/dist/utils/gitlab.js
CHANGED
|
@@ -31,7 +31,9 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
|
31
31
|
}
|
|
32
32
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
33
33
|
};
|
|
34
|
-
exports
|
|
34
|
+
Object.defineProperty(exports, "__esModule", {
|
|
35
|
+
value: true
|
|
36
|
+
});
|
|
35
37
|
exports.collapseableSection = exports.repeatOnFailure = exports.sanitizeForBashVariable = exports.allowFailureInScripts = void 0;
|
|
36
38
|
var allowFailureInScripts = function (script) {
|
|
37
39
|
return __spreadArray(__spreadArray(["set +e"], __read(script), false), ["set -e" // reenable
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare function notNil<TValue>(value: TValue | null | undefined): value is TValue;
|
|
2
|
-
export declare const ensureArray: <T>(s: T | T[]
|
|
2
|
+
export declare const ensureArray: <T>(s: undefined | T | T[]) => T[] | null;
|
|
3
3
|
export declare const mergeWithMergingArrays: <A, B>(obj1: A, obj2: B) => A & B;
|
package/dist/utils/index.js
CHANGED
|
@@ -31,7 +31,9 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
|
31
31
|
}
|
|
32
32
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
33
33
|
};
|
|
34
|
-
exports
|
|
34
|
+
Object.defineProperty(exports, "__esModule", {
|
|
35
|
+
value: true
|
|
36
|
+
});
|
|
35
37
|
exports.mergeWithMergingArrays = exports.ensureArray = exports.notNil = void 0;
|
|
36
38
|
var lodash_1 = require("lodash");
|
|
37
39
|
function notNil(value) {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const getAutoGeneratedHeader: (commentChar: string) => string;
|
|
2
|
+
export declare const writeGeneratedFile: (path: string, content: string, {
|
|
3
|
+
commentChar
|
|
4
|
+
}: {
|
|
5
|
+
commentChar: string;
|
|
6
|
+
}) => Promise<void>;
|
|
7
|
+
export declare const writeYamlfile: (path: string, data: any) => Promise<void>;
|
|
@@ -55,7 +55,7 @@ var __generator = this && this.__generator || function (thisArg, body) {
|
|
|
55
55
|
}
|
|
56
56
|
function step(op) {
|
|
57
57
|
if (f) throw new TypeError("Generator is already executing.");
|
|
58
|
-
while (_) try {
|
|
58
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
59
59
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
60
60
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
61
61
|
switch (op[0]) {
|
|
@@ -115,41 +115,58 @@ var __generator = this && this.__generator || function (thisArg, body) {
|
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
117
|
};
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
118
|
+
var __importDefault = this && this.__importDefault || function (mod) {
|
|
119
|
+
return mod && mod.__esModule ? mod : {
|
|
120
|
+
"default": mod
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
Object.defineProperty(exports, "__esModule", {
|
|
124
|
+
value: true
|
|
125
|
+
});
|
|
126
|
+
exports.writeYamlfile = exports.writeGeneratedFile = exports.getAutoGeneratedHeader = void 0;
|
|
127
|
+
var promises_1 = require("fs/promises");
|
|
128
|
+
var yaml_1 = require("yaml");
|
|
129
|
+
var packageInfos_1 = __importDefault(require("../packageInfos"));
|
|
130
|
+
var getAutoGeneratedHeader = function (commentChar) {
|
|
131
|
+
return ["-------------------------------------------------", "\uD83D\uDC31 \uD83D\uDD28 This file is generated by catladder v".concat(packageInfos_1.default.version), "\uD83D\uDEA8 Do not edit this file manually \uD83D\uDEA8", "-------------------------------------------------"].map(function (line) {
|
|
132
|
+
return "".concat(commentChar, " ").concat(line);
|
|
133
|
+
}).join("\n").concat("\n");
|
|
134
|
+
};
|
|
135
|
+
exports.getAutoGeneratedHeader = getAutoGeneratedHeader;
|
|
136
|
+
var writeGeneratedFile = function (path_1, content_1, _a) {
|
|
137
|
+
return __awaiter(void 0, [path_1, content_1, _a], void 0, function (path, content, _b) {
|
|
138
|
+
var commentChar = _b.commentChar;
|
|
139
|
+
return __generator(this, function (_c) {
|
|
140
|
+
switch (_c.label) {
|
|
125
141
|
case 0:
|
|
126
|
-
return [4 /*yield*/, (0,
|
|
127
|
-
|
|
142
|
+
return [4 /*yield*/, (0, promises_1.writeFile)(path,
|
|
143
|
+
// need to spread out the jobs, forgot why
|
|
144
|
+
[(0, exports.getAutoGeneratedHeader)(commentChar), content].join("\n"), {
|
|
145
|
+
encoding: "utf-8"
|
|
128
146
|
})];
|
|
129
147
|
case 1:
|
|
130
|
-
|
|
148
|
+
_c.sent();
|
|
149
|
+
return [2 /*return*/];
|
|
131
150
|
}
|
|
132
151
|
});
|
|
133
152
|
});
|
|
134
153
|
};
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
* returns the last tagged version string Major.minor.patch
|
|
139
|
-
* returns 0.0.0 if there is no tag
|
|
140
|
-
*/
|
|
141
|
-
var getCurrentVersionString = function () {
|
|
154
|
+
|
|
155
|
+
exports.writeGeneratedFile = writeGeneratedFile;
|
|
156
|
+
var writeYamlfile = function (path, data) {
|
|
142
157
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
143
158
|
return __generator(this, function (_a) {
|
|
144
159
|
switch (_a.label) {
|
|
145
160
|
case 0:
|
|
146
|
-
return [4 /*yield*/, (0,
|
|
147
|
-
|
|
161
|
+
return [4 /*yield*/, (0, exports.writeGeneratedFile)(path, (0, yaml_1.stringify)(data), {
|
|
162
|
+
commentChar: "#"
|
|
148
163
|
})];
|
|
149
164
|
case 1:
|
|
150
|
-
|
|
165
|
+
_a.sent();
|
|
166
|
+
return [2 /*return*/];
|
|
151
167
|
}
|
|
152
168
|
});
|
|
153
169
|
});
|
|
154
170
|
};
|
|
155
|
-
|
|
171
|
+
|
|
172
|
+
exports.writeYamlfile = writeYamlfile;
|