@catladder/pipeline 1.42.2 → 1.44.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.
Files changed (47) hide show
  1. package/dist/build/docker.d.ts +28 -1
  2. package/dist/build/docker.js +25 -13
  3. package/dist/bundles/catladder-gitlab/index.js +3 -3
  4. package/dist/constants.js +1 -1
  5. package/dist/context/getLabels.d.ts +8 -0
  6. package/dist/context/getLabels.js +49 -0
  7. package/dist/context/index.js +3 -1
  8. package/dist/deploy/cloudRun/deployJob.d.ts +3 -0
  9. package/dist/deploy/cloudRun/deployJob.js +110 -0
  10. package/dist/deploy/cloudRun/index.d.ts +4 -0
  11. package/dist/deploy/cloudRun/index.js +18 -0
  12. package/dist/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.d.ts +2 -0
  13. package/dist/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.js +14 -0
  14. package/dist/deploy/custom/deployJob.js +2 -8
  15. package/dist/deploy/index.d.ts +1 -0
  16. package/dist/deploy/index.js +6 -1
  17. package/dist/deploy/kubernetes/kubeValues.d.ts +8 -8
  18. package/dist/deploy/kubernetes/processSecretsAsFiles.d.ts +8 -8
  19. package/dist/deploy/types/base.d.ts +15 -0
  20. package/dist/deploy/types/base.js +3 -0
  21. package/dist/deploy/types/custom.d.ts +10 -0
  22. package/dist/deploy/types/custom.js +3 -0
  23. package/dist/deploy/types/googleCloudRun.d.ts +20 -0
  24. package/dist/deploy/types/googleCloudRun.js +3 -0
  25. package/dist/deploy/types/index.d.ts +18 -0
  26. package/dist/deploy/types/index.js +39 -0
  27. package/dist/deploy/{types.d.ts → types/kubernetes.d.ts} +1 -33
  28. package/dist/deploy/types/kubernetes.js +3 -0
  29. package/dist/runner/index.d.ts +1 -1
  30. package/dist/tsconfig.tsbuildinfo +1 -1
  31. package/package.json +1 -1
  32. package/src/build/docker.ts +21 -15
  33. package/src/context/getLabels.ts +20 -0
  34. package/src/context/index.ts +15 -2
  35. package/src/deploy/cloudRun/deployJob.ts +84 -0
  36. package/src/deploy/cloudRun/index.ts +12 -0
  37. package/src/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.ts +14 -0
  38. package/src/deploy/custom/deployJob.ts +1 -15
  39. package/src/deploy/index.ts +3 -0
  40. package/src/deploy/types/base.ts +17 -0
  41. package/src/deploy/types/custom.ts +11 -0
  42. package/src/deploy/types/googleCloudRun.ts +55 -0
  43. package/src/deploy/types/index.ts +25 -0
  44. package/src/deploy/{types.ts → types/kubernetes.ts} +1 -42
  45. package/src/deploy/utils.ts +1 -1
  46. package/src/runner/index.ts +1 -0
  47. package/dist/deploy/types.js +0 -16
package/dist/constants.js CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
5
- exports.PIPELINE_IMAGE_TAG = "v1-42-2-39932ee6" || "";
5
+ exports.PIPELINE_IMAGE_TAG = "v1-44-0-e8a346f8" || "";
6
6
  exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || "";
@@ -0,0 +1,8 @@
1
+ import type { Context } from "../types";
2
+ export declare const getLabels: (context: Context) => {
3
+ "customer-name": string | undefined;
4
+ "app-name": string | undefined;
5
+ "env-type": string | undefined;
6
+ "env-name": string | undefined;
7
+ "build-type": string | undefined;
8
+ };
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ var __assign = this && this.__assign || function () {
4
+ __assign = Object.assign || function (t) {
5
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
6
+ s = arguments[i];
7
+
8
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
9
+ }
10
+
11
+ return t;
12
+ };
13
+
14
+ return __assign.apply(this, arguments);
15
+ };
16
+
17
+ var __importDefault = this && this.__importDefault || function (mod) {
18
+ return mod && mod.__esModule ? mod : {
19
+ "default": mod
20
+ };
21
+ };
22
+
23
+ exports.__esModule = true;
24
+ exports.getLabels = void 0;
25
+
26
+ var slugify_1 = __importDefault(require("slugify"));
27
+
28
+ var sanitize = function (value) {
29
+ if (!value) return value; //"The value can only contain lowercase letters, numeric characters, underscores and dashes. The value can be at most 63 characters long. International characters are allowed."
30
+ // slugify should do the job
31
+
32
+ return (0, slugify_1["default"])(value).toLowerCase();
33
+ };
34
+
35
+ var getLabels = function (context) {
36
+ var _a, _b, _c;
37
+
38
+ var labels = __assign({
39
+ "customer-name": sanitize(context.fullConfig.customerName),
40
+ "app-name": sanitize(context.fullConfig.appName),
41
+ "env-type": sanitize(context.environment.envType),
42
+ "env-name": sanitize(context.environment.shortName),
43
+ "build-type": sanitize((_a = context.componentConfig.build) === null || _a === void 0 ? void 0 : _a.type)
44
+ }, (_c = (_b = context.fullConfig.meta) === null || _b === void 0 ? void 0 : _b.labels) !== null && _c !== void 0 ? _c : {});
45
+
46
+ return labels;
47
+ };
48
+
49
+ exports.getLabels = getLabels;
@@ -207,6 +207,8 @@ var build_1 = require("../build");
207
207
 
208
208
  var deploy_1 = require("../deploy");
209
209
 
210
+ var types_1 = require("../deploy/types");
211
+
210
212
  var config_1 = require("../types/config");
211
213
 
212
214
  var utils_1 = require("../utils");
@@ -293,7 +295,7 @@ var getEnvironment = function (config, componentName, env, commitInfo, alreadyVi
293
295
  envInUrl = envType === "review" && commitInfo ? "".concat(commitInfo.reviewSlug, ".").concat(env) : env;
294
296
  domainCanonical = (mergedConfig === null || mergedConfig === void 0 ? void 0 : mergedConfig.deploy) && (mergedConfig === null || mergedConfig === void 0 ? void 0 : mergedConfig.deploy.type) === "kubernetes" && ((_e = mergedConfig.deploy.cluster) === null || _e === void 0 ? void 0 : _e.domainCanonical) || // for convenience, we allow clusters to define a canonical domain, because a cluster has a fixed ip and you will usually have a domain pointing to that cluster
295
297
  config.domainCanonical || "panter.cloud";
296
- HOST_CANONICAL = "".concat(componentSlug, ".").concat(envInUrl, ".").concat(config.appName, ".").concat(config.customerName, ".").concat(domainCanonical);
298
+ HOST_CANONICAL = (0, types_1.isOfDeployType)(mergedConfig.deploy, "kubernetes") ? "".concat(componentSlug, ".").concat(envInUrl, ".").concat(config.appName, ".").concat(config.customerName, ".").concat(domainCanonical) : (0, types_1.isOfDeployType)(mergedConfig.deploy, "google-cloudrun") ? environmentSlug + "-" + process.env[(0, exports.getSecretVarName)(env, componentName, deploy_1.GCLOUD_RUN_CANONICAL_HOST_SUFFIX)] : "";
297
299
  host = (_f = mergedConfig === null || mergedConfig === void 0 ? void 0 : mergedConfig.host) !== null && _f !== void 0 ? _f : HOST_CANONICAL;
298
300
  url_1 = "https://".concat(host);
299
301
  KUBE_APP_NAME_PREFIX = envType === "review" && commitInfo ? "".concat(commitInfo.reviewSlug, "-") : "";
@@ -0,0 +1,3 @@
1
+ import type { Context } from "../../types/context";
2
+ import type { CatladderJob } from "../../types/jobs";
3
+ export declare const createDeployJob: (context: Context) => CatladderJob[];
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+
3
+ var __read = this && this.__read || function (o, n) {
4
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
5
+ if (!m) return o;
6
+ var i = m.call(o),
7
+ r,
8
+ ar = [],
9
+ e;
10
+
11
+ try {
12
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
13
+ } catch (error) {
14
+ e = {
15
+ error: error
16
+ };
17
+ } finally {
18
+ try {
19
+ if (r && !r.done && (m = i["return"])) m.call(i);
20
+ } finally {
21
+ if (e) throw e.error;
22
+ }
23
+ }
24
+
25
+ return ar;
26
+ };
27
+
28
+ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
29
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
30
+ if (ar || !(i in from)) {
31
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
32
+ ar[i] = from[i];
33
+ }
34
+ }
35
+ return to.concat(ar || Array.prototype.slice.call(from));
36
+ };
37
+
38
+ exports.__esModule = true;
39
+ exports.createDeployJob = void 0;
40
+
41
+ var js_yaml_1 = require("js-yaml");
42
+
43
+ var lodash_1 = require("lodash");
44
+
45
+ var _1 = require(".");
46
+
47
+ var docker_1 = require("../../build/docker");
48
+
49
+ var getLabels_1 = require("../../context/getLabels");
50
+
51
+ var runner_1 = require("../../runner");
52
+
53
+ var base_1 = require("../base");
54
+
55
+ var types_1 = require("../types");
56
+
57
+ var gcloudServiceAccountLoginCommands_1 = require("./utils/gcloudServiceAccountLoginCommands");
58
+
59
+ var createDeployJob = function (context) {
60
+ var deployConfig = context.componentConfig.deploy;
61
+
62
+ if (deployConfig === false) {
63
+ return [];
64
+ }
65
+
66
+ if (!(0, types_1.isOfDeployType)(deployConfig, "google-cloudrun")) {
67
+ // should not happen
68
+ throw new Error("deploy config is not custom");
69
+ }
70
+
71
+ var baseDeploymentJob = (0, base_1.getBaseDeploymentJob)(context);
72
+ var fullAppName = "".concat(context.fullConfig.customerName, "-").concat(context.fullConfig.appName);
73
+ var dockerUrl = "".concat(deployConfig.region, "-docker.pkg.dev/").concat(deployConfig.projectId, "/catladder-deploy/").concat(fullAppName);
74
+ var gcloudImageName = "".concat(dockerUrl, "/$DOCKER_IMAGE_NAME:$DOCKER_IMAGE_TAG");
75
+
76
+ var pushImageToArtifactsRegistry = __spreadArray(__spreadArray([docker_1.gitlabDockerLogin], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), ["gcloud auth configure-docker ".concat(deployConfig.region, "-docker.pkg.dev"), "docker pull $DOCKER_IMAGE:$DOCKER_IMAGE_TAG", "docker tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG ".concat(gcloudImageName), "docker push ".concat(gcloudImageName)], false);
77
+
78
+ var allEnvVars = (0, lodash_1.omit)(context.environment.envVars, _1.GCLOUD_DEPLOY_CREDENTIALS_KEY);
79
+ var serviceName = context.environment.slug;
80
+ var labelsString = Object.entries((0, getLabels_1.getLabels)(context)).map(function (_a) {
81
+ var _b = __read(_a, 2),
82
+ key = _b[0],
83
+ value = _b[1];
84
+
85
+ return "".concat(key, "=").concat(value);
86
+ }).join(",");
87
+ var command = context.componentConfig.build.startCommand ? "--command=\"".concat(context.componentConfig.build.startCommand.split(" ").join(","), "\"") : ""; // TODO: split secrets out
88
+
89
+ var cloudRunDeploy = ["echo \"$ENV_VARS\" > ____envvars.yaml", "gcloud run deploy ".concat(serviceName, " --image ").concat(gcloudImageName, " --region=").concat(deployConfig.region, " --allow-unauthenticated --project ").concat(deployConfig.projectId, " ").concat(command, " --env-vars-file=____envvars.yaml --labels ").concat(labelsString), "docker image rm ".concat(gcloudImageName)];
90
+ var baseStopJob = (0, base_1.getBaseDeploymentStopJob)(context);
91
+ return [(0, lodash_1.merge)({}, baseDeploymentJob, (0, docker_1.getDockerJobBaseProps)(context), {
92
+ artifacts: {
93
+ paths: ["____envvars.yaml"]
94
+ },
95
+ variables: {
96
+ ENV_VARS: (0, js_yaml_1.dump)(allEnvVars, {
97
+ lineWidth: -1,
98
+ quotingType: "'",
99
+ forceQuotes: true
100
+ })
101
+ },
102
+ image: (0, runner_1.getRunnerImage)("gcloud"),
103
+ script: __spreadArray(__spreadArray([], __read(pushImageToArtifactsRegistry), false), __read(cloudRunDeploy), false)
104
+ }), (0, lodash_1.merge)({}, baseStopJob, {
105
+ image: (0, runner_1.getRunnerImage)("gcloud"),
106
+ script: __spreadArray(__spreadArray([], __read((0, gcloudServiceAccountLoginCommands_1.gcloudServiceAccountLoginCommands)(context)), false), ["gcloud run services delete ".concat(serviceName, " --project ").concat(deployConfig.projectId, " --region=").concat(deployConfig.region, " --quiet")], false)
107
+ })];
108
+ };
109
+
110
+ exports.createDeployJob = createDeployJob;
@@ -0,0 +1,4 @@
1
+ import type { DeployTypeDefinition } from "..";
2
+ export declare const GCLOUD_DEPLOY_CREDENTIALS_KEY = "GCLOUD_DEPLOY_credentialsKey";
3
+ export declare const GCLOUD_RUN_CANONICAL_HOST_SUFFIX = "GCLOUD_RUN_canonicalHostSuffix";
4
+ export declare const GCLOUD_RUN_DEPLOY_TYPE: DeployTypeDefinition<"google-cloudrun">;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.GCLOUD_RUN_DEPLOY_TYPE = exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX = exports.GCLOUD_DEPLOY_CREDENTIALS_KEY = void 0;
5
+
6
+ var deployJob_1 = require("./deployJob");
7
+
8
+ exports.GCLOUD_DEPLOY_CREDENTIALS_KEY = "GCLOUD_DEPLOY_credentialsKey";
9
+ exports.GCLOUD_RUN_CANONICAL_HOST_SUFFIX = "GCLOUD_RUN_canonicalHostSuffix";
10
+ exports.GCLOUD_RUN_DEPLOY_TYPE = {
11
+ jobs: deployJob_1.createDeployJob,
12
+ defaults: function () {
13
+ return {};
14
+ },
15
+ additionalSecretKeys: function () {
16
+ return [exports.GCLOUD_DEPLOY_CREDENTIALS_KEY];
17
+ }
18
+ };
@@ -0,0 +1,2 @@
1
+ import type { Context } from "../../../types";
2
+ export declare const gcloudServiceAccountLoginCommands: (context: Context) => string[];
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.gcloudServiceAccountLoginCommands = void 0;
5
+
6
+ var __1 = require("..");
7
+
8
+ var context_1 = require("../../../context");
9
+
10
+ var gcloudServiceAccountLoginCommands = function (context) {
11
+ return ["echo $".concat((0, context_1.getSecretVarNameForContext)(context, __1.GCLOUD_DEPLOY_CREDENTIALS_KEY), " > ./____keyfile.json\n "), "gcloud auth activate-service-account --key-file=\"./____keyfile.json\""];
12
+ };
13
+
14
+ exports.gcloudServiceAccountLoginCommands = gcloudServiceAccountLoginCommands;
@@ -64,14 +64,8 @@ var createCustomDeployJobs = function (context) {
64
64
  var yarnInstall = (0, yarn_1.getYarnInstall)(context);
65
65
  return [(0, lodash_1.merge)({}, baseDeploymentJob, {
66
66
  image: deployConfig.image ? (0, __1.getRunnerImage)(deployConfig.image) : undefined,
67
- script: __spreadArray(__spreadArray(["cd ".concat(context.componentConfig.dir)], __read(requiresYarnInstall(context) ? yarnInstall : []), false), __read(deployConfig.script), false)
67
+ script: __spreadArray(__spreadArray(["cd ".concat(context.componentConfig.dir)], __read(deployConfig.requiresYarnInstall ? yarnInstall : []), false), __read(deployConfig.script), false)
68
68
  })];
69
69
  };
70
70
 
71
- exports.createCustomDeployJobs = createCustomDeployJobs;
72
- var buildTypesThatRequireYarn = ["meteor", "node", "node-static", "storybook"];
73
-
74
- var requiresYarnInstall = function (context) {
75
- var buildConfig = context.componentConfig.build;
76
- return buildTypesThatRequireYarn.includes(buildConfig.type);
77
- };
71
+ exports.createCustomDeployJobs = createCustomDeployJobs;
@@ -10,5 +10,6 @@ export declare type DeployTypeDefinition<T extends DeployConfigType> = {
10
10
  additionalSecretKeys: (config: DeployConfigGeneric<T>) => string[];
11
11
  };
12
12
  export * from "./cloudSql";
13
+ export * from "./cloudRun";
13
14
  export declare type DeployTypes = { [T in DeployConfigType]: DeployTypeDefinition<T> };
14
15
  export declare const DEPLOY_TYPES: DeployTypes;
@@ -20,6 +20,8 @@ var __exportStar = this && this.__exportStar || function (m, exports) {
20
20
  exports.__esModule = true;
21
21
  exports.DEPLOY_TYPES = void 0;
22
22
 
23
+ var cloudRun_1 = require("./cloudRun");
24
+
23
25
  var custom_1 = require("./custom");
24
26
 
25
27
  var kubernetes_1 = require("./kubernetes");
@@ -32,7 +34,10 @@ __exportStar(require("./utils"), exports);
32
34
 
33
35
  __exportStar(require("./cloudSql"), exports);
34
36
 
37
+ __exportStar(require("./cloudRun"), exports);
38
+
35
39
  exports.DEPLOY_TYPES = {
36
40
  kubernetes: kubernetes_1.KUBERNETES_DEPLOY_TYPE,
37
- custom: custom_1.CUSTOM_DEPLOY_TYPE
41
+ custom: custom_1.CUSTOM_DEPLOY_TYPE,
42
+ "google-cloudrun": cloudRun_1.GCLOUD_RUN_DEPLOY_TYPE
38
43
  };
@@ -4,11 +4,11 @@ export declare const createKubeValues: (context: Context) => never[] | ({
4
4
  secret: Record<string, string>;
5
5
  public: Record<string, string>;
6
6
  };
7
- application: false | ({
7
+ application: false | import("../types/base").AllowUnknownProps<{
8
8
  enabled?: boolean | undefined;
9
- redirects?: ({
9
+ redirects?: import("../types/base").AllowUnknownProps<{
10
10
  host: string;
11
- } & Record<string, unknown>)[] | undefined;
11
+ }>[] | undefined;
12
12
  hostAliases?: string[] | undefined;
13
13
  replicas?: number | undefined;
14
14
  autoscale?: import("../types").KubernetesAutoscale | undefined;
@@ -58,7 +58,7 @@ export declare const createKubeValues: (context: Context) => never[] | ({
58
58
  } | undefined;
59
59
  } | undefined;
60
60
  worker?: import("../types").KubernetesWorkerDef | undefined;
61
- } & Record<string, unknown>) | undefined;
61
+ }> | undefined;
62
62
  } & {
63
63
  [x: string]: unknown;
64
64
  cloudsql?: {
@@ -71,15 +71,15 @@ export declare const createKubeValues: (context: Context) => never[] | ({
71
71
  mailhog?: {
72
72
  enabled: boolean;
73
73
  } | undefined;
74
- jobs?: Record<string, {
74
+ jobs?: Record<string, import("../types/base").AllowUnknownProps<{
75
75
  command: string;
76
76
  hook?: string | undefined;
77
- } & Record<string, unknown>> | undefined;
78
- cronjobs?: Record<string, {
77
+ }>> | undefined;
78
+ cronjobs?: Record<string, import("../types/base").AllowUnknownProps<{
79
79
  schedule: string;
80
80
  command: string;
81
81
  concurrencyPolicy?: "Forbid" | "Allow" | "Replace" | undefined;
82
- } & Record<string, unknown>> | undefined;
82
+ }>> | undefined;
83
83
  secretsFromOtherComponent?: {
84
84
  [envVar: string]: string;
85
85
  } | undefined;
@@ -13,20 +13,20 @@ export declare const processSecretsAsFiles: <T extends {
13
13
  mailhog?: {
14
14
  enabled: boolean;
15
15
  } | undefined;
16
- jobs?: Record<string, {
16
+ jobs?: Record<string, import("../types/base").AllowUnknownProps<{
17
17
  command: string;
18
18
  hook?: string | undefined;
19
- } & Record<string, unknown>> | undefined;
20
- cronjobs?: Record<string, {
19
+ }>> | undefined;
20
+ cronjobs?: Record<string, import("../types/base").AllowUnknownProps<{
21
21
  schedule: string;
22
22
  command: string;
23
23
  concurrencyPolicy?: "Forbid" | "Allow" | "Replace" | undefined;
24
- } & Record<string, unknown>> | undefined;
25
- application?: false | ({
24
+ }>> | undefined;
25
+ application?: false | import("../types/base").AllowUnknownProps<{
26
26
  enabled?: boolean | undefined;
27
- redirects?: ({
27
+ redirects?: import("../types/base").AllowUnknownProps<{
28
28
  host: string;
29
- } & Record<string, unknown>)[] | undefined;
29
+ }>[] | undefined;
30
30
  hostAliases?: string[] | undefined;
31
31
  replicas?: number | undefined;
32
32
  autoscale?: import("../types").KubernetesAutoscale | undefined;
@@ -76,7 +76,7 @@ export declare const processSecretsAsFiles: <T extends {
76
76
  } | undefined;
77
77
  } | undefined;
78
78
  worker?: import("../types").KubernetesWorkerDef | undefined;
79
- } & Record<string, unknown>) | undefined;
79
+ }> | undefined;
80
80
  secretsFromOtherComponent?: {
81
81
  [envVar: string]: string;
82
82
  } | undefined;
@@ -0,0 +1,15 @@
1
+ export declare type DeployConfigBase = {
2
+ /**
3
+ * whether to deploy automatically or manual. If not defined, these rules apply:
4
+ * - prod: manual
5
+ * - all other envs: auto
6
+ */
7
+ when?: "manual" | "auto";
8
+ /**
9
+ * EXPERIMENTAL
10
+ * wait for other components to deploy first, before doing this deployment
11
+ */
12
+
13
+ waitFor?: string[];
14
+ };
15
+ export declare type AllowUnknownProps<T extends Record<string, unknown>> = T & Record<string, unknown>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
@@ -0,0 +1,10 @@
1
+ import type { RunnerImageName } from "../../runner";
2
+ import type { DeployConfigBase } from "./base";
3
+ export declare type DeployConfigCustom = {
4
+ type: "custom";
5
+ requiresDocker: boolean;
6
+ requiresYarnInstall?: boolean;
7
+ script: string[];
8
+ stopScript?: string[];
9
+ image?: RunnerImageName;
10
+ } & DeployConfigBase;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
@@ -0,0 +1,20 @@
1
+ import type { DeployConfigBase } from "./base";
2
+ export declare type Gcloudregion = "asia-east1" | "asia-northeast1" | "asia-northeast2" | "europe-north1" | "europe-southwest1" | "europe-west1" | "europe-west4" | "europe-west8" | "europe-west9" | "me-west1" | "us-central1" | "us-east1" | "us-east4" | "us-east5" | "us-south1" | "us-west1" | "asia-east2" | "asia-northeast3" | "asia-southeast1" | "asia-southeast2" | "asia-south1" | "asia-south2" | "australia-southeast1" | "australia-southeast2" | "europe-central2" | "europe-west2" | "europe-west3" | "europe-west6" | "northamerica-northeast1" | "northamerica-northeast2" | "southamerica-east1" | "southamerica-west1" | "us-west2" | "us-west3" | "us-west4";
3
+ export declare type DeployConfigCloudRun = {
4
+ /**
5
+ * EXPERIMENTAL cloud run deployment.
6
+ *
7
+ * Requires that cloud run is enabled on the project, as well as cloud run api and artifacts registry.
8
+ */
9
+ type: "google-cloudrun";
10
+ /**
11
+ * the google cloud porject id
12
+ */
13
+
14
+ projectId: string;
15
+ /**
16
+ * the region. Set to europe-west6 for switzerland
17
+ */
18
+
19
+ region: Gcloudregion;
20
+ } & DeployConfigBase;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
@@ -0,0 +1,18 @@
1
+ import type { DeployConfigCustom } from "./custom";
2
+ import type { DeployConfigCloudRun } from "./googleCloudRun";
3
+ import type { DeployConfigKubernetes } from "./kubernetes";
4
+ export * from "./custom";
5
+ export * from "./googleCloudRun";
6
+ export * from "./kubernetes";
7
+ export declare type DeployConfig = DeployConfigKubernetes | DeployConfigCustom | DeployConfigCloudRun;
8
+ export declare type DeployConfigType = DeployConfig["type"];
9
+ export declare type DeployConfigGeneric<T extends DeployConfigType> = Extract<DeployConfig, {
10
+ type: T;
11
+ }>;
12
+ export declare const isOfDeployType: <T extends ("kubernetes" | "custom" | "google-cloudrun")[]>(t: DeployConfig | false, ...types: T) => t is Extract<DeployConfigCustom, {
13
+ type: T[number];
14
+ }> | Extract<DeployConfigCloudRun, {
15
+ type: T[number];
16
+ }> | Extract<DeployConfigKubernetes, {
17
+ type: T[number];
18
+ }>;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+
3
+ var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ Object.defineProperty(o, k2, {
6
+ enumerable: true,
7
+ get: function () {
8
+ return m[k];
9
+ }
10
+ });
11
+ } : function (o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ o[k2] = m[k];
14
+ });
15
+
16
+ var __exportStar = this && this.__exportStar || function (m, exports) {
17
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
18
+ };
19
+
20
+ exports.__esModule = true;
21
+ exports.isOfDeployType = void 0;
22
+
23
+ __exportStar(require("./custom"), exports);
24
+
25
+ __exportStar(require("./googleCloudRun"), exports);
26
+
27
+ __exportStar(require("./kubernetes"), exports);
28
+
29
+ var isOfDeployType = function (t) {
30
+ var types = [];
31
+
32
+ for (var _i = 1; _i < arguments.length; _i++) {
33
+ types[_i - 1] = arguments[_i];
34
+ }
35
+
36
+ return t && types.includes(t.type);
37
+ };
38
+
39
+ exports.isOfDeployType = isOfDeployType;
@@ -1,19 +1,4 @@
1
- import type { RunnerImageName } from "../runner";
2
- export declare 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
- * EXPERIMENTAL
11
- * wait for other components to deploy first, before doing this deployment
12
- */
13
-
14
- waitFor?: string[];
15
- };
16
- declare type AllowUnknownProps<T extends Record<string, unknown>> = T & Record<string, unknown>;
1
+ import type { AllowUnknownProps, DeployConfigBase } from "./base";
17
2
  export declare type DeployConfigKubernetesClusterGCloud = {
18
3
  type: "gcloud";
19
4
  /**
@@ -300,21 +285,4 @@ export declare type DeployConfigKubernetes = {
300
285
 
301
286
  values?: DeployConfigKubernetesValues;
302
287
  } & DeployConfigBase;
303
- export declare type DeployConfigCustom = {
304
- type: "custom";
305
- requiresDocker: boolean;
306
- script: string[];
307
- stopScript?: string[];
308
- image?: RunnerImageName;
309
- } & DeployConfigBase;
310
- export declare type DeployConfig = DeployConfigKubernetes | DeployConfigCustom;
311
- export declare type DeployConfigType = DeployConfig["type"];
312
- export declare type DeployConfigGeneric<T extends DeployConfigType> = Extract<DeployConfig, {
313
- type: T;
314
- }>;
315
- export declare const isOfDeployType: <T extends ("kubernetes" | "custom")[]>(t: DeployConfig | false, ...types: T) => t is Extract<DeployConfigKubernetes, {
316
- type: T[number];
317
- }> | Extract<DeployConfigCustom, {
318
- type: T[number];
319
- }>;
320
288
  export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
@@ -1,2 +1,2 @@
1
- export declare type RunnerImageName = "jobs-default" | "jobs-meteor" | "jobs-testing-chrome" | "kubernetes" | "base-pipeline" | "docker-build" | "semantic-release";
1
+ export declare type RunnerImageName = "jobs-default" | "jobs-meteor" | "jobs-testing-chrome" | "kubernetes" | "base-pipeline" | "docker-build" | "gcloud" | "semantic-release";
2
2
  export declare const getRunnerImage: (imageName: RunnerImageName) => string;