@catladder/pipeline 0.0.0-node16-ddfae617 → 0.0.0-refactor-env-context-9e652b63
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/bin/catladder-gitlab.js +1 -1
- package/dist/build/base/createBuildJob.d.ts +2 -2
- package/dist/build/base/getBuildInfo.d.ts +1 -1
- package/dist/build/docker.d.ts +44 -6
- package/dist/build/docker.js +45 -19
- package/dist/build/index.d.ts +6 -5
- package/dist/build/node/buildJob.d.ts +2 -2
- package/dist/build/node/cache.d.ts +2 -2
- package/dist/build/node/index.d.ts +1 -1
- package/dist/build/node/meteor.d.ts +1 -1
- package/dist/build/node/meteor.js +6 -0
- package/dist/build/node/testJob.d.ts +2 -2
- package/dist/build/node/testJob.js +3 -0
- package/dist/build/node/yarn.d.ts +1 -1
- package/dist/build/node/yarn.js +13 -1
- package/dist/build/types.d.ts +10 -0
- package/dist/bundles/catladder-gitlab/index.js +32457 -0
- package/dist/catladder-gitlab.js +1 -2
- package/dist/config/configruedEnvs.d.ts +1 -1
- package/dist/config/readConfig.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/context/getEnvConfig.d.ts +9 -0
- package/dist/context/getEnvConfig.js +26 -0
- package/dist/context/getEnvType.d.ts +4 -0
- package/dist/context/getEnvType.js +18 -0
- package/dist/context/getEnvironment.d.ts +3 -0
- package/dist/context/getEnvironment.js +187 -0
- package/dist/context/getEnvironmentContext.d.ts +4 -0
- package/dist/context/getEnvironmentContext.js +36 -0
- package/dist/context/getEnvironmentVariables.d.ts +10 -0
- package/dist/context/getEnvironmentVariables.js +322 -0
- package/dist/context/getLabels.d.ts +8 -0
- package/dist/context/getLabels.js +49 -0
- package/dist/context/index.d.ts +5 -6
- package/dist/context/index.js +176 -181
- package/dist/context/resolveReferences.d.ts +1 -3
- package/dist/context/resolveReferences.js +275 -26
- package/dist/context/resolveReferences.test.js +332 -81
- package/dist/defaults/index.d.ts +1 -1
- package/dist/deploy/base.d.ts +4 -2
- package/dist/deploy/base.js +37 -17
- package/dist/deploy/cloudRun/deployJob.d.ts +3 -0
- package/dist/deploy/cloudRun/deployJob.js +139 -0
- package/dist/deploy/cloudRun/index.d.ts +9 -0
- package/dist/deploy/cloudRun/index.js +56 -0
- package/dist/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.d.ts +2 -0
- package/dist/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.js +14 -0
- package/dist/deploy/cloudSql/index.d.ts +8 -0
- package/dist/deploy/cloudSql/index.js +30 -0
- package/dist/deploy/custom/deployJob.d.ts +2 -2
- package/dist/deploy/custom/deployJob.js +4 -1
- package/dist/deploy/custom/index.d.ts +2 -1
- package/dist/deploy/custom/index.js +15 -18
- package/dist/deploy/dockerTag/deployJob.d.ts +3 -0
- package/dist/deploy/dockerTag/deployJob.js +33 -0
- package/dist/deploy/dockerTag/index.d.ts +2 -0
- package/dist/deploy/dockerTag/index.js +19 -0
- package/dist/deploy/index.d.ts +12 -8
- package/dist/deploy/index.js +27 -14
- package/dist/deploy/kubernetes/additionalSecretKeys.d.ts +4 -0
- package/dist/deploy/kubernetes/additionalSecretKeys.js +33 -0
- package/dist/deploy/kubernetes/cloudsql.d.ts +1 -1
- package/dist/deploy/kubernetes/deployJob.d.ts +2 -2
- package/dist/deploy/kubernetes/deployJob.js +13 -66
- package/dist/deploy/kubernetes/index.d.ts +2 -1
- package/dist/deploy/kubernetes/index.js +45 -16
- package/dist/deploy/kubernetes/kubeEnv.d.ts +10 -0
- package/dist/deploy/kubernetes/kubeEnv.js +90 -0
- package/dist/deploy/kubernetes/kubeValues.d.ts +90 -0
- package/dist/deploy/kubernetes/kubeValues.js +96 -0
- package/dist/deploy/kubernetes/mongodb.d.ts +18 -5
- package/dist/deploy/kubernetes/mongodb.js +118 -8
- package/dist/deploy/kubernetes/processSecretsAsFiles.d.ts +21 -21
- package/dist/deploy/types/base.d.ts +15 -0
- package/dist/deploy/types/base.js +3 -0
- package/dist/deploy/types/custom.d.ts +27 -0
- package/dist/deploy/types/custom.js +3 -0
- package/dist/deploy/types/dockerTag.d.ts +10 -0
- package/dist/deploy/types/dockerTag.js +3 -0
- package/dist/deploy/types/googleCloudRun.d.ts +39 -0
- package/dist/deploy/types/googleCloudRun.js +3 -0
- package/dist/deploy/types/index.d.ts +24 -0
- package/dist/deploy/types/index.js +41 -0
- package/dist/deploy/{types.d.ts → types/kubernetes.d.ts} +128 -36
- package/dist/deploy/types/kubernetes.js +3 -0
- package/dist/deploy/utils.d.ts +2 -2
- package/dist/deploy/utils.js +4 -0
- package/dist/pipeline/createChildPipeline.d.ts +2 -2
- package/dist/pipeline/createChildPipeline.js +3 -3
- package/dist/pipeline/createJobs.d.ts +2 -2
- package/dist/pipeline/createJobs.js +63 -25
- package/dist/pipeline/gitlab/makeGitlabJob.d.ts +3 -2
- package/dist/pipeline/gitlab/makeGitlabJob.js +2 -1
- package/dist/pipeline/packageManager.d.ts +1 -1
- package/dist/rules/index.d.ts +1 -1
- package/dist/runner/index.d.ts +2 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/config.d.ts +7 -6
- package/dist/types/config.js +1 -1
- package/dist/types/context.d.ts +10 -2
- package/dist/types/environmentContext.d.ts +22 -0
- package/dist/types/environmentContext.js +3 -0
- package/dist/types/gitlab-types.d.ts +1 -1
- package/dist/types/jobs.d.ts +8 -3
- package/dist/types/jobs.js +1 -1
- package/dist/types/pipeline.d.ts +1 -1
- package/package.json +15 -11
- package/scripts/bundle +2 -0
- package/src/build/base/createBuildJob.ts +3 -2
- package/src/build/base/getBuildInfo.ts +1 -1
- package/src/build/docker.ts +47 -29
- package/src/build/index.ts +8 -5
- package/src/build/node/buildJob.ts +2 -2
- package/src/build/node/cache.ts +2 -2
- package/src/build/node/index.ts +1 -1
- package/src/build/node/meteor.ts +8 -2
- package/src/build/node/testJob.ts +4 -2
- package/src/build/node/yarn.ts +21 -10
- package/src/build/tests/storybook.test.ts +1 -1
- package/src/build/types.ts +13 -1
- package/src/catladder-gitlab.ts +4 -2
- package/src/config/configruedEnvs.test.ts +2 -2
- package/src/config/configruedEnvs.ts +5 -4
- package/src/config/readConfig.ts +1 -1
- package/src/context/getEnvConfig.ts +21 -0
- package/src/context/getEnvType.ts +17 -0
- package/src/context/getEnvironment.ts +40 -0
- package/src/context/getEnvironmentContext.ts +57 -0
- package/src/context/getEnvironmentVariables.ts +152 -0
- package/src/context/getLabels.ts +20 -0
- package/src/context/index.ts +25 -191
- package/src/context/resolveReferences.test.ts +15 -15
- package/src/context/resolveReferences.ts +37 -30
- package/src/defaults/index.ts +1 -1
- package/src/deploy/base.ts +43 -19
- package/src/deploy/cloudRun/deployJob.ts +104 -0
- package/src/deploy/cloudRun/index.ts +48 -0
- package/src/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.ts +14 -0
- package/src/deploy/cloudSql/index.ts +16 -0
- package/src/deploy/custom/deployJob.ts +10 -3
- package/src/deploy/custom/index.ts +9 -1
- package/src/deploy/dockerTag/deployJob.ts +31 -0
- package/src/deploy/dockerTag/index.ts +9 -0
- package/src/deploy/index.ts +26 -17
- package/src/deploy/kubernetes/additionalSecretKeys.ts +23 -0
- package/src/deploy/kubernetes/cloudsql.ts +2 -1
- package/src/deploy/kubernetes/deployJob.ts +19 -77
- package/src/deploy/kubernetes/index.ts +42 -1
- package/src/deploy/kubernetes/kubeEnv.ts +48 -0
- package/src/deploy/kubernetes/kubeValues.ts +82 -0
- package/src/deploy/kubernetes/mongodb.ts +104 -7
- package/src/deploy/kubernetes/processSecretsAsFiles.ts +1 -1
- package/src/deploy/types/base.ts +17 -0
- package/src/deploy/types/custom.ts +24 -0
- package/src/deploy/types/dockerTag.ts +12 -0
- package/src/deploy/types/googleCloudRun.ts +79 -0
- package/src/deploy/types/index.ts +28 -0
- package/src/deploy/types/kubernetes.ts +281 -0
- package/src/deploy/utils.ts +6 -2
- package/src/pipeline/createChildPipeline.test.ts +1 -1
- package/src/pipeline/createChildPipeline.ts +4 -4
- package/src/pipeline/createJobs.ts +32 -21
- package/src/pipeline/gitlab/makeGitlabJob.ts +3 -2
- package/src/pipeline/packageManager.ts +1 -1
- package/src/rules/index.ts +1 -1
- package/src/runner/index.ts +2 -1
- package/src/types/config.ts +8 -6
- package/src/types/context.ts +14 -2
- package/src/types/environmentContext.ts +26 -0
- package/src/types/gitlab-types.ts +1 -1
- package/src/types/jobs.ts +9 -2
- package/src/types/pipeline.ts +1 -1
- package/tsconfig.json +2 -0
- package/dist/deploy/types.js +0 -16
- package/src/deploy/types.ts +0 -189
package/src/types/context.ts
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
|
+
PipelineTrigger,
|
|
3
|
+
ComponentConfig,
|
|
4
|
+
Config,
|
|
5
|
+
EnvType,
|
|
6
|
+
} from "./config";
|
|
2
7
|
|
|
3
8
|
export type Environment = {
|
|
4
9
|
host: string;
|
|
10
|
+
url: string;
|
|
11
|
+
/**
|
|
12
|
+
* the full name of the app. We use this as RELEASE_NAME in kubernetes and the service name in google cloud run
|
|
13
|
+
*/
|
|
5
14
|
fullName: string;
|
|
15
|
+
gitlabEnvironment: {
|
|
16
|
+
name: string;
|
|
17
|
+
url: string;
|
|
18
|
+
};
|
|
6
19
|
shortName: string;
|
|
7
20
|
slug: string;
|
|
8
|
-
url: string;
|
|
9
21
|
/**
|
|
10
22
|
* env vars contain all build-time env vars. secrets have to be resolved (they are stored in gitlab)
|
|
11
23
|
*/
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { BuildConfigGeneric, BuildConfigType } from "../build";
|
|
2
|
+
import type { DeployConfigGeneric } from "../deploy";
|
|
3
|
+
import type { DeployConfigType } from "../deploy";
|
|
4
|
+
import type { Config, EnvConfigWithComponent, EnvType } from "./config";
|
|
5
|
+
import type { CommitInfo } from "./context";
|
|
6
|
+
|
|
7
|
+
export type EnvironmentContext<
|
|
8
|
+
B extends BuildConfigType,
|
|
9
|
+
D extends DeployConfigType
|
|
10
|
+
> = {
|
|
11
|
+
envConfigRaw: EnvConfigWithComponent;
|
|
12
|
+
buildConfigRaw: false | BuildConfigGeneric<B>;
|
|
13
|
+
deployConfigRaw: false | DeployConfigGeneric<D>;
|
|
14
|
+
commitInfo?: CommitInfo;
|
|
15
|
+
env: string;
|
|
16
|
+
envType: EnvType;
|
|
17
|
+
componentName: string;
|
|
18
|
+
fullName: string;
|
|
19
|
+
environmentSlug: string;
|
|
20
|
+
gitlabEnvironmentName: string;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* the full catladder config
|
|
24
|
+
*/
|
|
25
|
+
fullConfig: Config;
|
|
26
|
+
};
|
|
@@ -27,7 +27,7 @@ export type GitlabEnvironment = {
|
|
|
27
27
|
kubernetes?: {
|
|
28
28
|
namespace?: string;
|
|
29
29
|
};
|
|
30
|
-
action?: "stop" | "start" | "prepare"; // defaults to start
|
|
30
|
+
action?: "stop" | "start" | "prepare" | "access"; // defaults to start
|
|
31
31
|
on_stop?: string; // other job to run on stop
|
|
32
32
|
auto_stop_in?: string;
|
|
33
33
|
};
|
package/src/types/jobs.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
Artifacts,
|
|
3
3
|
GitlabEnvironment,
|
|
4
4
|
GitlabJobCache,
|
|
@@ -13,6 +13,7 @@ export const BASE_STAGES = [
|
|
|
13
13
|
"build",
|
|
14
14
|
"deploy",
|
|
15
15
|
"verify",
|
|
16
|
+
"rollback",
|
|
16
17
|
"stop",
|
|
17
18
|
] as const;
|
|
18
19
|
export type BaseStage = typeof BASE_STAGES[number];
|
|
@@ -49,9 +50,15 @@ export type CatladderJob<S = BaseStage> = {
|
|
|
49
50
|
}[];
|
|
50
51
|
|
|
51
52
|
/**
|
|
52
|
-
* does this require another job?
|
|
53
|
+
* does this require another job (from the same component)?
|
|
53
54
|
*/
|
|
54
55
|
needs?: Array<string | { job: string; artifacts: boolean }>;
|
|
56
|
+
|
|
57
|
+
needsOtherComponent?: Array<{
|
|
58
|
+
componentName: string;
|
|
59
|
+
job: string;
|
|
60
|
+
artifacts: boolean;
|
|
61
|
+
}>;
|
|
55
62
|
/**
|
|
56
63
|
* cache config, we use here the same shape as gitlab itself
|
|
57
64
|
*/
|
package/src/types/pipeline.ts
CHANGED
package/tsconfig.json
CHANGED
package/dist/deploy/types.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.isOfDeployType = void 0;
|
|
5
|
-
|
|
6
|
-
var isOfDeployType = function (t) {
|
|
7
|
-
var types = [];
|
|
8
|
-
|
|
9
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
10
|
-
types[_i - 1] = arguments[_i];
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
return t && types.includes(t.type);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
exports.isOfDeployType = isOfDeployType;
|
package/src/deploy/types.ts
DELETED
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
2
|
-
export type DeployConfigBase = {
|
|
3
|
-
/**
|
|
4
|
-
* whether to deploy automatically or manual. If not defined, these rules apply:
|
|
5
|
-
* - prod: manual
|
|
6
|
-
* - all other envs: auto
|
|
7
|
-
*/
|
|
8
|
-
when?: "manual" | "auto";
|
|
9
|
-
};
|
|
10
|
-
type AllowUnknownProps<T extends Record<string, unknown>> = T &
|
|
11
|
-
Record<string, unknown>;
|
|
12
|
-
|
|
13
|
-
export type DeployConfigKubernetesClusterGCloud = {
|
|
14
|
-
type: "gcloud";
|
|
15
|
-
/**
|
|
16
|
-
* gcoud name of the cluster
|
|
17
|
-
*/
|
|
18
|
-
name: string;
|
|
19
|
-
/**
|
|
20
|
-
* google cloud project id
|
|
21
|
-
*/
|
|
22
|
-
projectId: string;
|
|
23
|
-
/**
|
|
24
|
-
* region
|
|
25
|
-
*/
|
|
26
|
-
region: string;
|
|
27
|
-
/**
|
|
28
|
-
* domain of the cluster, for canonical domains without custom host (e.g. review and dev apps)
|
|
29
|
-
*/
|
|
30
|
-
domainCanonical?: string;
|
|
31
|
-
};
|
|
32
|
-
export type DeployConfigKubernetesCluster = DeployConfigKubernetesClusterGCloud; // currently only this
|
|
33
|
-
|
|
34
|
-
export type KubernetesAutoscaleMetricResourceTarget =
|
|
35
|
-
| {
|
|
36
|
-
type: "Utilization";
|
|
37
|
-
averageUtilization: number;
|
|
38
|
-
}
|
|
39
|
-
| {
|
|
40
|
-
type: "AverageValue";
|
|
41
|
-
averageValue: number | string;
|
|
42
|
-
};
|
|
43
|
-
export type KubernetesAutoscaleMetric = {
|
|
44
|
-
type: "Resource";
|
|
45
|
-
resource: {
|
|
46
|
-
name: "cpu" | "memory";
|
|
47
|
-
target: KubernetesAutoscaleMetricResourceTarget;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
export type KubernetesAutoscale = {
|
|
51
|
-
minReplicas: number;
|
|
52
|
-
maxReplicas: number;
|
|
53
|
-
/**
|
|
54
|
-
* declare a number of metrics (at least one). Usually you would use cpu as a metric
|
|
55
|
-
*/
|
|
56
|
-
metrics: KubernetesAutoscaleMetric[];
|
|
57
|
-
};
|
|
58
|
-
type KubernetesHealthDef = {
|
|
59
|
-
httpGet?: {
|
|
60
|
-
path?: string;
|
|
61
|
-
port?: number;
|
|
62
|
-
httpHeaders?: {
|
|
63
|
-
name: string;
|
|
64
|
-
value: string;
|
|
65
|
-
}[];
|
|
66
|
-
failureThreshold?: number;
|
|
67
|
-
timeoutSeconds?: number;
|
|
68
|
-
periodSeconds?: number;
|
|
69
|
-
successThreshold?: number;
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
export type DeployConfigKubernetesValues = AllowUnknownProps<{
|
|
73
|
-
/**
|
|
74
|
-
* enable cloudsql db. Currently you have to manually set it up
|
|
75
|
-
*/
|
|
76
|
-
cloudsql?: {
|
|
77
|
-
enabled: boolean;
|
|
78
|
-
instanceId?: string;
|
|
79
|
-
projectId?: string;
|
|
80
|
-
region?: string;
|
|
81
|
-
};
|
|
82
|
-
/**
|
|
83
|
-
* enable mongodb. The mongodb is deployed using a helm chart.
|
|
84
|
-
* Consider using external services instead of this.
|
|
85
|
-
*/
|
|
86
|
-
mongodb?: AllowUnknownProps<{
|
|
87
|
-
enabled: boolean;
|
|
88
|
-
}>;
|
|
89
|
-
/**
|
|
90
|
-
* enable mailhog. Mailhog is a virtual mail server that catches all outgoing mailsl and show them in a mailbox.
|
|
91
|
-
* This is great for development as it prevents to accidentially send out real emails and helps with debugging outgoing mails.
|
|
92
|
-
*
|
|
93
|
-
* It will automaticaly inject a MAIL_URL env var.
|
|
94
|
-
*
|
|
95
|
-
* Turn it of for production.
|
|
96
|
-
*/
|
|
97
|
-
mailhog?: {
|
|
98
|
-
enabled: boolean;
|
|
99
|
-
};
|
|
100
|
-
/**
|
|
101
|
-
* post-install/upgrade jobs. These use the app image and have all env vars available.
|
|
102
|
-
* Typically used for migrations and seeds
|
|
103
|
-
*/
|
|
104
|
-
jobs?: Record<string, AllowUnknownProps<{ command: string }>>;
|
|
105
|
-
/**
|
|
106
|
-
* cronjobs that run periodically. These use the app image have all env vars available.
|
|
107
|
-
*/
|
|
108
|
-
cronjobs?: Record<
|
|
109
|
-
string,
|
|
110
|
-
AllowUnknownProps<{
|
|
111
|
-
schedule: string;
|
|
112
|
-
command: string;
|
|
113
|
-
concurrencyPolicy?: "Forbid" | "Allow" | "Replace";
|
|
114
|
-
}>
|
|
115
|
-
>;
|
|
116
|
-
/**
|
|
117
|
-
* configuration for the application ("Deployment" in kubernetes)
|
|
118
|
-
*/
|
|
119
|
-
application?: AllowUnknownProps<{
|
|
120
|
-
/**
|
|
121
|
-
* redirects
|
|
122
|
-
*/
|
|
123
|
-
redirects?: AllowUnknownProps<{ host: string }>[];
|
|
124
|
-
/**
|
|
125
|
-
* how many pods will be started
|
|
126
|
-
*/
|
|
127
|
-
replicas?: number;
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* autoscale the pods horizontally
|
|
131
|
-
*/
|
|
132
|
-
autoscale?: KubernetesAutoscale;
|
|
133
|
-
/**
|
|
134
|
-
* kubernetes resources
|
|
135
|
-
*/
|
|
136
|
-
resources?: {
|
|
137
|
-
limits?: {
|
|
138
|
-
cpu?: string;
|
|
139
|
-
memory?: string;
|
|
140
|
-
};
|
|
141
|
-
requests?: {
|
|
142
|
-
cpu?: string;
|
|
143
|
-
memory?: string;
|
|
144
|
-
};
|
|
145
|
-
};
|
|
146
|
-
healthRoute?: string;
|
|
147
|
-
startupProbe?: KubernetesHealthDef;
|
|
148
|
-
readinessProbe?: KubernetesHealthDef;
|
|
149
|
-
livenessProbe?: KubernetesHealthDef;
|
|
150
|
-
}>;
|
|
151
|
-
/**
|
|
152
|
-
* Mount secrets as files in the filesystem.
|
|
153
|
-
* These secrets are still available as env vars, but will contain the path of the file instead
|
|
154
|
-
*/
|
|
155
|
-
secretsAsFile?: string[];
|
|
156
|
-
}>;
|
|
157
|
-
|
|
158
|
-
export type DeployConfigKubernetes = {
|
|
159
|
-
type: "kubernetes";
|
|
160
|
-
/**
|
|
161
|
-
* cluster config to use.
|
|
162
|
-
*/
|
|
163
|
-
cluster: DeployConfigKubernetesCluster;
|
|
164
|
-
/**
|
|
165
|
-
* prints out debug info (helm --debug)
|
|
166
|
-
*/
|
|
167
|
-
debug?: boolean;
|
|
168
|
-
additionalHelmArgs?: string[];
|
|
169
|
-
/**
|
|
170
|
-
* values to configure the app
|
|
171
|
-
*/
|
|
172
|
-
values?: DeployConfigKubernetesValues;
|
|
173
|
-
} & DeployConfigBase;
|
|
174
|
-
|
|
175
|
-
type DeployConfigCustom = {
|
|
176
|
-
type: "custom";
|
|
177
|
-
requiresDocker: boolean;
|
|
178
|
-
script: string[];
|
|
179
|
-
stopScript?: string[];
|
|
180
|
-
} & DeployConfigBase;
|
|
181
|
-
|
|
182
|
-
export type DeployConfig = DeployConfigKubernetes | DeployConfigCustom;
|
|
183
|
-
|
|
184
|
-
export const isOfDeployType = <T extends Array<DeployConfig["type"]>>(
|
|
185
|
-
t: DeployConfig | false,
|
|
186
|
-
...types: T
|
|
187
|
-
): t is Extract<DeployConfig, { type: T[number] }> => {
|
|
188
|
-
return t && types.includes(t.type);
|
|
189
|
-
};
|