@catladder/cli 1.153.0 → 1.154.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/bundles/catenv/index.js +3 -3
- package/dist/bundles/cli/index.js +6 -6
- package/dist/cli/src/apps/cli/commands/project/cloudSql/commandProjectRestoreDb.js +2 -2
- package/dist/cli/src/apps/cli/commands/project/cloudSql/commandProjectRestoreDb.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandCloudSqlProxy.js +2 -2
- package/dist/cli/src/apps/cli/commands/project/commandCloudSqlProxy.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/setupCloudRun.js +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/setupCloudRun.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/setupContext.js +2 -10
- package/dist/cli/src/apps/cli/commands/project/setup/setupContext.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/setupKubernetes.js +2 -2
- package/dist/cli/src/apps/cli/commands/project/setup/setupKubernetes.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/utils/ensureNamespace.js +2 -26
- package/dist/cli/src/apps/cli/commands/project/utils/ensureNamespace.js.map +1 -1
- package/dist/cli/src/gcloud/serviceAccounts.js +3 -3
- package/dist/cli/src/gcloud/serviceAccounts.js.map +1 -1
- package/dist/pipeline/src/build/artifacts/createBuildJobArtifact.d.ts +3 -0
- package/dist/pipeline/src/build/artifacts/createBuildJobArtifact.js +81 -0
- package/dist/pipeline/src/build/artifacts/createBuildJobArtifact.js.map +1 -0
- package/dist/pipeline/src/build/base/createAppBuildJob.d.ts +3 -3
- package/dist/pipeline/src/build/base/createAppBuildJob.js +14 -13
- package/dist/pipeline/src/build/base/createAppBuildJob.js.map +1 -1
- package/dist/pipeline/src/build/base/index.d.ts +6 -2
- package/dist/pipeline/src/build/base/index.js +23 -5
- package/dist/pipeline/src/build/base/index.js.map +1 -1
- package/dist/pipeline/src/build/base/writeDotEnv.js +3 -2
- package/dist/pipeline/src/build/base/writeDotEnv.js.map +1 -1
- package/dist/pipeline/src/build/custom/buildJob.js +2 -12
- package/dist/pipeline/src/build/custom/buildJob.js.map +1 -1
- package/dist/pipeline/src/build/docker.js +6 -6
- package/dist/pipeline/src/build/docker.js.map +1 -1
- package/dist/pipeline/src/build/index.d.ts +14 -5
- package/dist/pipeline/src/build/index.js +23 -3
- package/dist/pipeline/src/build/index.js.map +1 -1
- package/dist/pipeline/src/build/node/buildJob.d.ts +7 -2
- package/dist/pipeline/src/build/node/buildJob.js +44 -42
- package/dist/pipeline/src/build/node/buildJob.js.map +1 -1
- package/dist/pipeline/src/build/node/cache.d.ts +2 -2
- package/dist/pipeline/src/build/node/cache.js +17 -9
- package/dist/pipeline/src/build/node/cache.js.map +1 -1
- package/dist/pipeline/src/build/node/index.d.ts +2 -2
- package/dist/pipeline/src/build/node/index.js.map +1 -1
- package/dist/pipeline/src/build/node/meteor.js +2 -8
- package/dist/pipeline/src/build/node/meteor.js.map +1 -1
- package/dist/pipeline/src/build/node/testJob.d.ts +3 -2
- package/dist/pipeline/src/build/node/testJob.js +10 -3
- package/dist/pipeline/src/build/node/testJob.js.map +1 -1
- package/dist/pipeline/src/build/node/yarn.js +1 -1
- package/dist/pipeline/src/build/node/yarn.js.map +1 -1
- package/dist/pipeline/src/build/rails/build.d.ts +1 -1
- package/dist/pipeline/src/build/rails/build.js +7 -2
- package/dist/pipeline/src/build/rails/build.js.map +1 -1
- package/dist/pipeline/src/build/rails/test.d.ts +1 -1
- package/dist/pipeline/src/build/rails/test.js +5 -0
- package/dist/pipeline/src/build/rails/test.js.map +1 -1
- package/dist/pipeline/src/build/sbom.js +7 -2
- package/dist/pipeline/src/build/sbom.js.map +1 -1
- package/dist/pipeline/src/build/types.d.ts +49 -5
- package/dist/pipeline/src/build/types.js +9 -1
- package/dist/pipeline/src/build/types.js.map +1 -1
- package/dist/pipeline/src/context/createAllComponentsContext.d.ts +8 -0
- package/dist/pipeline/src/context/createAllComponentsContext.js +68 -0
- package/dist/pipeline/src/context/createAllComponentsContext.js.map +1 -0
- package/dist/pipeline/src/context/createComponentContext.d.ts +0 -4
- package/dist/pipeline/src/context/createComponentContext.js +81 -19
- package/dist/pipeline/src/context/createComponentContext.js.map +1 -1
- package/dist/pipeline/src/context/createWorkspaceContext.d.ts +9 -0
- package/dist/pipeline/src/context/createWorkspaceContext.js +86 -0
- package/dist/pipeline/src/context/createWorkspaceContext.js.map +1 -0
- package/dist/pipeline/src/context/getBuildInfoVariables.d.ts +1 -1
- package/dist/pipeline/src/context/getBuildInfoVariables.js.map +1 -1
- package/dist/pipeline/src/context/getEnvironmentContext.d.ts +1 -1
- package/dist/pipeline/src/context/getEnvironmentVariables.d.ts +1 -1
- package/dist/pipeline/src/context/getEnvironmentVariables.js +10 -6
- package/dist/pipeline/src/context/getEnvironmentVariables.js.map +1 -1
- package/dist/pipeline/src/context/getLabels.js +2 -2
- package/dist/pipeline/src/context/getLabels.js.map +1 -1
- package/dist/pipeline/src/deploy/base/deploy.d.ts +1 -1
- package/dist/pipeline/src/deploy/base/deploy.js +29 -6
- package/dist/pipeline/src/deploy/base/deploy.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/artifactsRegistry.js +3 -3
- package/dist/pipeline/src/deploy/cloudRun/artifactsRegistry.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/common.d.ts +4 -4
- package/dist/pipeline/src/deploy/cloudRun/createJobs/common.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/index.d.ts +2 -2
- package/dist/pipeline/src/deploy/cloudRun/index.js.map +1 -1
- package/dist/pipeline/src/deploy/custom/index.d.ts +2 -2
- package/dist/pipeline/src/deploy/custom/index.js.map +1 -1
- package/dist/pipeline/src/deploy/dockerTag/index.d.ts +2 -2
- package/dist/pipeline/src/deploy/dockerTag/index.js.map +1 -1
- package/dist/pipeline/src/deploy/index.d.ts +7 -7
- package/dist/pipeline/src/deploy/index.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/additionalSecretKeys.d.ts +3 -1
- package/dist/pipeline/src/deploy/kubernetes/additionalSecretKeys.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/cloudSql/index.js +1 -1
- package/dist/pipeline/src/deploy/kubernetes/cloudSql/index.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/deployJob.js +1 -1
- package/dist/pipeline/src/deploy/kubernetes/deployJob.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/index.d.ts +2 -2
- package/dist/pipeline/src/deploy/kubernetes/index.js.map +1 -1
- package/dist/pipeline/src/deploy/sbom.d.ts +1 -1
- package/dist/pipeline/src/deploy/sbom.js +6 -3
- package/dist/pipeline/src/deploy/sbom.js.map +1 -1
- package/dist/pipeline/src/pipeline/createAllJobs.d.ts +12 -10
- package/dist/pipeline/src/pipeline/createAllJobs.js +84 -44
- package/dist/pipeline/src/pipeline/createAllJobs.js.map +1 -1
- package/dist/pipeline/src/pipeline/createChildPipeline.js.map +1 -1
- package/dist/pipeline/src/pipeline/createJobsForComponent.js +3 -4
- package/dist/pipeline/src/pipeline/createJobsForComponent.js.map +1 -1
- package/dist/pipeline/src/pipeline/createJobsForWorkspace.d.ts +3 -0
- package/dist/pipeline/src/pipeline/createJobsForWorkspace.js +10 -0
- package/dist/pipeline/src/pipeline/createJobsForWorkspace.js.map +1 -0
- package/dist/pipeline/src/pipeline/createMainPipeline.js +18 -8
- package/dist/pipeline/src/pipeline/createMainPipeline.js.map +1 -1
- package/dist/pipeline/src/pipeline/gitlab/createGitlabJobs.d.ts +3 -3
- package/dist/pipeline/src/pipeline/gitlab/createGitlabJobs.js +158 -51
- package/dist/pipeline/src/pipeline/gitlab/createGitlabJobs.js.map +1 -1
- package/dist/pipeline/src/pipeline/packageManager.d.ts +2 -1
- package/dist/pipeline/src/pipeline/packageManager.js +36 -15
- package/dist/pipeline/src/pipeline/packageManager.js.map +1 -1
- package/dist/pipeline/src/types/config.d.ts +2 -1
- package/dist/pipeline/src/types/context.d.ts +80 -12
- package/dist/pipeline/src/types/context.js +9 -0
- package/dist/pipeline/src/types/context.js.map +1 -1
- package/dist/pipeline/src/types/environmentContext.d.ts +5 -6
- package/dist/pipeline/src/types/jobs.d.ts +5 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/apps/cli/commands/project/cloudSql/commandProjectRestoreDb.ts +4 -4
- package/src/apps/cli/commands/project/commandCloudSqlProxy.ts +2 -10
- package/src/apps/cli/commands/project/setup/setupCloudRun.ts +2 -2
- package/src/apps/cli/commands/project/setup/setupContext.ts +2 -14
- package/src/apps/cli/commands/project/setup/setupKubernetes.ts +3 -3
- package/src/apps/cli/commands/project/utils/ensureNamespace.ts +3 -16
- package/src/gcloud/serviceAccounts.ts +4 -4
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { StringOrBashExpression } from "../bash/BashExpression";
|
|
2
|
-
import type {
|
|
2
|
+
import type { BuildConfigFromWorkspace, BuildConfigStandalone, WorkspaceBuildConfig } from "../build";
|
|
3
3
|
import type { PredefinedVariables, SecretEnvVar } from "../context";
|
|
4
4
|
import type { DeployConfig } from "../deploy";
|
|
5
|
-
import type {
|
|
6
|
-
import type { CatladderJob } from "./jobs";
|
|
5
|
+
import type { ComponentConfig, Config, EnvType, PipelineTrigger } from "./config";
|
|
6
|
+
import type { BaseStage, CatladderJob } from "./jobs";
|
|
7
7
|
import type { PipelineType } from "./pipeline";
|
|
8
8
|
export type UnspecifiedEnvVars = Record<string, StringOrBashExpression | undefined | null>;
|
|
9
9
|
export type EnvironmentEnvVars<V extends UnspecifiedEnvVars = UnspecifiedEnvVars> = {
|
|
@@ -28,6 +28,9 @@ export type Environment = {
|
|
|
28
28
|
* the full name of the app. We use this as RELEASE_NAME in kubernetes and the service name in google cloud run
|
|
29
29
|
*/
|
|
30
30
|
fullName: StringOrBashExpression;
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated this is the same as context.env, use that instead
|
|
33
|
+
*/
|
|
31
34
|
shortName: string;
|
|
32
35
|
/**
|
|
33
36
|
* the environment slug without component name.
|
|
@@ -49,33 +52,78 @@ export type YarnWorkspace = {
|
|
|
49
52
|
workspaceDependencies: string[];
|
|
50
53
|
mismatchedWorkspaceDependencies: string[];
|
|
51
54
|
};
|
|
52
|
-
export type
|
|
55
|
+
export type YarnPackageManagerInfoBase = {
|
|
53
56
|
type: "yarn";
|
|
54
57
|
version: string;
|
|
55
58
|
workspaces: YarnWorkspace[];
|
|
56
|
-
currentWorkspace?: YarnWorkspace;
|
|
57
59
|
isClassic: boolean;
|
|
60
|
+
};
|
|
61
|
+
export type YarnPackageManagerInfoComponent = YarnPackageManagerInfoBase & {
|
|
62
|
+
currentWorkspace?: YarnWorkspace;
|
|
58
63
|
componentIsInWorkspace: boolean;
|
|
59
64
|
pathsToCopyInDocker: string[];
|
|
60
65
|
currentWorkspaceDependencies: string[];
|
|
61
66
|
};
|
|
62
67
|
export type PackageManagerInfoComponent = YarnPackageManagerInfoComponent;
|
|
68
|
+
/**
|
|
69
|
+
* not confuse with yarn workspaces
|
|
70
|
+
*/
|
|
71
|
+
export type PackageManagerInfoBase = YarnPackageManagerInfoBase;
|
|
63
72
|
export type ContextBeforeConfig = {
|
|
64
73
|
componentName: string;
|
|
65
74
|
fullConfig: Config;
|
|
66
75
|
packageManagerInfo?: PackageManagerInfoComponent;
|
|
67
76
|
};
|
|
68
|
-
export type
|
|
77
|
+
export type BuildContextBase = {
|
|
78
|
+
/**
|
|
79
|
+
* the directory where the component or workspace is located
|
|
80
|
+
*/
|
|
69
81
|
dir: string;
|
|
70
|
-
|
|
82
|
+
/**
|
|
83
|
+
* directories of all components that are part of the build.
|
|
84
|
+
* In case of a standalone build, this is just the dir of the component + yarn workspace dependencies (if mode = all)
|
|
85
|
+
*
|
|
86
|
+
* in case of a workspace this contains all components in the workspace (+ yarn workspace dependencies if mode = all)
|
|
87
|
+
*/
|
|
88
|
+
getComponentDirs: (mode: "direct" | "all") => string[];
|
|
89
|
+
};
|
|
90
|
+
export type BuildContextComponentBase = BuildContextBase;
|
|
91
|
+
export type BuildContextStandalone<C extends BuildConfigStandalone = BuildConfigStandalone> = BuildContextComponentBase & {
|
|
92
|
+
config: C;
|
|
93
|
+
type: "standalone";
|
|
94
|
+
buildType: C["type"];
|
|
95
|
+
};
|
|
96
|
+
export type BuildContextFromWorkspace = BuildContextComponentBase & {
|
|
97
|
+
config: BuildConfigFromWorkspace;
|
|
98
|
+
workspaceName: string;
|
|
99
|
+
buildType: WorkspaceBuildConfig["type"];
|
|
100
|
+
/**
|
|
101
|
+
* merged docker config
|
|
102
|
+
*/
|
|
103
|
+
workspaceBuildConfig: WorkspaceBuildConfig;
|
|
104
|
+
type: "fromWorkspace";
|
|
105
|
+
};
|
|
106
|
+
export type BuildContextWorkspace = BuildContextBase & {
|
|
107
|
+
type: "workspace";
|
|
108
|
+
buildType: WorkspaceBuildConfig["type"];
|
|
109
|
+
config: WorkspaceBuildConfig;
|
|
71
110
|
};
|
|
72
|
-
export type
|
|
111
|
+
export type BuildContextComponent = BuildContextStandalone | BuildContextFromWorkspace;
|
|
112
|
+
export type BuildContext = BuildContextComponent | BuildContextWorkspace;
|
|
73
113
|
export type DeployContext = {
|
|
74
114
|
config: DeployConfig;
|
|
75
115
|
};
|
|
76
|
-
export type ComponentContext = {
|
|
77
|
-
|
|
116
|
+
export type ComponentContext<BC extends BuildContextComponent = BuildContextComponent> = {
|
|
117
|
+
type: "component";
|
|
78
118
|
env: string;
|
|
119
|
+
/**
|
|
120
|
+
* the name of the component
|
|
121
|
+
*/
|
|
122
|
+
name: string;
|
|
123
|
+
/**
|
|
124
|
+
* @deprecated use name instead
|
|
125
|
+
*/
|
|
126
|
+
componentName: string;
|
|
79
127
|
/**
|
|
80
128
|
* the merged component config.
|
|
81
129
|
*
|
|
@@ -83,7 +131,7 @@ export type ComponentContext = {
|
|
|
83
131
|
*
|
|
84
132
|
*/
|
|
85
133
|
componentConfig: ComponentConfig;
|
|
86
|
-
build:
|
|
134
|
+
build: BC;
|
|
87
135
|
deploy?: DeployContext | null;
|
|
88
136
|
fullConfig: Config;
|
|
89
137
|
environment: Environment;
|
|
@@ -92,4 +140,24 @@ export type ComponentContext = {
|
|
|
92
140
|
packageManagerInfo: PackageManagerInfoComponent;
|
|
93
141
|
customJobs?: CatladderJob[];
|
|
94
142
|
};
|
|
95
|
-
export type Context = ComponentContext;
|
|
143
|
+
export type Context = ComponentContext | WorkspaceContext;
|
|
144
|
+
export type CatladderJobWithContext<S = BaseStage> = CatladderJob<S> & {
|
|
145
|
+
context: ComponentContext;
|
|
146
|
+
};
|
|
147
|
+
export declare const componentContextIsStandaloneBuild: (context: ComponentContext<BuildContextComponent>) => context is ComponentContext<BuildContextStandalone<BuildConfigStandalone>>;
|
|
148
|
+
export declare const componentContextHasWorkspaceBuild: (context: ComponentContext<BuildContextComponent>) => context is ComponentContext<BuildContextFromWorkspace>;
|
|
149
|
+
export type WorkspaceContext = {
|
|
150
|
+
type: "workspace";
|
|
151
|
+
/**
|
|
152
|
+
* the name of the workspace
|
|
153
|
+
*/
|
|
154
|
+
name: string;
|
|
155
|
+
fullConfig: Config;
|
|
156
|
+
workspaceConfig: WorkspaceBuildConfig;
|
|
157
|
+
packageManagerInfo: PackageManagerInfoBase;
|
|
158
|
+
components: Array<ComponentContext>;
|
|
159
|
+
build: BuildContextWorkspace;
|
|
160
|
+
trigger: PipelineTrigger;
|
|
161
|
+
pipelineType: PipelineType;
|
|
162
|
+
env: string;
|
|
163
|
+
};
|
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.componentContextHasWorkspaceBuild = exports.componentContextIsStandaloneBuild = void 0;
|
|
4
|
+
var componentContextIsStandaloneBuild = function (context) {
|
|
5
|
+
return context.build.type === "standalone";
|
|
6
|
+
};
|
|
7
|
+
exports.componentContextIsStandaloneBuild = componentContextIsStandaloneBuild;
|
|
8
|
+
var componentContextHasWorkspaceBuild = function (context) {
|
|
9
|
+
return context.build.type === "fromWorkspace";
|
|
10
|
+
};
|
|
11
|
+
exports.componentContextHasWorkspaceBuild = componentContextHasWorkspaceBuild;
|
|
3
12
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../../pipeline/src/types/context.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../../pipeline/src/types/context.ts"],"names":[],"mappings":";;;AA+LO,IAAM,iCAAiC,GAAG,UAC/C,OAAgD;IAEhD,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,YAAY,CAAC;AAC7C,CAAC,CAAC;AAJW,QAAA,iCAAiC,qCAI5C;AAEK,IAAM,iCAAiC,GAAG,UAC/C,OAAgD;IAEhD,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,eAAe,CAAC;AAChD,CAAC,CAAC;AAJW,QAAA,iCAAiC,qCAI5C"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import type { StringOrBashExpression } from "../bash/BashExpression";
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type { DeployConfigType } from "../deploy";
|
|
2
|
+
import type { BuildConfig } from "../build";
|
|
3
|
+
import type { DeployConfig } from "../deploy";
|
|
5
4
|
import type { Config, EnvConfigWithComponent, EnvType } from "./config";
|
|
6
5
|
import type { PipelineType } from "./pipeline";
|
|
7
|
-
export type EnvironmentContext<B extends
|
|
6
|
+
export type EnvironmentContext<B extends BuildConfig = BuildConfig, D extends DeployConfig = DeployConfig> = {
|
|
8
7
|
envConfigRaw: EnvConfigWithComponent;
|
|
9
|
-
buildConfigRaw: false |
|
|
10
|
-
deployConfigRaw: false |
|
|
8
|
+
buildConfigRaw: false | B;
|
|
9
|
+
deployConfigRaw: false | D;
|
|
11
10
|
env: string;
|
|
12
11
|
envType: EnvType;
|
|
13
12
|
componentName: string;
|
|
@@ -6,6 +6,10 @@ export type CatladderJobNeed = string | {
|
|
|
6
6
|
job: string;
|
|
7
7
|
artifacts: boolean;
|
|
8
8
|
componentName?: string;
|
|
9
|
+
} | {
|
|
10
|
+
job: string;
|
|
11
|
+
artifacts: boolean;
|
|
12
|
+
workspaceName: string;
|
|
9
13
|
};
|
|
10
14
|
export type CatladderJobEnvironmentConfig = {
|
|
11
15
|
action?: GitlabEnvironment["action"];
|
|
@@ -38,6 +42,7 @@ export type CatladderJob<S = BaseStage> = {
|
|
|
38
42
|
needsStages?: {
|
|
39
43
|
stage: S;
|
|
40
44
|
artifacts?: boolean;
|
|
45
|
+
workspaceName?: string;
|
|
41
46
|
}[];
|
|
42
47
|
/**
|
|
43
48
|
* does this require another job (from the same component)?
|