@catladder/pipeline 1.144.0 → 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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AllowUnknownProps, DeployConfigBase } from "./base";
|
|
2
|
-
export
|
|
2
|
+
export type DeployConfigKubernetesClusterGCloud = {
|
|
3
3
|
type: "gcloud";
|
|
4
4
|
/**
|
|
5
5
|
* gcoud name of the cluster
|
|
@@ -18,22 +18,22 @@ export declare type DeployConfigKubernetesClusterGCloud = {
|
|
|
18
18
|
*/
|
|
19
19
|
domainCanonical?: string;
|
|
20
20
|
};
|
|
21
|
-
export
|
|
22
|
-
export
|
|
21
|
+
export type DeployConfigKubernetesCluster = DeployConfigKubernetesClusterGCloud;
|
|
22
|
+
export type KubernetesAutoscaleMetricResourceTarget = {
|
|
23
23
|
type: "Utilization";
|
|
24
24
|
averageUtilization: number;
|
|
25
25
|
} | {
|
|
26
26
|
type: "AverageValue";
|
|
27
27
|
averageValue: number | string;
|
|
28
28
|
};
|
|
29
|
-
export
|
|
29
|
+
export type KubernetesAutoscaleMetric = {
|
|
30
30
|
type: "Resource";
|
|
31
31
|
resource: {
|
|
32
32
|
name: "cpu" | "memory";
|
|
33
33
|
target: KubernetesAutoscaleMetricResourceTarget;
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
|
-
export
|
|
36
|
+
export type KubernetesAutoscale = {
|
|
37
37
|
minReplicas: number;
|
|
38
38
|
maxReplicas: number;
|
|
39
39
|
/**
|
|
@@ -41,7 +41,7 @@ export declare type KubernetesAutoscale = {
|
|
|
41
41
|
*/
|
|
42
42
|
metrics: KubernetesAutoscaleMetric[];
|
|
43
43
|
};
|
|
44
|
-
export
|
|
44
|
+
export type KubernetesResourcesDef = {
|
|
45
45
|
limits?: {
|
|
46
46
|
cpu?: string;
|
|
47
47
|
memory?: string;
|
|
@@ -51,7 +51,7 @@ export declare type KubernetesResourcesDef = {
|
|
|
51
51
|
memory?: string;
|
|
52
52
|
};
|
|
53
53
|
};
|
|
54
|
-
|
|
54
|
+
type KubernetesHealthDef = {
|
|
55
55
|
httpGet?: {
|
|
56
56
|
path?: string;
|
|
57
57
|
port?: number;
|
|
@@ -65,7 +65,7 @@ declare type KubernetesHealthDef = {
|
|
|
65
65
|
successThreshold?: number;
|
|
66
66
|
};
|
|
67
67
|
};
|
|
68
|
-
export
|
|
68
|
+
export type KubernetesUpdateStrategy = {
|
|
69
69
|
rollingUpdate: {
|
|
70
70
|
/**
|
|
71
71
|
* how many pods can be created additionally to the target number
|
|
@@ -82,7 +82,7 @@ export declare type KubernetesUpdateStrategy = {
|
|
|
82
82
|
};
|
|
83
83
|
type: "RollingUpdate";
|
|
84
84
|
};
|
|
85
|
-
export
|
|
85
|
+
export type KubernetesWorkerDef = {
|
|
86
86
|
enabled: boolean;
|
|
87
87
|
/**
|
|
88
88
|
* which command to run. defaults to `yarn start`
|
|
@@ -97,18 +97,18 @@ export declare type KubernetesWorkerDef = {
|
|
|
97
97
|
*/
|
|
98
98
|
livenessProbe?: boolean;
|
|
99
99
|
};
|
|
100
|
-
|
|
100
|
+
type KubernetesTolerationExists = {
|
|
101
101
|
operator: "Exists";
|
|
102
102
|
};
|
|
103
|
-
|
|
103
|
+
type KubernetesTolerationEqual = {
|
|
104
104
|
operator: "Equal";
|
|
105
105
|
value: string;
|
|
106
106
|
};
|
|
107
|
-
export
|
|
107
|
+
export type KubernetesToleration = {
|
|
108
108
|
key: string;
|
|
109
109
|
effect: "NoSchedule" | "PreferNoSchedule" | "NoExecute";
|
|
110
110
|
} & (KubernetesTolerationEqual | KubernetesTolerationExists);
|
|
111
|
-
export
|
|
111
|
+
export type DeployConfigMongodbBase = {
|
|
112
112
|
enabled?: boolean;
|
|
113
113
|
dbName?: string;
|
|
114
114
|
persistence?: {
|
|
@@ -124,7 +124,7 @@ export declare type DeployConfigMongodbBase = {
|
|
|
124
124
|
resources?: KubernetesResourcesDef;
|
|
125
125
|
tolerations?: KubernetesToleration[];
|
|
126
126
|
};
|
|
127
|
-
export
|
|
127
|
+
export type KubernetesRedirect = {
|
|
128
128
|
/**
|
|
129
129
|
* the domain to redirect from
|
|
130
130
|
*/
|
|
@@ -141,21 +141,21 @@ export declare type KubernetesRedirect = {
|
|
|
141
141
|
*/
|
|
142
142
|
rule?: string;
|
|
143
143
|
};
|
|
144
|
-
export
|
|
144
|
+
export type DeployConfigMongodbStandalone = {
|
|
145
145
|
architecture: "standalone";
|
|
146
146
|
};
|
|
147
|
-
export
|
|
147
|
+
export type DeployConfigMongodbReplicaset = {
|
|
148
148
|
architecture: "replicaset";
|
|
149
149
|
/**
|
|
150
150
|
* defaults to 2
|
|
151
151
|
*/
|
|
152
152
|
replicaCount?: number;
|
|
153
153
|
};
|
|
154
|
-
export
|
|
154
|
+
export type DeployConfigMongodb = DeployConfigMongodbBase & (DeployConfigMongodbStandalone | DeployConfigMongodbReplicaset);
|
|
155
155
|
/**
|
|
156
156
|
* @deprecated use config with instanceConnectionName
|
|
157
157
|
*/
|
|
158
|
-
|
|
158
|
+
type DeployConfigKubernetesValuesCloudSQLLegacy = {
|
|
159
159
|
enabled: boolean;
|
|
160
160
|
/**
|
|
161
161
|
* @deprecated use config with instanceConnectionName
|
|
@@ -178,7 +178,7 @@ declare type DeployConfigKubernetesValuesCloudSQLLegacy = {
|
|
|
178
178
|
*/
|
|
179
179
|
type?: "legacy";
|
|
180
180
|
};
|
|
181
|
-
export
|
|
181
|
+
export type DeployConfigKubernetesValuesCloudSQLUnmanaged = {
|
|
182
182
|
enabled: boolean;
|
|
183
183
|
instanceConnectionName: string;
|
|
184
184
|
/**
|
|
@@ -204,8 +204,8 @@ export declare type DeployConfigKubernetesValuesCloudSQLUnmanaged = {
|
|
|
204
204
|
*/
|
|
205
205
|
dbBaseName?: string;
|
|
206
206
|
};
|
|
207
|
-
export
|
|
208
|
-
export
|
|
207
|
+
export type DeployConfigKubernetesValuesCloudSQL = DeployConfigKubernetesValuesCloudSQLLegacy | DeployConfigKubernetesValuesCloudSQLUnmanaged;
|
|
208
|
+
export type DeployConfigKubernetesValues = AllowUnknownProps<{
|
|
209
209
|
/**
|
|
210
210
|
* enable cloudsql db. Currently you have to manually set it up
|
|
211
211
|
*/
|
|
@@ -331,7 +331,7 @@ export declare type DeployConfigKubernetesValues = AllowUnknownProps<{
|
|
|
331
331
|
*/
|
|
332
332
|
secretsAsFile?: string[];
|
|
333
333
|
}>;
|
|
334
|
-
export
|
|
334
|
+
export type DeployConfigKubernetes = {
|
|
335
335
|
type: "kubernetes";
|
|
336
336
|
/**
|
|
337
337
|
* cluster config to use.
|
package/dist/deploy/utils.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
exports
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
4
6
|
exports.contextIsStoppable = exports.getKubernetesNamespace = exports.getFullKubernetesClusterName = void 0;
|
|
5
7
|
var types_1 = require("./types");
|
|
6
8
|
var getFullKubernetesClusterName = function (cluster) {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export * from "./pipeline
|
|
1
|
+
export * from "./pipeline";
|
|
2
2
|
export * from "./types";
|
|
3
3
|
export * from "./rules";
|
|
4
4
|
export * from "./runner";
|
|
5
5
|
export * from "./config";
|
|
6
6
|
export * from "./context";
|
|
7
7
|
export * from "./build";
|
|
8
|
-
export * from "./deploy";
|
|
8
|
+
export * from "./deploy";
|
|
9
|
+
export * from "./utils/writeFiles";
|
package/dist/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,12 +19,15 @@ 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
|
|
19
|
-
|
|
22
|
+
Object.defineProperty(exports, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
});
|
|
25
|
+
__exportStar(require("./pipeline"), exports);
|
|
20
26
|
__exportStar(require("./types"), exports);
|
|
21
27
|
__exportStar(require("./rules"), exports);
|
|
22
28
|
__exportStar(require("./runner"), exports);
|
|
23
29
|
__exportStar(require("./config"), exports);
|
|
24
30
|
__exportStar(require("./context"), exports);
|
|
25
31
|
__exportStar(require("./build"), exports);
|
|
26
|
-
__exportStar(require("./deploy"), exports);
|
|
32
|
+
__exportStar(require("./deploy"), exports);
|
|
33
|
+
__exportStar(require("./utils/writeFiles"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// we can't import the package.json directly, because the bundling process will inline it
|
|
4
|
+
// but the version is only set during deployement, when its already bundled
|
|
5
|
+
// instead we need to use require.main.path to get the path of the main module, which is actually the file in the bin
|
|
6
|
+
// this will point to the root package.json
|
|
7
|
+
var _a;
|
|
8
|
+
Object.defineProperty(exports, "__esModule", {
|
|
9
|
+
value: true
|
|
10
|
+
});
|
|
11
|
+
var path = ((_a = require.main) === null || _a === void 0 ? void 0 : _a.path) + "/../package.json";
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
13
|
+
var ownPkg = require(path);
|
|
14
|
+
exports.default = ownPkg;
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import type { Config, PipelineTrigger } from "../types";
|
|
2
|
-
|
|
3
|
-
export declare type AllCatladderJobs = {
|
|
1
|
+
import type { CatladderJobWithContext, Config, PipelineTrigger, PipelineType } from "../types";
|
|
2
|
+
export type AllCatladderJobs = {
|
|
4
3
|
[componentName: string]: {
|
|
5
|
-
[env: string]: Array<
|
|
4
|
+
[env: string]: Array<CatladderJobWithContext>;
|
|
6
5
|
};
|
|
7
6
|
};
|
|
8
|
-
export
|
|
7
|
+
export type AllJobsContext = {
|
|
8
|
+
config: Config;
|
|
9
|
+
trigger: PipelineTrigger;
|
|
10
|
+
pipelineType: PipelineType;
|
|
11
|
+
};
|
|
12
|
+
export declare const createAllJobs: ({
|
|
13
|
+
config,
|
|
14
|
+
trigger,
|
|
15
|
+
pipelineType
|
|
16
|
+
}: AllJobsContext) => Promise<AllCatladderJobs>;
|
|
@@ -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,17 +115,22 @@ var __generator = this && this.__generator || function (thisArg, body) {
|
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
117
|
};
|
|
118
|
-
exports
|
|
118
|
+
Object.defineProperty(exports, "__esModule", {
|
|
119
|
+
value: true
|
|
120
|
+
});
|
|
119
121
|
exports.createAllJobs = void 0;
|
|
120
122
|
var config_1 = require("../config");
|
|
121
123
|
var createJobsForComponent_1 = require("./createJobsForComponent");
|
|
122
|
-
var createAllJobs = function (
|
|
123
|
-
return __awaiter(void 0,
|
|
124
|
-
var
|
|
125
|
-
|
|
126
|
-
|
|
124
|
+
var createAllJobs = function (_a) {
|
|
125
|
+
return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
126
|
+
var _c, _d;
|
|
127
|
+
var config = _b.config,
|
|
128
|
+
trigger = _b.trigger,
|
|
129
|
+
pipelineType = _b.pipelineType;
|
|
130
|
+
return __generator(this, function (_e) {
|
|
131
|
+
switch (_e.label) {
|
|
127
132
|
case 0:
|
|
128
|
-
|
|
133
|
+
_d = (_c = Object).fromEntries;
|
|
129
134
|
return [4 /*yield*/, Promise.all(Object.keys(config.components).map(function (componentName) {
|
|
130
135
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
131
136
|
var envs, _a, _b, _c;
|
|
@@ -142,7 +147,13 @@ var createAllJobs = function (config, trigger) {
|
|
|
142
147
|
switch (_b.label) {
|
|
143
148
|
case 0:
|
|
144
149
|
_a = [env];
|
|
145
|
-
return [4 /*yield*/, (0, createJobsForComponent_1.createJobsForComponent)(
|
|
150
|
+
return [4 /*yield*/, (0, createJobsForComponent_1.createJobsForComponent)({
|
|
151
|
+
config: config,
|
|
152
|
+
componentName: componentName,
|
|
153
|
+
env: env,
|
|
154
|
+
trigger: trigger,
|
|
155
|
+
pipelineType: pipelineType
|
|
156
|
+
})];
|
|
146
157
|
case 1:
|
|
147
158
|
return [2 /*return*/, _a.concat([_b.sent()])];
|
|
148
159
|
}
|
|
@@ -156,7 +167,7 @@ var createAllJobs = function (config, trigger) {
|
|
|
156
167
|
});
|
|
157
168
|
}))];
|
|
158
169
|
case 1:
|
|
159
|
-
return [2 /*return*/,
|
|
170
|
+
return [2 /*return*/, _d.apply(_c, [_e.sent()])];
|
|
160
171
|
}
|
|
161
172
|
});
|
|
162
173
|
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Pipeline } from "../types";
|
|
2
2
|
import type { Config, PipelineTrigger } from "../types/config";
|
|
3
|
-
export declare const createChildPipeline: <T extends "gitlab">(
|
|
3
|
+
export declare const createChildPipeline: <T extends "gitlab">(pipelineType: T, trigger: PipelineTrigger, config: Config) => Promise<Pipeline<T>>;
|
|
@@ -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,29 +115,46 @@ var __generator = this && this.__generator || function (thisArg, body) {
|
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
117
|
};
|
|
118
|
-
exports
|
|
118
|
+
Object.defineProperty(exports, "__esModule", {
|
|
119
|
+
value: true
|
|
120
|
+
});
|
|
119
121
|
exports.createChildPipeline = void 0;
|
|
122
|
+
var rules_1 = require("../rules");
|
|
120
123
|
var createAllJobs_1 = require("./createAllJobs");
|
|
121
124
|
var getPipelineStages_1 = require("./getPipelineStages");
|
|
122
125
|
var createGitlabJobs_1 = require("./gitlab/createGitlabJobs");
|
|
123
126
|
var createGitlabPipeline_1 = require("./gitlab/createGitlabPipeline");
|
|
124
|
-
var createChildPipeline = function (
|
|
127
|
+
var createChildPipeline = function (pipelineType, trigger, config) {
|
|
125
128
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
126
129
|
var jobs, stages, gitlabJobs;
|
|
127
130
|
return __generator(this, function (_a) {
|
|
128
131
|
switch (_a.label) {
|
|
129
132
|
case 0:
|
|
130
|
-
return [4 /*yield*/, (0, createAllJobs_1.createAllJobs)(
|
|
133
|
+
return [4 /*yield*/, (0, createAllJobs_1.createAllJobs)({
|
|
134
|
+
config: config,
|
|
135
|
+
trigger: trigger,
|
|
136
|
+
pipelineType: pipelineType
|
|
137
|
+
})];
|
|
131
138
|
case 1:
|
|
132
139
|
jobs = _a.sent();
|
|
133
140
|
stages = (0, getPipelineStages_1.getPipelineStages)(config);
|
|
134
|
-
if (!(
|
|
141
|
+
if (!(pipelineType === "gitlab")) return [3 /*break*/, 3];
|
|
135
142
|
return [4 /*yield*/, (0, createGitlabJobs_1.createGitlabJobs)(jobs)];
|
|
136
143
|
case 2:
|
|
137
144
|
gitlabJobs = _a.sent();
|
|
138
|
-
return [2 /*return*/, (0, createGitlabPipeline_1.
|
|
145
|
+
return [2 /*return*/, (0, createGitlabPipeline_1.createGitlabPipelineWithDefaults)({
|
|
146
|
+
workflow: {
|
|
147
|
+
rules: rules_1.RULES_ALWAYS
|
|
148
|
+
},
|
|
149
|
+
stages: stages,
|
|
150
|
+
jobs: Object.fromEntries(gitlabJobs.map(function (_a) {
|
|
151
|
+
var gitlabJob = _a.gitlabJob,
|
|
152
|
+
name = _a.name;
|
|
153
|
+
return [name, gitlabJob];
|
|
154
|
+
}))
|
|
155
|
+
})];
|
|
139
156
|
case 3:
|
|
140
|
-
throw new Error("".concat(
|
|
157
|
+
throw new Error("".concat(pipelineType, " is not supported"));
|
|
141
158
|
}
|
|
142
159
|
});
|
|
143
160
|
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
export declare const createJobsForComponent: (
|
|
1
|
+
import type { CreateContextContext } from "../context";
|
|
2
|
+
import type { CatladderJobWithContext } from "../types/context";
|
|
3
|
+
export declare const createJobsForComponent: (contextContext: Omit<CreateContextContext, "packageManagerInfo">) => Promise<Array<CatladderJobWithContext>>;
|
|
@@ -65,7 +65,7 @@ var __generator = this && this.__generator || function (thisArg, body) {
|
|
|
65
65
|
}
|
|
66
66
|
function step(op) {
|
|
67
67
|
if (f) throw new TypeError("Generator is already executing.");
|
|
68
|
-
while (_) try {
|
|
68
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
69
69
|
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;
|
|
70
70
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
71
71
|
switch (op[0]) {
|
|
@@ -164,13 +164,14 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
|
164
164
|
}
|
|
165
165
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
166
166
|
};
|
|
167
|
-
exports
|
|
167
|
+
Object.defineProperty(exports, "__esModule", {
|
|
168
|
+
value: true
|
|
169
|
+
});
|
|
168
170
|
exports.createJobsForComponent = void 0;
|
|
169
171
|
var lodash_1 = require("lodash");
|
|
170
172
|
var build_1 = require("../build");
|
|
171
173
|
var context_1 = require("../context");
|
|
172
174
|
var deploy_1 = require("../deploy");
|
|
173
|
-
var getCommitInfo_1 = require("./commitInfo/getCommitInfo");
|
|
174
175
|
var packageManager_1 = require("./packageManager");
|
|
175
176
|
var injectDefaultVarsInCustomJobs = function (context, jobs) {
|
|
176
177
|
return jobs.map(function (_a) {
|
|
@@ -195,25 +196,25 @@ var createRawJobs = function (context) {
|
|
|
195
196
|
var customJobs = getCustomJobs(context);
|
|
196
197
|
return __spreadArray(__spreadArray(__spreadArray([], __read(buildJobs), false), __read(deployJobs), false), __read(customJobs), false);
|
|
197
198
|
};
|
|
198
|
-
var createJobsForComponent = function (
|
|
199
|
+
var createJobsForComponent = function (contextContext) {
|
|
199
200
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
200
|
-
var
|
|
201
|
-
return __generator(this, function (
|
|
202
|
-
switch (
|
|
201
|
+
var packageManagerInfo, context;
|
|
202
|
+
return __generator(this, function (_a) {
|
|
203
|
+
switch (_a.label) {
|
|
203
204
|
case 0:
|
|
204
|
-
|
|
205
|
-
return [4 /*yield*/, (0, getCommitInfo_1.getBaseCommitInfo)()];
|
|
205
|
+
return [4 /*yield*/, (0, packageManager_1.getPackageManagerInfo)(contextContext.config, contextContext.componentName)];
|
|
206
206
|
case 1:
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
207
|
+
packageManagerInfo = _a.sent();
|
|
208
|
+
return [4 /*yield*/, (0, context_1.createContext)(__assign(__assign({}, contextContext), {
|
|
209
|
+
packageManagerInfo: packageManagerInfo
|
|
210
|
+
}))];
|
|
211
211
|
case 2:
|
|
212
|
-
|
|
213
|
-
return [
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
212
|
+
context = _a.sent();
|
|
213
|
+
return [2 /*return*/, createRawJobs(context).map(function (job) {
|
|
214
|
+
return __assign(__assign({}, job), {
|
|
215
|
+
context: context
|
|
216
|
+
});
|
|
217
|
+
})];
|
|
217
218
|
}
|
|
218
219
|
});
|
|
219
220
|
});
|