@catladder/pipeline 1.146.0 → 1.146.2
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 +2 -2
- package/dist/build/base/createAppBuildJob.js +1 -1
- package/dist/build/base/index.d.ts +2 -2
- package/dist/build/base/writeBuildInfo.d.ts +2 -2
- package/dist/build/base/writeDotEnv.d.ts +2 -2
- package/dist/build/custom/buildJob.d.ts +2 -2
- package/dist/build/custom/index.d.ts +2 -2
- package/dist/build/custom/testJob.d.ts +2 -2
- package/dist/build/docker.d.ts +9 -9
- package/dist/build/index.d.ts +2 -2
- package/dist/build/node/buildJob.d.ts +2 -2
- package/dist/build/node/buildJob.js +6 -6
- package/dist/build/node/cache.d.ts +5 -5
- package/dist/build/node/cache.js +4 -4
- package/dist/build/node/index.d.ts +4 -4
- package/dist/build/node/meteor.d.ts +2 -2
- package/dist/build/node/meteor.js +2 -2
- package/dist/build/node/testJob.d.ts +2 -2
- package/dist/build/node/testJob.js +6 -6
- package/dist/build/node/yarn.d.ts +4 -4
- package/dist/build/node/yarn.js +1 -1
- package/dist/build/rails/build.d.ts +2 -2
- package/dist/build/rails/index.d.ts +2 -2
- package/dist/build/rails/test.d.ts +2 -2
- package/dist/build/sbom.d.ts +2 -2
- package/dist/build/sbom.js +1 -1
- package/dist/bundles/catladder-gitlab/index.js +1 -1
- package/dist/constants.js +1 -1
- package/dist/context/getEnvironment.d.ts +2 -2
- package/dist/context/getEnvironmentContext.d.ts +2 -2
- package/dist/context/getEnvironmentVariables.d.ts +4 -4
- package/dist/context/getLabels.d.ts +2 -2
- package/dist/context/index.d.ts +7 -3
- package/dist/context/index.js +12 -3
- package/dist/deploy/base/deploy.d.ts +2 -2
- package/dist/deploy/base/index.d.ts +2 -2
- package/dist/deploy/base/rollback.d.ts +2 -2
- package/dist/deploy/base/stop.d.ts +2 -2
- package/dist/deploy/cloudRun/artifactsRegistry.d.ts +7 -7
- package/dist/deploy/cloudRun/cleanup.d.ts +2 -2
- package/dist/deploy/cloudRun/cloudRunRevisions.d.ts +2 -2
- package/dist/deploy/cloudRun/createJobs/cloudRunJobs.d.ts +6 -6
- package/dist/deploy/cloudRun/createJobs/cloudRunServices.d.ts +3 -3
- package/dist/deploy/cloudRun/createJobs/common.d.ts +4 -4
- package/dist/deploy/cloudRun/createJobs/getCloudRunDeployScripts.d.ts +2 -2
- package/dist/deploy/cloudRun/createJobs/getCloudRunStopScripts.d.ts +2 -2
- package/dist/deploy/cloudRun/createJobs/index.d.ts +2 -2
- package/dist/deploy/cloudRun/utils/database.d.ts +3 -3
- package/dist/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.d.ts +2 -2
- package/dist/deploy/cloudRun/utils/getServiceName.d.ts +2 -2
- package/dist/deploy/custom/deployJob.d.ts +2 -2
- package/dist/deploy/custom/deployJob.js +1 -1
- package/dist/deploy/dockerTag/deployJob.d.ts +2 -2
- package/dist/deploy/index.d.ts +2 -2
- package/dist/deploy/kubernetes/cloudSql/index.d.ts +3 -3
- package/dist/deploy/kubernetes/deployJob.d.ts +2 -2
- package/dist/deploy/kubernetes/kubeEnv.d.ts +2 -2
- package/dist/deploy/kubernetes/kubeValues.d.ts +2 -2
- package/dist/deploy/kubernetes/mongodb.d.ts +2 -2
- package/dist/deploy/sbom.d.ts +4 -4
- package/dist/deploy/utils.d.ts +2 -2
- package/dist/pipeline/createJobsForComponent.d.ts +2 -2
- package/dist/pipeline/createJobsForComponent.js +1 -1
- package/dist/pipeline/generatePipelineFiles.js +15 -5
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/config.d.ts +2 -2
- package/dist/types/context.d.ts +16 -2
- package/package.json +1 -1
- package/src/build/base/createAppBuildJob.ts +3 -3
- package/src/build/base/index.ts +2 -2
- package/src/build/base/writeBuildInfo.ts +2 -2
- package/src/build/base/writeDotEnv.ts +2 -2
- package/src/build/custom/__tests__/testJob.test.ts +5 -5
- package/src/build/custom/buildJob.ts +4 -2
- package/src/build/custom/index.ts +2 -2
- package/src/build/custom/testJob.ts +4 -2
- package/src/build/docker.ts +9 -9
- package/src/build/index.ts +2 -2
- package/src/build/node/buildJob.ts +13 -9
- package/src/build/node/cache.ts +9 -9
- package/src/build/node/index.ts +6 -4
- package/src/build/node/meteor.ts +10 -5
- package/src/build/node/testJob.ts +11 -8
- package/src/build/node/yarn.ts +6 -8
- package/src/build/rails/build.ts +4 -2
- package/src/build/rails/index.ts +2 -2
- package/src/build/rails/test.ts +4 -2
- package/src/build/sbom.ts +4 -4
- package/src/context/getEnvironment.ts +2 -2
- package/src/context/getEnvironmentContext.ts +2 -2
- package/src/context/getEnvironmentVariables.ts +7 -4
- package/src/context/getLabels.ts +2 -2
- package/src/context/index.ts +15 -5
- package/src/deploy/base/deploy.ts +2 -2
- package/src/deploy/base/index.ts +2 -2
- package/src/deploy/base/rollback.ts +2 -2
- package/src/deploy/base/stop.ts +2 -2
- package/src/deploy/cloudRun/artifactsRegistry.ts +12 -7
- package/src/deploy/cloudRun/cleanup.ts +2 -2
- package/src/deploy/cloudRun/cloudRunRevisions.ts +3 -3
- package/src/deploy/cloudRun/createJobs/cloudRunJobs.ts +10 -10
- package/src/deploy/cloudRun/createJobs/cloudRunServices.ts +3 -3
- package/src/deploy/cloudRun/createJobs/common.ts +4 -4
- package/src/deploy/cloudRun/createJobs/getCloudRunDeployScripts.ts +5 -2
- package/src/deploy/cloudRun/createJobs/getCloudRunStopScripts.ts +2 -2
- package/src/deploy/cloudRun/createJobs/index.ts +2 -2
- package/src/deploy/cloudRun/utils/database.ts +3 -3
- package/src/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.ts +4 -2
- package/src/deploy/cloudRun/utils/getServiceName.ts +2 -2
- package/src/deploy/custom/deployJob.ts +7 -3
- package/src/deploy/dockerTag/deployJob.ts +4 -2
- package/src/deploy/index.ts +2 -2
- package/src/deploy/kubernetes/cloudSql/index.ts +3 -3
- package/src/deploy/kubernetes/deployJob.ts +2 -2
- package/src/deploy/kubernetes/kubeEnv.ts +2 -2
- package/src/deploy/kubernetes/kubeValues.ts +3 -3
- package/src/deploy/kubernetes/mongodb.ts +8 -8
- package/src/deploy/sbom.ts +8 -4
- package/src/deploy/utils.ts +2 -2
- package/src/pipeline/createJobsForComponent.ts +11 -7
- package/src/pipeline/generatePipelineFiles.ts +20 -11
- package/src/pipeline/gitlab/createGitlabJobs.ts +2 -2
- package/src/types/config.ts +2 -2
- package/src/types/context.ts +18 -2
package/dist/constants.js
CHANGED
|
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
|
|
7
|
-
exports.PIPELINE_IMAGE_TAG = "v1-146-
|
|
7
|
+
exports.PIPELINE_IMAGE_TAG = "v1-146-2-0f533fec" || "latest";
|
|
8
8
|
exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || "git.panter.ch:5001/catladder/catladder";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CreateComponentContextContext } from "..";
|
|
2
2
|
import type { Environment } from "../types/context";
|
|
3
|
-
export declare const getEnvironment: (ctx:
|
|
3
|
+
export declare const getEnvironment: (ctx: CreateComponentContextContext) => Promise<Environment>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CreateComponentContextContext } from "..";
|
|
2
2
|
import type { EnvironmentContext } from "../types/environmentContext";
|
|
3
3
|
export declare const getEnvironmentContext: ({
|
|
4
4
|
env,
|
|
5
5
|
componentName,
|
|
6
6
|
config,
|
|
7
7
|
pipelineType
|
|
8
|
-
}:
|
|
8
|
+
}: CreateComponentContextContext) => EnvironmentContext<any, any>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { ComponentContext, EnvironmentEnvVarPart as EnvironmentVariables } from "../types";
|
|
2
|
+
import type { CreateComponentContextContext } from "..";
|
|
3
3
|
import type { StringOrBashExpression } from "../bash/BashExpression";
|
|
4
4
|
import type { EnvironmentContext } from "../types/environmentContext";
|
|
5
5
|
export type SecretEnvVar = {
|
|
@@ -24,7 +24,7 @@ export type PredefinedVariables = BasePredefinedVariables & {
|
|
|
24
24
|
HOST_INTERNAL: StringOrBashExpression;
|
|
25
25
|
ROOT_URL_INTERNAL: StringOrBashExpression;
|
|
26
26
|
};
|
|
27
|
-
export declare const getEnvironmentVariables: (ctx:
|
|
27
|
+
export declare const getEnvironmentVariables: (ctx: CreateComponentContextContext, alreadyVisited?: Record<string, Record<string, boolean>>) => Promise<EnvironmentVariables>;
|
|
28
28
|
export declare const getSecretVarName: (env: string, componentName: string, key: string) => string;
|
|
29
|
-
export declare const getSecretVarNameForContext: (context:
|
|
29
|
+
export declare const getSecretVarNameForContext: (context: ComponentContext, key: string) => string;
|
|
30
30
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const getLabels: (context:
|
|
1
|
+
import type { ComponentContext } from "../types";
|
|
2
|
+
export declare const getLabels: (context: ComponentContext) => {
|
|
3
3
|
"customer-name": string | undefined;
|
|
4
4
|
"component-name": string | undefined;
|
|
5
5
|
"app-name": string | undefined;
|
package/dist/context/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { PipelineType } from "../types";
|
|
2
2
|
import type { Config, PipelineTrigger } from "../types/config";
|
|
3
|
-
import type {
|
|
3
|
+
import type { ComponentContext, PackageManagerInfo } from "../types/context";
|
|
4
4
|
export * from "./getEnvironment";
|
|
5
5
|
export * from "./getEnvironmentVariables";
|
|
6
|
-
export type
|
|
6
|
+
export type CreateComponentContextContext = {
|
|
7
7
|
config: Config;
|
|
8
8
|
componentName: string;
|
|
9
9
|
env: string;
|
|
@@ -11,4 +11,8 @@ export type CreateContextContext = {
|
|
|
11
11
|
trigger?: PipelineTrigger;
|
|
12
12
|
packageManagerInfo?: PackageManagerInfo;
|
|
13
13
|
};
|
|
14
|
-
export declare const
|
|
14
|
+
export declare const createComponentContext: (ctx: CreateComponentContextContext) => Promise<ComponentContext>;
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated use createComponentContext instead
|
|
17
|
+
*/
|
|
18
|
+
export declare const createContext: (ctx: CreateComponentContextContext) => Promise<ComponentContext>;
|
package/dist/context/index.js
CHANGED
|
@@ -137,7 +137,7 @@ var __generator = this && this.__generator || function (thisArg, body) {
|
|
|
137
137
|
Object.defineProperty(exports, "__esModule", {
|
|
138
138
|
value: true
|
|
139
139
|
});
|
|
140
|
-
exports.createContext = void 0;
|
|
140
|
+
exports.createContext = exports.createComponentContext = void 0;
|
|
141
141
|
var build_1 = require("../build");
|
|
142
142
|
var deploy_1 = require("../deploy");
|
|
143
143
|
var utils_1 = require("../utils");
|
|
@@ -145,7 +145,7 @@ var getEnvironment_1 = require("./getEnvironment");
|
|
|
145
145
|
var getEnvironmentContext_1 = require("./getEnvironmentContext");
|
|
146
146
|
__exportStar(require("./getEnvironment"), exports);
|
|
147
147
|
__exportStar(require("./getEnvironmentVariables"), exports);
|
|
148
|
-
var
|
|
148
|
+
var createComponentContext = function (ctx) {
|
|
149
149
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
150
150
|
var envContext, componentConfigWithoutDefaults, defaults, componentConfig;
|
|
151
151
|
var _a;
|
|
@@ -168,6 +168,11 @@ var createContext = function (ctx) {
|
|
|
168
168
|
_a = {
|
|
169
169
|
fullConfig: ctx.config,
|
|
170
170
|
componentConfig: componentConfig,
|
|
171
|
+
buildContext: {
|
|
172
|
+
dir: componentConfig.dir,
|
|
173
|
+
packageManagerInfo: ctx.packageManagerInfo,
|
|
174
|
+
config: componentConfig.build
|
|
175
|
+
},
|
|
171
176
|
componentName: ctx.componentName
|
|
172
177
|
};
|
|
173
178
|
return [4 /*yield*/, (0, getEnvironment_1.getEnvironment)(ctx)];
|
|
@@ -177,4 +182,8 @@ var createContext = function (ctx) {
|
|
|
177
182
|
});
|
|
178
183
|
});
|
|
179
184
|
};
|
|
180
|
-
exports.
|
|
185
|
+
exports.createComponentContext = createComponentContext;
|
|
186
|
+
/**
|
|
187
|
+
* @deprecated use createComponentContext instead
|
|
188
|
+
*/
|
|
189
|
+
exports.createContext = exports.createComponentContext;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentContext } from "../../types/context";
|
|
2
2
|
import type { CatladderJob } from "../../types/jobs";
|
|
3
3
|
export declare const DEPLOY_JOB_NAME = "\uD83D\uDE80 Deploy";
|
|
4
4
|
export type DeployJobDefinition = Pick<CatladderJob, "script" | "variables" | "image" | "cache" | "artifacts" | "services" | "runnerVariables">;
|
|
5
|
-
export declare const createDeployJob: (context:
|
|
5
|
+
export declare const createDeployJob: (context: ComponentContext, jobDefinition: DeployJobDefinition) => CatladderJob;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentContext } from "../../types/context";
|
|
2
2
|
import type { CatladderJob } from "../../types/jobs";
|
|
3
3
|
import { type DeployJobDefinition } from "./deploy";
|
|
4
4
|
import { type RollbackJobDefinition } from "./rollback";
|
|
5
5
|
import { type StopJobDefinition } from "./stop";
|
|
6
|
-
export declare const createDeployementJobs: (context:
|
|
6
|
+
export declare const createDeployementJobs: (context: ComponentContext, definitions: {
|
|
7
7
|
deploy: DeployJobDefinition;
|
|
8
8
|
stop?: StopJobDefinition;
|
|
9
9
|
rollback?: RollbackJobDefinition;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentContext } from "../../types/context";
|
|
2
2
|
import type { CatladderJob } from "../../types/jobs";
|
|
3
3
|
export declare const ROLLBACK_JOB_NAME = "\u21A9\uFE0F Rollback \u26A0\uFE0F";
|
|
4
4
|
export type RollbackJobDefinition = Pick<CatladderJob, "script" | "variables" | "runnerVariables" | "image">;
|
|
5
|
-
export declare const createRollbackJob: (context:
|
|
5
|
+
export declare const createRollbackJob: (context: ComponentContext, jobDefinition: RollbackJobDefinition) => CatladderJob;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentContext } from "../../types/context";
|
|
2
2
|
import type { CatladderJob } from "../../types/jobs";
|
|
3
3
|
export declare const STOP_JOB_NAME = "\uD83D\uDED1 Stop \u26A0\uFE0F";
|
|
4
4
|
export type StopJobDefinition = Pick<CatladderJob, "script" | "variables" | "image" | "runnerVariables">;
|
|
5
|
-
export declare const createStopJob: (context:
|
|
5
|
+
export declare const createStopJob: (context: ComponentContext, jobDefinition: StopJobDefinition) => CatladderJob;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import type { StringOrBashExpression } from "../../bash/BashExpression";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ComponentContext } from "../../types/context";
|
|
3
3
|
export declare const getArtifactsRegistryHost: ({
|
|
4
4
|
componentConfig: {
|
|
5
5
|
deploy
|
|
6
6
|
}
|
|
7
|
-
}:
|
|
8
|
-
export declare const getArtifactsRegistryDockerUrl: (context:
|
|
7
|
+
}: ComponentContext) => string;
|
|
8
|
+
export declare const getArtifactsRegistryDockerUrl: (context: ComponentContext) => string;
|
|
9
9
|
/**
|
|
10
10
|
*
|
|
11
11
|
* lecacyReviewImageName is only temporary. In old versions the images had no reviewslug in review apps, which makes cleanup harder. We delete all those images now, but need the path
|
|
12
12
|
*/
|
|
13
|
-
export declare const getArtifactsRegistryImageName: (context:
|
|
14
|
-
export declare const getArtifactsRegistryBuildCacheImage: (context:
|
|
15
|
-
export declare const getArtifactsRegistryImage: (context:
|
|
13
|
+
export declare const getArtifactsRegistryImageName: (context: ComponentContext, lecacyReviewImageName?: boolean) => StringOrBashExpression;
|
|
14
|
+
export declare const getArtifactsRegistryBuildCacheImage: (context: ComponentContext) => string;
|
|
15
|
+
export declare const getArtifactsRegistryImage: (context: ComponentContext) => string;
|
|
16
16
|
/**
|
|
17
17
|
* commands to delete unused images.
|
|
18
18
|
*
|
|
@@ -20,4 +20,4 @@ export declare const getArtifactsRegistryImage: (context: Context) => string;
|
|
|
20
20
|
* @param keep how many of the newest images to keep
|
|
21
21
|
* @returns
|
|
22
22
|
*/
|
|
23
|
-
export declare const getDeleteUnusedImagesCommands: (context:
|
|
23
|
+
export declare const getDeleteUnusedImagesCommands: (context: ComponentContext, keep?: number) => string[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const getRemoveOldRevisionsAndImagesCommand: (context:
|
|
1
|
+
import type { ComponentContext } from "../../types/context";
|
|
2
|
+
export declare const getRemoveOldRevisionsAndImagesCommand: (context: ComponentContext, when: "postDeploy" | "onStop") => string[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const getDeleteUnusedRevisionsCommands: (context:
|
|
1
|
+
import type { ComponentContext } from "../../types/context";
|
|
2
|
+
export declare const getDeleteUnusedRevisionsCommands: (context: ComponentContext, keep: number) => string[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentContext } from "../../../types/context";
|
|
2
2
|
import type { DeployConfigCloudRunJob } from "../../types/googleCloudRun";
|
|
3
|
-
export declare const getDeleteSchedulesScripts: (context:
|
|
4
|
-
export declare const getDeleteJobsScripts: (context:
|
|
5
|
-
export declare const getJobRunScripts: (context:
|
|
6
|
-
export declare const getJobCreateScripts: (context:
|
|
7
|
-
export declare const getCreateScheduleScripts: (context:
|
|
3
|
+
export declare const getDeleteSchedulesScripts: (context: ComponentContext) => string[];
|
|
4
|
+
export declare const getDeleteJobsScripts: (context: ComponentContext) => string[];
|
|
5
|
+
export declare const getJobRunScripts: (context: ComponentContext, when: DeployConfigCloudRunJob["when"]) => string[];
|
|
6
|
+
export declare const getJobCreateScripts: (context: ComponentContext) => string[];
|
|
7
|
+
export declare const getCreateScheduleScripts: (context: ComponentContext) => string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentContext } from "../../../types/context";
|
|
2
2
|
import type { DeployConfigCloudRunService } from "../../types/googleCloudRun";
|
|
3
|
-
export declare const getServiceDeployScript: (context:
|
|
4
|
-
export declare const getServiceDeleteScript: (context:
|
|
3
|
+
export declare const getServiceDeployScript: (context: ComponentContext, service: DeployConfigCloudRunService | true | undefined, nameSuffix?: string) => string;
|
|
4
|
+
export declare const getServiceDeleteScript: (context: ComponentContext, serviceSuffix?: string) => string[];
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentContext } from "../../../types/context";
|
|
2
2
|
import type { DeployConfigCloudRun } from "../../types/googleCloudRun";
|
|
3
3
|
export declare const gcloudCmd: (version?: "beta") => string;
|
|
4
4
|
export declare const gcloudRunCmd: (version?: "beta") => string;
|
|
5
5
|
export declare const gcloudSchedulerCmd: (version?: "beta") => string;
|
|
6
6
|
export declare const setGoogleProjectNumberScript: (deployConfig: DeployConfigCloudRun) => string[];
|
|
7
7
|
export declare const makeLabelString: (obj: Record<string, unknown>) => string;
|
|
8
|
-
export declare const getCloudRunDeployConfig: (context:
|
|
9
|
-
export declare function getCommonCloudRunArgs(context:
|
|
8
|
+
export declare const getCloudRunDeployConfig: (context: ComponentContext) => DeployConfigCloudRun;
|
|
9
|
+
export declare function getCommonCloudRunArgs(context: ComponentContext): {
|
|
10
10
|
project: string;
|
|
11
11
|
region: import("../../types").Gcloudregion;
|
|
12
12
|
};
|
|
13
|
-
export declare function getCommonDeployArgs(context:
|
|
13
|
+
export declare function getCommonDeployArgs(context: ComponentContext): {
|
|
14
14
|
"set-cloudsql-instances": string | undefined;
|
|
15
15
|
project: string;
|
|
16
16
|
region: import("../../types").Gcloudregion;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function getCloudRunDeployScripts(context:
|
|
1
|
+
import type { ComponentContext } from "../../../types/context";
|
|
2
|
+
export declare function getCloudRunDeployScripts(context: ComponentContext): string[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function getCloudRunStopScripts(context:
|
|
1
|
+
import type { ComponentContext } from "../../../types/context";
|
|
2
|
+
export declare function getCloudRunStopScripts(context: ComponentContext): string[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentContext } from "../../../types/context";
|
|
2
2
|
import type { CatladderJob } from "../../../types/jobs";
|
|
3
|
-
export declare const createGoogleCloudRunDeployJobs: (context:
|
|
3
|
+
export declare const createGoogleCloudRunDeployJobs: (context: ComponentContext) => CatladderJob[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentContext } from "../../../types";
|
|
2
2
|
import type { DeployConfigCloudRun, DeployConfigCloudRunCloudSql } from "../../types";
|
|
3
|
-
export declare const getDatabaseDeleteScript: (context:
|
|
4
|
-
export declare const getDatabaseCreateScript: (context:
|
|
3
|
+
export declare const getDatabaseDeleteScript: (context: ComponentContext, deployConfig: DeployConfigCloudRun) => string[];
|
|
4
|
+
export declare const getDatabaseCreateScript: (context: ComponentContext, deployConfig: DeployConfigCloudRun) => string[];
|
|
5
5
|
export declare const 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";
|
|
6
6
|
export declare const getDatabaseConnectionString: (config: DeployConfigCloudRunCloudSql) => string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const gcloudServiceAccountLoginCommands: (context:
|
|
1
|
+
import type { ComponentContext } from "../../../types";
|
|
2
|
+
export declare const gcloudServiceAccountLoginCommands: (context: ComponentContext) => string[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const getServiceName: (context:
|
|
1
|
+
import type { ComponentContext } from "../../../types/context";
|
|
2
|
+
export declare const getServiceName: (context: ComponentContext) => string | import("../../../bash/BashExpression").BashExpression;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentContext } from "../../types/context";
|
|
2
2
|
import type { CatladderJob } from "../../types/jobs";
|
|
3
|
-
export declare const createCustomDeployJobs: (context:
|
|
3
|
+
export declare const createCustomDeployJobs: (context: ComponentContext) => CatladderJob[];
|
|
@@ -51,7 +51,7 @@ var createCustomDeployJobs = function (context) {
|
|
|
51
51
|
throw new Error("deploy config is not custom");
|
|
52
52
|
}
|
|
53
53
|
// FIXME: custom deploy currently assumes yarn-based project
|
|
54
|
-
var yarnInstall = (0, yarn_1.getYarnInstall)(context, {
|
|
54
|
+
var yarnInstall = (0, yarn_1.getYarnInstall)(context.buildContext, {
|
|
55
55
|
noCustomPostInstall: true
|
|
56
56
|
});
|
|
57
57
|
return (0, base_1.createDeployementJobs)(context, {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentContext } from "../../types/context";
|
|
2
2
|
import type { CatladderJob } from "../../types/jobs";
|
|
3
|
-
export declare const createDockerTagDeployJobs: (context:
|
|
3
|
+
export declare const createDockerTagDeployJobs: (context: ComponentContext) => CatladderJob[];
|
package/dist/deploy/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SecretEnvVar } from "..";
|
|
2
2
|
import type { BashExpression } from "../bash/BashExpression";
|
|
3
|
-
import type {
|
|
3
|
+
import type { ComponentContext } from "../types/context";
|
|
4
4
|
import type { EnvironmentContext } from "../types/environmentContext";
|
|
5
5
|
import type { CatladderJob } from "../types/jobs";
|
|
6
6
|
import type { PartialDeep } from "../types/utils";
|
|
@@ -10,7 +10,7 @@ export * from "./kubernetes";
|
|
|
10
10
|
export * from "./types";
|
|
11
11
|
export * from "./utils";
|
|
12
12
|
export type DeployTypeDefinition<T extends DeployConfigType> = {
|
|
13
|
-
jobs: (context:
|
|
13
|
+
jobs: (context: ComponentContext) => CatladderJob[];
|
|
14
14
|
defaults: (envContext: EnvironmentContext<any, T>) => PartialDeep<DeployConfigGeneric<T>>;
|
|
15
15
|
additionalSecretKeys: (envContext: EnvironmentContext<any, T>) => SecretEnvVar[];
|
|
16
16
|
getAdditionalEnvVars: (envContext: EnvironmentContext<any, T>) => Record<string, string | BashExpression | undefined | null>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { StringOrBashExpression } from "../../../bash/BashExpression";
|
|
2
|
-
import type {
|
|
3
|
-
export declare const hasKubernetesCloudSQL: (context:
|
|
2
|
+
import type { ComponentContext } from "../../../types";
|
|
3
|
+
export declare const hasKubernetesCloudSQL: (context: ComponentContext) => boolean | undefined;
|
|
4
4
|
type CloudSqlValues = {
|
|
5
5
|
enabled: boolean;
|
|
6
6
|
proxyCredentials: string;
|
|
@@ -8,7 +8,7 @@ type CloudSqlValues = {
|
|
|
8
8
|
fullDbName: StringOrBashExpression;
|
|
9
9
|
dbUser: string;
|
|
10
10
|
};
|
|
11
|
-
export declare const createKubernetesCloudsqlBaseValues: (context:
|
|
11
|
+
export declare const createKubernetesCloudsqlBaseValues: (context: ComponentContext) => {
|
|
12
12
|
cloudsql: CloudSqlValues;
|
|
13
13
|
};
|
|
14
14
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentContext } from "../../types/context";
|
|
2
2
|
import type { CatladderJob } from "../../types/jobs";
|
|
3
|
-
export declare const createKubernetesDeployJobs: (context:
|
|
3
|
+
export declare const createKubernetesDeployJobs: (context: ComponentContext) => CatladderJob[];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { StringOrBashExpression } from "../../bash/BashExpression";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ComponentContext } from "../../types";
|
|
3
3
|
/**
|
|
4
4
|
* separate by secrets and public.
|
|
5
5
|
* we evalulate the actual values later, but want to store the secrets in kubernetes secrets
|
|
6
6
|
*/
|
|
7
|
-
export declare const createKubeEnv: (context:
|
|
7
|
+
export declare const createKubeEnv: (context: ComponentContext) => {
|
|
8
8
|
secret: Record<string, StringOrBashExpression>;
|
|
9
9
|
public: Record<string, StringOrBashExpression>;
|
|
10
10
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const createKubeValues: (context:
|
|
1
|
+
import type { ComponentContext } from "../../types/context";
|
|
2
|
+
export declare const createKubeValues: (context: ComponentContext) => never[] | ({
|
|
3
3
|
env: {
|
|
4
4
|
secret: Record<string, import("../../bash/BashExpression").StringOrBashExpression>;
|
|
5
5
|
public: Record<string, import("../../bash/BashExpression").StringOrBashExpression>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const createMongodbBaseConfig: (context:
|
|
1
|
+
import type { ComponentContext } from "../../types/context";
|
|
2
|
+
export declare const createMongodbBaseConfig: (context: ComponentContext) => {
|
|
3
3
|
mongodb: {
|
|
4
4
|
enabled: boolean;
|
|
5
5
|
auth: {
|
package/dist/deploy/sbom.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const sbomDeactivated: (context:
|
|
3
|
-
export declare const getDependencyTrackUploadScript: (context:
|
|
4
|
-
export declare const getDependencyTrackDeleteScript: (context:
|
|
1
|
+
import type { ComponentContext } from "../types/context";
|
|
2
|
+
export declare const sbomDeactivated: (context: ComponentContext) => boolean;
|
|
3
|
+
export declare const getDependencyTrackUploadScript: (context: ComponentContext) => string[];
|
|
4
|
+
export declare const getDependencyTrackDeleteScript: (context: ComponentContext) => string[];
|
package/dist/deploy/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Config,
|
|
1
|
+
import type { Config, ComponentContext } from "../types";
|
|
2
2
|
import type { DeployConfigKubernetesCluster } from "./types";
|
|
3
3
|
export declare const getFullKubernetesClusterName: (cluster: DeployConfigKubernetesCluster) => string | undefined;
|
|
4
4
|
export declare const getKubernetesNamespace: (config: Pick<Config, "customerName" | "appName">, env: string) => string;
|
|
5
|
-
export declare const contextIsStoppable: (context:
|
|
5
|
+
export declare const contextIsStoppable: (context: ComponentContext) => boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CreateComponentContextContext } from "../context";
|
|
2
2
|
import type { CatladderJobWithContext } from "../types/context";
|
|
3
|
-
export declare const createJobsForComponent: (contextContext: Omit<
|
|
3
|
+
export declare const createJobsForComponent: (contextContext: Omit<CreateComponentContextContext, "packageManagerInfo">) => Promise<Array<CatladderJobWithContext>>;
|
|
@@ -205,7 +205,7 @@ var createJobsForComponent = function (contextContext) {
|
|
|
205
205
|
return [4 /*yield*/, (0, packageManager_1.getPackageManagerInfo)(contextContext.config, contextContext.componentName)];
|
|
206
206
|
case 1:
|
|
207
207
|
packageManagerInfo = _a.sent();
|
|
208
|
-
return [4 /*yield*/, (0, context_1.
|
|
208
|
+
return [4 /*yield*/, (0, context_1.createComponentContext)(__assign(__assign({}, contextContext), {
|
|
209
209
|
packageManagerInfo: packageManagerInfo
|
|
210
210
|
}))];
|
|
211
211
|
case 2:
|
|
@@ -143,7 +143,7 @@ var createMainPipeline_1 = require("./createMainPipeline");
|
|
|
143
143
|
var getPipelineTriggerForGitlabChildPipeline_1 = require("./gitlab/getPipelineTriggerForGitlabChildPipeline");
|
|
144
144
|
function generatePipelineFiles(config, pipelineType, mode) {
|
|
145
145
|
return __awaiter(this, void 0, void 0, function () {
|
|
146
|
-
var trigger, _a, jobs, mainPipeline, _b, jobs, mainPipeline;
|
|
146
|
+
var trigger, _a, jobs, image, stages, variables, workflow, mainPipeline, _b, jobs, image, stages, variables, workflow, mainPipeline;
|
|
147
147
|
return __generator(this, function (_c) {
|
|
148
148
|
switch (_c.label) {
|
|
149
149
|
case 0:
|
|
@@ -151,9 +151,14 @@ function generatePipelineFiles(config, pipelineType, mode) {
|
|
|
151
151
|
trigger = (0, getPipelineTriggerForGitlabChildPipeline_1.getPipelineTriggerForGitlabChildPipeline)();
|
|
152
152
|
return [4 /*yield*/, (0, createChildPipeline_1.createChildPipeline)(pipelineType, trigger, config)];
|
|
153
153
|
case 1:
|
|
154
|
-
_a = _c.sent(), jobs = _a.jobs, mainPipeline = __rest(_a, ["jobs"]);
|
|
154
|
+
_a = _c.sent(), jobs = _a.jobs, image = _a.image, stages = _a.stages, variables = _a.variables, workflow = _a.workflow, mainPipeline = __rest(_a, ["jobs", "image", "stages", "variables", "workflow"]);
|
|
155
155
|
// need to spread out the jobs, forgot why
|
|
156
|
-
return [4 /*yield*/, (0, writeFiles_1.writeYamlfile)("__pipeline.yml", __assign(__assign({
|
|
156
|
+
return [4 /*yield*/, (0, writeFiles_1.writeYamlfile)("__pipeline.yml", __assign(__assign({
|
|
157
|
+
image: image,
|
|
158
|
+
stages: stages,
|
|
159
|
+
variables: variables,
|
|
160
|
+
workflow: workflow
|
|
161
|
+
}, mainPipeline), jobs))];
|
|
157
162
|
case 2:
|
|
158
163
|
// need to spread out the jobs, forgot why
|
|
159
164
|
_c.sent();
|
|
@@ -161,9 +166,14 @@ function generatePipelineFiles(config, pipelineType, mode) {
|
|
|
161
166
|
case 3:
|
|
162
167
|
return [4 /*yield*/, (0, createMainPipeline_1.createMainPipeline)(pipelineType, config)];
|
|
163
168
|
case 4:
|
|
164
|
-
_b = _c.sent(), jobs = _b.jobs, mainPipeline = __rest(_b, ["jobs"]);
|
|
169
|
+
_b = _c.sent(), jobs = _b.jobs, image = _b.image, stages = _b.stages, variables = _b.variables, workflow = _b.workflow, mainPipeline = __rest(_b, ["jobs", "image", "stages", "variables", "workflow"]);
|
|
165
170
|
// need to spread out the jobs, forgot why
|
|
166
|
-
return [4 /*yield*/, (0, writeFiles_1.writeYamlfile)(".gitlab-ci.yml", __assign(__assign({
|
|
171
|
+
return [4 /*yield*/, (0, writeFiles_1.writeYamlfile)(".gitlab-ci.yml", __assign(__assign({
|
|
172
|
+
image: image,
|
|
173
|
+
stages: stages,
|
|
174
|
+
variables: variables,
|
|
175
|
+
workflow: workflow
|
|
176
|
+
}, mainPipeline), jobs))];
|
|
167
177
|
case 5:
|
|
168
178
|
// need to spread out the jobs, forgot why
|
|
169
179
|
_c.sent();
|