@catladder/pipeline 1.75.4 → 1.76.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 (112) hide show
  1. package/dist/build/base/createBuildJob.js +5 -27
  2. package/dist/build/base/writeBuildInfo.js +0 -3
  3. package/dist/build/custom/buildJob.js +3 -23
  4. package/dist/build/custom/index.js +3 -10
  5. package/dist/build/docker.js +5 -40
  6. package/dist/build/index.js +0 -8
  7. package/dist/build/node/buildJob.js +3 -25
  8. package/dist/build/node/cache.js +3 -21
  9. package/dist/build/node/index.js +3 -16
  10. package/dist/build/node/meteor.js +3 -20
  11. package/dist/build/node/testJob.js +5 -22
  12. package/dist/build/node/yarn.js +5 -18
  13. package/dist/build/rails/build.js +2 -8
  14. package/dist/build/rails/index.js +3 -11
  15. package/dist/build/rails/test.js +5 -18
  16. package/dist/build/types.d.ts +0 -9
  17. package/dist/build/types.js +0 -4
  18. package/dist/bundles/catladder-gitlab/index.js +1 -1
  19. package/dist/catladder-gitlab.js +6 -24
  20. package/dist/config/{configruedEnvs.test.d.ts → __tests__/configruedEnvs.test.d.ts} +0 -0
  21. package/dist/config/{configruedEnvs.test.js → __tests__/configruedEnvs.test.js} +10 -12
  22. package/dist/config/configruedEnvs.js +7 -22
  23. package/dist/config/index.js +0 -4
  24. package/dist/config/readConfig.js +2 -13
  25. package/dist/constants.js +1 -1
  26. package/dist/context/{resolveReferences.test.d.ts → __tests__/resolveReferences.test.d.ts} +0 -0
  27. package/dist/context/{resolveReferences.test.js → __tests__/resolveReferences.test.js} +52 -103
  28. package/dist/context/getEnvConfig.js +0 -8
  29. package/dist/context/getEnvType.js +0 -5
  30. package/dist/context/getEnvironment.js +13 -49
  31. package/dist/context/getEnvironmentContext.js +0 -5
  32. package/dist/context/getEnvironmentVariables.js +20 -83
  33. package/dist/context/getLabels.js +2 -13
  34. package/dist/context/index.js +13 -58
  35. package/dist/context/resolveReferences.js +36 -126
  36. package/dist/deploy/base.js +4 -19
  37. package/dist/deploy/cloudRun/deployJob.js +19 -61
  38. package/dist/deploy/cloudRun/index.js +17 -39
  39. package/dist/deploy/cloudRun/utils/database.js +11 -29
  40. package/dist/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.js +0 -4
  41. package/dist/deploy/cloudRun/utils/jobName.js +0 -2
  42. package/dist/deploy/custom/deployJob.js +3 -18
  43. package/dist/deploy/custom/index.js +0 -2
  44. package/dist/deploy/dockerTag/deployJob.js +0 -9
  45. package/dist/deploy/dockerTag/index.js +0 -2
  46. package/dist/deploy/index.js +0 -11
  47. package/dist/deploy/kubernetes/additionalSecretKeys.js +0 -9
  48. package/dist/deploy/kubernetes/cloudSql/index.js +0 -12
  49. package/dist/deploy/kubernetes/deployJob.js +3 -24
  50. package/dist/deploy/kubernetes/index.js +7 -17
  51. package/dist/deploy/kubernetes/kubeEnv.d.ts +0 -1
  52. package/dist/deploy/kubernetes/kubeEnv.js +5 -23
  53. package/dist/deploy/kubernetes/kubeValues.js +6 -24
  54. package/dist/deploy/kubernetes/mongodb.js +0 -24
  55. package/dist/deploy/kubernetes/processSecretsAsFiles.js +2 -10
  56. package/dist/deploy/types/base.d.ts +0 -1
  57. package/dist/deploy/types/custom.d.ts +0 -6
  58. package/dist/deploy/types/googleCloudRun.d.ts +4 -12
  59. package/dist/deploy/types/index.js +0 -10
  60. package/dist/deploy/types/kubernetes.d.ts +0 -28
  61. package/dist/deploy/utils.js +0 -11
  62. package/dist/index.js +0 -10
  63. package/dist/pipeline/commitInfo/getBuildId.d.ts +1 -0
  64. package/dist/pipeline/{createChildPipeline.test.js → commitInfo/getBuildId.js} +25 -84
  65. package/dist/pipeline/commitInfo/getCommitInfo.d.ts +2 -0
  66. package/dist/{build/tests/storybook.test.js → pipeline/commitInfo/getCommitInfo.js} +30 -104
  67. package/dist/pipeline/createChildPipeline.js +19 -76
  68. package/dist/pipeline/createJobs.js +35 -135
  69. package/dist/pipeline/gitlab/makeGitlabJob.d.ts +1 -0
  70. package/dist/pipeline/gitlab/makeGitlabJob.js +13 -15
  71. package/dist/pipeline/index.js +0 -4
  72. package/dist/pipeline/packageManager.js +20 -173
  73. package/dist/pipeline/yarn/yarnUtils.d.ts +4 -0
  74. package/dist/pipeline/yarn/yarnUtils.js +193 -0
  75. package/dist/runner/index.js +0 -3
  76. package/dist/tsconfig.tsbuildinfo +1 -1
  77. package/dist/types/config.d.ts +0 -13
  78. package/dist/types/config.js +5 -15
  79. package/dist/types/context.d.ts +0 -2
  80. package/dist/types/environmentContext.d.ts +0 -1
  81. package/dist/types/gitlab-types.d.ts +0 -1
  82. package/dist/types/index.js +0 -6
  83. package/dist/types/jobs.d.ts +5 -15
  84. package/dist/utils/gitlab.js +3 -13
  85. package/dist/utils/index.js +5 -15
  86. package/examples/__snapshots__/cloud-run-with-sql.ts.snap +1765 -0
  87. package/examples/__snapshots__/custom-build-job.ts.snap +1174 -0
  88. package/examples/__snapshots__/custom-envs.ts.snap +261 -0
  89. package/examples/__snapshots__/wait-for-other-deploy.ts.snap +1626 -0
  90. package/examples/__utils__/helpers.ts +14 -0
  91. package/examples/{cloud-sql.ts → cloud-run-with-sql.ts} +12 -15
  92. package/examples/custom-build-job.ts +4 -1
  93. package/examples/custom-envs.ts +31 -0
  94. package/examples/wait-for-other-deploy.ts +36 -0
  95. package/package.json +2 -2
  96. package/src/config/{configruedEnvs.test.ts → __tests__/configruedEnvs.test.ts} +3 -3
  97. package/src/context/{resolveReferences.test.ts → __tests__/resolveReferences.test.ts} +3 -3
  98. package/src/deploy/cloudRun/index.ts +2 -1
  99. package/src/deploy/types/googleCloudRun.ts +5 -0
  100. package/src/pipeline/commitInfo/getBuildId.ts +6 -0
  101. package/src/pipeline/commitInfo/getCommitInfo.ts +12 -0
  102. package/src/pipeline/createChildPipeline.ts +6 -1
  103. package/src/pipeline/createJobs.ts +3 -10
  104. package/src/pipeline/gitlab/makeGitlabJob.ts +7 -1
  105. package/src/pipeline/packageManager.ts +4 -38
  106. package/src/pipeline/yarn/yarnUtils.ts +37 -0
  107. package/src/types/jobs.ts +2 -1
  108. package/tsconfig.json +1 -1
  109. package/dist/build/tests/storybook.test.d.ts +0 -1
  110. package/dist/pipeline/createChildPipeline.test.d.ts +0 -1
  111. package/src/build/tests/storybook.test.ts +0 -54
  112. package/src/pipeline/createChildPipeline.test.ts +0 -49
@@ -12,18 +12,15 @@ var __createBinding = this && this.__createBinding || (Object.create ? function
12
12
  if (k2 === undefined) k2 = k;
13
13
  o[k2] = m[k];
14
14
  });
15
-
16
15
  var __exportStar = this && this.__exportStar || function (m, exports) {
17
16
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
18
17
  };
19
-
20
18
  var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
21
19
  function adopt(value) {
22
20
  return value instanceof P ? value : new P(function (resolve) {
23
21
  resolve(value);
24
22
  });
25
23
  }
26
-
27
24
  return new (P || (P = Promise))(function (resolve, reject) {
28
25
  function fulfilled(value) {
29
26
  try {
@@ -32,7 +29,6 @@ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, gene
32
29
  reject(e);
33
30
  }
34
31
  }
35
-
36
32
  function rejected(value) {
37
33
  try {
38
34
  step(generator["throw"](value));
@@ -40,29 +36,26 @@ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, gene
40
36
  reject(e);
41
37
  }
42
38
  }
43
-
44
39
  function step(result) {
45
40
  result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
46
41
  }
47
-
48
42
  step((generator = generator.apply(thisArg, _arguments || [])).next());
49
43
  });
50
44
  };
51
-
52
45
  var __generator = this && this.__generator || function (thisArg, body) {
53
46
  var _ = {
54
- label: 0,
55
- sent: function () {
56
- if (t[0] & 1) throw t[1];
57
- return t[1];
47
+ label: 0,
48
+ sent: function () {
49
+ if (t[0] & 1) throw t[1];
50
+ return t[1];
51
+ },
52
+ trys: [],
53
+ ops: []
58
54
  },
59
- trys: [],
60
- ops: []
61
- },
62
- f,
63
- y,
64
- t,
65
- g;
55
+ f,
56
+ y,
57
+ t,
58
+ g;
66
59
  return g = {
67
60
  next: verb(0),
68
61
  "throw": verb(1),
@@ -70,78 +63,59 @@ var __generator = this && this.__generator || function (thisArg, body) {
70
63
  }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
71
64
  return this;
72
65
  }), g;
73
-
74
66
  function verb(n) {
75
67
  return function (v) {
76
68
  return step([n, v]);
77
69
  };
78
70
  }
79
-
80
71
  function step(op) {
81
72
  if (f) throw new TypeError("Generator is already executing.");
82
-
83
73
  while (_) try {
84
74
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
85
75
  if (y = 0, t) op = [op[0] & 2, t.value];
86
-
87
76
  switch (op[0]) {
88
77
  case 0:
89
78
  case 1:
90
79
  t = op;
91
80
  break;
92
-
93
81
  case 4:
94
82
  _.label++;
95
83
  return {
96
84
  value: op[1],
97
85
  done: false
98
86
  };
99
-
100
87
  case 5:
101
88
  _.label++;
102
89
  y = op[1];
103
90
  op = [0];
104
91
  continue;
105
-
106
92
  case 7:
107
93
  op = _.ops.pop();
108
-
109
94
  _.trys.pop();
110
-
111
95
  continue;
112
-
113
96
  default:
114
97
  if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
115
98
  _ = 0;
116
99
  continue;
117
100
  }
118
-
119
101
  if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
120
102
  _.label = op[1];
121
103
  break;
122
104
  }
123
-
124
105
  if (op[0] === 6 && _.label < t[1]) {
125
106
  _.label = t[1];
126
107
  t = op;
127
108
  break;
128
109
  }
129
-
130
110
  if (t && _.label < t[2]) {
131
111
  _.label = t[2];
132
-
133
112
  _.ops.push(op);
134
-
135
113
  break;
136
114
  }
137
-
138
115
  if (t[2]) _.ops.pop();
139
-
140
116
  _.trys.pop();
141
-
142
117
  continue;
143
118
  }
144
-
145
119
  op = body.call(thisArg, _);
146
120
  } catch (e) {
147
121
  op = [6, e];
@@ -149,7 +123,6 @@ var __generator = this && this.__generator || function (thisArg, body) {
149
123
  } finally {
150
124
  f = t = 0;
151
125
  }
152
-
153
126
  if (op[0] & 5) throw op[1];
154
127
  return {
155
128
  value: op[0] ? op[1] : void 0,
@@ -157,37 +130,25 @@ var __generator = this && this.__generator || function (thisArg, body) {
157
130
  };
158
131
  }
159
132
  };
160
-
161
133
  exports.__esModule = true;
162
134
  exports.createContext = void 0;
163
-
164
135
  var build_1 = require("../build");
165
-
166
136
  var deploy_1 = require("../deploy");
167
-
168
137
  var utils_1 = require("../utils");
169
-
170
138
  var getEnvironment_1 = require("./getEnvironment");
171
-
172
139
  var getEnvironmentContext_1 = require("./getEnvironmentContext");
173
-
174
140
  __exportStar(require("./getEnvironment"), exports);
175
-
176
141
  __exportStar(require("./getEnvironmentVariables"), exports);
177
-
178
142
  var createContext = function (config, componentName, env, commitInfo, packageManagerInfo) {
179
143
  return __awaiter(void 0, void 0, void 0, function () {
180
144
  var envContext, componentConfigWithoutDefaults, defaults, componentConfig;
181
-
182
145
  var _a;
183
-
184
146
  return __generator(this, function (_b) {
185
147
  switch (_b.label) {
186
148
  case 0:
187
149
  if (!/^[a-z0-9-]+$/.test(componentName)) {
188
150
  throw new Error("componentName may only contain lower case letters, numbers and -");
189
151
  }
190
-
191
152
  envContext = (0, getEnvironmentContext_1.getEnvironmentContext)(config, env, componentName, commitInfo);
192
153
  componentConfigWithoutDefaults = envContext.envConfigRaw;
193
154
  defaults = componentConfigWithoutDefaults.deploy ? {
@@ -203,17 +164,11 @@ var createContext = function (config, componentName, env, commitInfo, packageMan
203
164
  componentConfig: componentConfig,
204
165
  componentName: componentName
205
166
  };
206
- return [4
207
- /*yield*/
208
- , (0, getEnvironment_1.getEnvironment)(config, componentName, env, commitInfo)];
209
-
167
+ return [4 /*yield*/, (0, getEnvironment_1.getEnvironment)(config, componentName, env, commitInfo)];
210
168
  case 1:
211
- return [2
212
- /*return*/
213
- , (_a.environment = _b.sent(), _a.commitInfo = commitInfo, _a.packageManagerInfo = packageManagerInfo, _a)];
169
+ return [2 /*return*/, (_a.environment = _b.sent(), _a.commitInfo = commitInfo, _a.packageManagerInfo = packageManagerInfo, _a)];
214
170
  }
215
171
  });
216
172
  });
217
173
  };
218
-
219
174
  exports.createContext = createContext;
@@ -6,7 +6,6 @@ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, gene
6
6
  resolve(value);
7
7
  });
8
8
  }
9
-
10
9
  return new (P || (P = Promise))(function (resolve, reject) {
11
10
  function fulfilled(value) {
12
11
  try {
@@ -15,7 +14,6 @@ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, gene
15
14
  reject(e);
16
15
  }
17
16
  }
18
-
19
17
  function rejected(value) {
20
18
  try {
21
19
  step(generator["throw"](value));
@@ -23,29 +21,26 @@ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, gene
23
21
  reject(e);
24
22
  }
25
23
  }
26
-
27
24
  function step(result) {
28
25
  result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
29
26
  }
30
-
31
27
  step((generator = generator.apply(thisArg, _arguments || [])).next());
32
28
  });
33
29
  };
34
-
35
30
  var __generator = this && this.__generator || function (thisArg, body) {
36
31
  var _ = {
37
- label: 0,
38
- sent: function () {
39
- if (t[0] & 1) throw t[1];
40
- return t[1];
32
+ label: 0,
33
+ sent: function () {
34
+ if (t[0] & 1) throw t[1];
35
+ return t[1];
36
+ },
37
+ trys: [],
38
+ ops: []
41
39
  },
42
- trys: [],
43
- ops: []
44
- },
45
- f,
46
- y,
47
- t,
48
- g;
40
+ f,
41
+ y,
42
+ t,
43
+ g;
49
44
  return g = {
50
45
  next: verb(0),
51
46
  "throw": verb(1),
@@ -53,78 +48,59 @@ var __generator = this && this.__generator || function (thisArg, body) {
53
48
  }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
54
49
  return this;
55
50
  }), g;
56
-
57
51
  function verb(n) {
58
52
  return function (v) {
59
53
  return step([n, v]);
60
54
  };
61
55
  }
62
-
63
56
  function step(op) {
64
57
  if (f) throw new TypeError("Generator is already executing.");
65
-
66
58
  while (_) try {
67
59
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
68
60
  if (y = 0, t) op = [op[0] & 2, t.value];
69
-
70
61
  switch (op[0]) {
71
62
  case 0:
72
63
  case 1:
73
64
  t = op;
74
65
  break;
75
-
76
66
  case 4:
77
67
  _.label++;
78
68
  return {
79
69
  value: op[1],
80
70
  done: false
81
71
  };
82
-
83
72
  case 5:
84
73
  _.label++;
85
74
  y = op[1];
86
75
  op = [0];
87
76
  continue;
88
-
89
77
  case 7:
90
78
  op = _.ops.pop();
91
-
92
79
  _.trys.pop();
93
-
94
80
  continue;
95
-
96
81
  default:
97
82
  if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
98
83
  _ = 0;
99
84
  continue;
100
85
  }
101
-
102
86
  if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
103
87
  _.label = op[1];
104
88
  break;
105
89
  }
106
-
107
90
  if (op[0] === 6 && _.label < t[1]) {
108
91
  _.label = t[1];
109
92
  t = op;
110
93
  break;
111
94
  }
112
-
113
95
  if (t && _.label < t[2]) {
114
96
  _.label = t[2];
115
-
116
97
  _.ops.push(op);
117
-
118
98
  break;
119
99
  }
120
-
121
100
  if (t[2]) _.ops.pop();
122
-
123
101
  _.trys.pop();
124
-
125
102
  continue;
126
103
  }
127
-
128
104
  op = body.call(thisArg, _);
129
105
  } catch (e) {
130
106
  op = [6, e];
@@ -132,7 +108,6 @@ var __generator = this && this.__generator || function (thisArg, body) {
132
108
  } finally {
133
109
  f = t = 0;
134
110
  }
135
-
136
111
  if (op[0] & 5) throw op[1];
137
112
  return {
138
113
  value: op[0] ? op[1] : void 0,
@@ -140,15 +115,13 @@ var __generator = this && this.__generator || function (thisArg, body) {
140
115
  };
141
116
  }
142
117
  };
143
-
144
118
  var __read = this && this.__read || function (o, n) {
145
119
  var m = typeof Symbol === "function" && o[Symbol.iterator];
146
120
  if (!m) return o;
147
121
  var i = m.call(o),
148
- r,
149
- ar = [],
150
- e;
151
-
122
+ r,
123
+ ar = [],
124
+ e;
152
125
  try {
153
126
  while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
154
127
  } catch (error) {
@@ -162,33 +135,24 @@ var __read = this && this.__read || function (o, n) {
162
135
  if (e) throw e.error;
163
136
  }
164
137
  }
165
-
166
138
  return ar;
167
139
  };
168
-
169
140
  var __importDefault = this && this.__importDefault || function (mod) {
170
141
  return mod && mod.__esModule ? mod : {
171
142
  "default": mod
172
143
  };
173
144
  };
174
-
175
145
  exports.__esModule = true;
176
146
  exports.translateLegacyFromComponents = exports.resolveReferences = void 0;
177
-
178
147
  var lodash_1 = require("lodash");
179
-
180
148
  var string_replace_async_1 = __importDefault(require("string-replace-async"));
181
-
182
149
  var REGEX = /\$\{(([^:]+):)?([^}]+)}/gm;
183
-
184
150
  var resolveReferences = function (vars, getOtherVariables, alreadyVisitedBase) {
185
151
  if (alreadyVisitedBase === void 0) {
186
152
  alreadyVisitedBase = {};
187
153
  }
188
-
189
154
  return __awaiter(void 0, void 0, void 0, function () {
190
155
  var replaceSingleValue, _a, _b;
191
-
192
156
  return __generator(this, function (_c) {
193
157
  switch (_c.label) {
194
158
  case 0:
@@ -196,147 +160,93 @@ var resolveReferences = function (vars, getOtherVariables, alreadyVisitedBase) {
196
160
  if (alreadyVisited === void 0) {
197
161
  alreadyVisited = alreadyVisitedBase;
198
162
  }
199
-
200
163
  return __awaiter(void 0, void 0, void 0, function () {
201
164
  return __generator(this, function (_a) {
202
165
  switch (_a.label) {
203
166
  case 0:
204
- if (!REGEX.test(value)) return [3
205
- /*break*/
206
- , 2];
207
- return [4
208
- /*yield*/
209
- , (0, string_replace_async_1["default"])(value, REGEX, function (match, _, componentName, variableName) {
167
+ if (!REGEX.test(value)) return [3 /*break*/, 2];
168
+ return [4 /*yield*/, (0, string_replace_async_1["default"])(value, REGEX, function (match, _, componentName, variableName) {
210
169
  return __awaiter(void 0, void 0, void 0, function () {
211
170
  var newAlreadyVisited, result, _a, replaced, _b;
212
-
213
171
  var _c, _d;
214
-
215
172
  var _e, _f;
216
-
217
173
  return __generator(this, function (_g) {
218
174
  switch (_g.label) {
219
175
  case 0:
220
176
  if ((_e = alreadyVisited[componentName]) === null || _e === void 0 ? void 0 : _e[variableName]) {
221
- return [2
222
- /*return*/
223
- , match]; // prevent endless loop
177
+ return [2 /*return*/, match]; // prevent endless loop
224
178
  }
225
179
 
226
180
  newAlreadyVisited = (0, lodash_1.merge)({}, alreadyVisited, (_c = {}, _c[componentName] = (_d = {}, _d[variableName] = true, _d), _c));
227
- if (!componentName) return [3
228
- /*break*/
229
- , 2];
230
- return [4
231
- /*yield*/
232
- , getOtherVariables === null || getOtherVariables === void 0 ? void 0 : getOtherVariables(componentName, variableName, newAlreadyVisited)];
233
-
181
+ if (!componentName) return [3 /*break*/, 2];
182
+ return [4 /*yield*/, getOtherVariables === null || getOtherVariables === void 0 ? void 0 : getOtherVariables(componentName, variableName, newAlreadyVisited)];
234
183
  case 1:
235
184
  _a = (_f = _g.sent()) !== null && _f !== void 0 ? _f : null;
236
- return [3
237
- /*break*/
238
- , 3];
239
-
185
+ return [3 /*break*/, 3];
240
186
  case 2:
241
187
  _a = vars[variableName];
242
188
  _g.label = 3;
243
-
244
189
  case 3:
245
190
  result = _a;
246
- if (!(result !== null && result !== undefined)) return [3
247
- /*break*/
248
- , 5];
249
- return [4
250
- /*yield*/
251
- , replaceSingleValue(result, newAlreadyVisited)];
252
-
191
+ if (!(result !== null && result !== undefined)) return [3 /*break*/, 5];
192
+ return [4 /*yield*/, replaceSingleValue(result, newAlreadyVisited)];
253
193
  case 4:
254
194
  _b = _g.sent();
255
- return [3
256
- /*break*/
257
- , 6];
258
-
195
+ return [3 /*break*/, 6];
259
196
  case 5:
260
197
  _b = match;
261
198
  _g.label = 6;
262
-
263
199
  case 6:
264
200
  replaced = _b;
265
- return [2
266
- /*return*/
267
- , replaced];
201
+ return [2 /*return*/, replaced];
268
202
  }
269
203
  });
270
204
  });
271
205
  })];
272
-
273
206
  case 1:
274
- return [2
275
- /*return*/
276
- , _a.sent()];
277
-
207
+ return [2 /*return*/, _a.sent()];
278
208
  case 2:
279
- return [2
280
- /*return*/
281
- , value];
209
+ return [2 /*return*/, value];
282
210
  }
283
211
  });
284
212
  });
285
213
  };
286
-
287
214
  _b = (_a = Object).fromEntries;
288
- return [4
289
- /*yield*/
290
- , Promise.all(Object.entries(vars).map(function (_a) {
215
+ return [4 /*yield*/, Promise.all(Object.entries(vars).map(function (_a) {
291
216
  var _b = __read(_a, 2),
292
- key = _b[0],
293
- value = _b[1];
294
-
217
+ key = _b[0],
218
+ value = _b[1];
295
219
  return __awaiter(void 0, void 0, void 0, function () {
296
220
  var _c;
297
-
298
221
  return __generator(this, function (_d) {
299
222
  switch (_d.label) {
300
223
  case 0:
301
224
  _c = [key];
302
- return [4
303
- /*yield*/
304
- , replaceSingleValue(value)];
305
-
225
+ return [4 /*yield*/, replaceSingleValue(value)];
306
226
  case 1:
307
- return [2
308
- /*return*/
309
- , _c.concat([_d.sent()])];
227
+ return [2 /*return*/, _c.concat([_d.sent()])];
310
228
  }
311
229
  });
312
230
  });
313
231
  }))];
314
-
315
232
  case 1:
316
- return [2
317
- /*return*/
318
- , _b.apply(_a, [_c.sent()])];
233
+ return [2 /*return*/, _b.apply(_a, [_c.sent()])];
319
234
  }
320
235
  });
321
236
  });
322
237
  };
323
-
324
238
  exports.resolveReferences = resolveReferences;
325
-
326
239
  var translateLegacyFromComponents = function (fromComponents) {
327
240
  return Object.fromEntries(Object.entries(fromComponents).flatMap(function (_a) {
328
241
  var _b = __read(_a, 2),
329
- componentName = _b[0],
330
- variables = _b[1];
331
-
242
+ componentName = _b[0],
243
+ variables = _b[1];
332
244
  return Object.entries(variables).map(function (_a) {
333
245
  var _b = __read(_a, 2),
334
- ourName = _b[0],
335
- otherName = _b[1];
336
-
246
+ ourName = _b[0],
247
+ otherName = _b[1];
337
248
  return [ourName, "${" + componentName + ":" + otherName + "}"];
338
249
  });
339
250
  }));
340
251
  };
341
-
342
252
  exports.translateLegacyFromComponents = translateLegacyFromComponents;
@@ -4,23 +4,16 @@ var __assign = this && this.__assign || function () {
4
4
  __assign = Object.assign || function (t) {
5
5
  for (var s, i = 1, n = arguments.length; i < n; i++) {
6
6
  s = arguments[i];
7
-
8
7
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
9
8
  }
10
-
11
9
  return t;
12
10
  };
13
-
14
11
  return __assign.apply(this, arguments);
15
12
  };
16
-
17
13
  exports.__esModule = true;
18
14
  exports.getBaseRollbackJob = exports.getBaseDeploymentStopJob = exports.getBaseDeploymentJob = exports.ROLLBACK_JOB_NAME = exports.STOP_JOB_NAME = exports.DEPLOY_JOB_NAME = void 0;
19
-
20
15
  var docker_1 = require("../build/docker");
21
-
22
16
  var utils_1 = require("./utils");
23
-
24
17
  exports.DEPLOY_JOB_NAME = "🚀 Deploy";
25
18
  exports.STOP_JOB_NAME = "🛑 Stop ⚠️";
26
19
  exports.ROLLBACK_JOB_NAME = "↩️ Rollback ⚠️";
@@ -30,20 +23,17 @@ var DEPLOY_RUNNER_VARIABLES = {
30
23
  KUBERNETES_MEMORY_REQUEST: "200Mi",
31
24
  KUBERNETES_MEMORY_LIMIT: "500Mi"
32
25
  };
33
-
34
26
  var getBaseDeploymentJob = function (context) {
35
27
  var _a, _b, _c;
36
-
37
28
  var hasDocker = (0, docker_1.requiresDockerBuild)(context);
38
29
  var isStoppable = (0, utils_1.contextIsStoppable)(context);
39
- var autoStop = context.environment.envType === "review" ? "2 week" : context.environment.envType === "dev" ? "4 weeks" : undefined; // if auto or manual is configured explicitly, use that
40
-
41
- var whenDeployDefined = context.componentConfig.deploy && context.componentConfig.deploy.when ? context.componentConfig.deploy.when : undefined; // otherwise auto deploy if env is not prod. If its prod, deploy automatically if stage is disabled
42
-
30
+ var autoStop = context.environment.envType === "review" ? "2 week" : context.environment.envType === "dev" ? "4 weeks" : undefined;
31
+ // if auto or manual is configured explicitly, use that
32
+ var whenDeployDefined = context.componentConfig.deploy && context.componentConfig.deploy.when ? context.componentConfig.deploy.when : undefined;
33
+ // otherwise auto deploy if env is not prod. If its prod, deploy automatically if stage is disabled
43
34
  var whenDeployDefault = context.environment.envType !== "prod" ? "auto" // is not stage, auto deploy
44
35
  : ((_a = context.componentConfig.env) === null || _a === void 0 ? void 0 : _a.stage) === false ? "auto" // is prod, but no staging, auto deploy
45
36
  : "manual"; // manually deploy
46
-
47
37
  var whenDeploy = whenDeployDefined ? whenDeployDefined : whenDeployDefault;
48
38
  return {
49
39
  name: exports.DEPLOY_JOB_NAME,
@@ -77,9 +67,7 @@ var getBaseDeploymentJob = function (context) {
77
67
  } : {})
78
68
  };
79
69
  };
80
-
81
70
  exports.getBaseDeploymentJob = getBaseDeploymentJob;
82
-
83
71
  var getBaseDeploymentStopJob = function (context) {
84
72
  return {
85
73
  name: exports.STOP_JOB_NAME,
@@ -102,9 +90,7 @@ var getBaseDeploymentStopJob = function (context) {
102
90
  })
103
91
  };
104
92
  };
105
-
106
93
  exports.getBaseDeploymentStopJob = getBaseDeploymentStopJob;
107
-
108
94
  var getBaseRollbackJob = function (context) {
109
95
  return {
110
96
  name: exports.ROLLBACK_JOB_NAME,
@@ -123,5 +109,4 @@ var getBaseRollbackJob = function (context) {
123
109
  })
124
110
  };
125
111
  };
126
-
127
112
  exports.getBaseRollbackJob = getBaseRollbackJob;