@clickview/ship-it 0.0.4-rc.0 → 0.0.4

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 (40) hide show
  1. package/config.json +5 -0
  2. package/lib/config.json +5 -0
  3. package/lib/src/api-clients/git-lab/GitLabApiClient.js +89 -0
  4. package/lib/src/api-clients/git-lab/GitLabMapper.js +19 -1
  5. package/lib/src/api-clients/index.js +1 -0
  6. package/lib/src/api-clients/team-city/TeamCityApiClient.js +85 -0
  7. package/lib/src/commands/ReleaseCommand.js +12 -3
  8. package/lib/src/commands/StartConsumingProjectBuildsCommand.js +76 -0
  9. package/lib/src/commands/TagMasterCommand.js +76 -0
  10. package/lib/src/commands/index.js +2 -0
  11. package/lib/src/constants/CommandTypeMapping.js +3 -1
  12. package/lib/src/constants/TeamCityBuildIDs.js +13 -0
  13. package/lib/src/interfaces/command-cli-options/ReleaseCommandCliOptions.js +2 -0
  14. package/lib/src/interfaces/command-cli-options/index.js +18 -0
  15. package/lib/src/interfaces/command-options/DockerMilestoneCommandOptions.js +2 -0
  16. package/lib/src/interfaces/command-options/ReleaseCommandOptions.js +2 -0
  17. package/lib/src/interfaces/command-options/index.js +2 -1
  18. package/lib/src/interfaces/index.js +1 -0
  19. package/lib/src/interfaces/models/Label.js +2 -0
  20. package/lib/src/interfaces/models/Release.js +2 -0
  21. package/lib/src/interfaces/models/index.js +2 -0
  22. package/lib/src/inversify.config.js +10 -0
  23. package/lib/src/services/GitLabService.js +147 -8
  24. package/lib/src/services/TeamCityService.js +34 -0
  25. package/lib/src/services/index.js +1 -0
  26. package/lib/src/startup/AddMilestoneCommand.js +2 -1
  27. package/lib/src/startup/SetupCommands.js +86 -2
  28. package/lib/src/tasks/CommitPackageVersionsTask.js +12 -1
  29. package/lib/src/tasks/InstallPackagesTask.js +26 -47
  30. package/lib/src/tasks/StartConsumingProjectBuildsTask.js +143 -0
  31. package/lib/src/tasks/StartMonorepoBuildTask.js +95 -0
  32. package/lib/src/tasks/TagMasterTask.js +122 -0
  33. package/lib/src/tasks/ValidateDescriptionsTask.js +15 -11
  34. package/lib/src/tasks/ValidateMergeRequestTask.js +12 -6
  35. package/lib/src/tasks/ValidateTask.js +2 -2
  36. package/lib/src/tasks/index.js +3 -0
  37. package/lib/src/types.js +10 -2
  38. package/lib/src/utils/ProjectIds.js +4 -8
  39. package/package.json +4 -3
  40. /package/lib/src/interfaces/{command-options/InstallPackagesCommandOptions.js → command-cli-options/MilestoneCommandCliOptions.js} +0 -0
package/config.json CHANGED
@@ -2,5 +2,10 @@
2
2
  "gitLab": {
3
3
  "accessToken": "glpat-YK8GmVgXRRf3zBe3JQze",
4
4
  "url": "https://gitlab.cvinternal.net"
5
+ },
6
+ "teamCity": {
7
+ "url": "http://build.cvinternal.net/",
8
+ "username": "shale.kuzmanovski",
9
+ "password": "final2&ergot"
5
10
  }
6
11
  }
package/lib/config.json CHANGED
@@ -2,5 +2,10 @@
2
2
  "gitLab": {
3
3
  "accessToken": "glpat-YK8GmVgXRRf3zBe3JQze",
4
4
  "url": "https://gitlab.cvinternal.net"
5
+ },
6
+ "teamCity": {
7
+ "url": "http://build.cvinternal.net/",
8
+ "username": "shale.kuzmanovski",
9
+ "password": "final2&ergot"
5
10
  }
6
11
  }
@@ -122,6 +122,58 @@ var GitLabApiClient = /** @class */ (function () {
122
122
  });
123
123
  });
124
124
  };
125
+ GitLabApiClient.prototype.getTag = function (projectId, tagName) {
126
+ return __awaiter(this, void 0, void 0, function () {
127
+ var tag, _a;
128
+ return __generator(this, function (_b) {
129
+ switch (_b.label) {
130
+ case 0:
131
+ _b.trys.push([0, 2, , 3]);
132
+ return [4 /*yield*/, this.client.Tags.show(projectId, tagName)];
133
+ case 1:
134
+ tag = _b.sent();
135
+ return [2 /*return*/, GitLabMapper_1.GitLabMapper.tag(tag)];
136
+ case 2:
137
+ _a = _b.sent();
138
+ return [2 /*return*/, null];
139
+ case 3: return [2 /*return*/];
140
+ }
141
+ });
142
+ });
143
+ };
144
+ GitLabApiClient.prototype.createTag = function (projectId, tagName, sha) {
145
+ return __awaiter(this, void 0, void 0, function () {
146
+ var tag;
147
+ return __generator(this, function (_a) {
148
+ switch (_a.label) {
149
+ case 0: return [4 /*yield*/, this.client.Tags.create(projectId, tagName, sha)];
150
+ case 1:
151
+ tag = _a.sent();
152
+ return [2 /*return*/, GitLabMapper_1.GitLabMapper.tag(tag)];
153
+ }
154
+ });
155
+ });
156
+ };
157
+ GitLabApiClient.prototype.createRelease = function (projectId, release) {
158
+ return __awaiter(this, void 0, void 0, function () {
159
+ var newRelease;
160
+ return __generator(this, function (_a) {
161
+ switch (_a.label) {
162
+ case 0: return [4 /*yield*/, this.client.Releases.create(projectId, {
163
+ id: projectId,
164
+ name: release.name,
165
+ tag_name: release.tag,
166
+ description: release.description,
167
+ ref: release.ref,
168
+ milestones: release.milestones
169
+ })];
170
+ case 1:
171
+ newRelease = _a.sent();
172
+ return [2 /*return*/, GitLabMapper_1.GitLabMapper.release(newRelease)];
173
+ }
174
+ });
175
+ });
176
+ };
125
177
  GitLabApiClient.prototype.getCommitsSince = function (projectId, branchName, sinceSha) {
126
178
  return __awaiter(this, void 0, void 0, function () {
127
179
  var commit, commits;
@@ -228,6 +280,30 @@ var GitLabApiClient = /** @class */ (function () {
228
280
  });
229
281
  });
230
282
  };
283
+ GitLabApiClient.prototype.getReleaseMergeRequest = function (projectId, milestone) {
284
+ return __awaiter(this, void 0, void 0, function () {
285
+ var mergeRequests, releaseMR;
286
+ return __generator(this, function (_a) {
287
+ switch (_a.label) {
288
+ case 0: return [4 /*yield*/, this.client.MergeRequests.all({
289
+ projectId: projectId,
290
+ targetBranch: 'master',
291
+ /**
292
+ * We only care about open MRs, this allows us to close any MR and run the CLI again if needed
293
+ */
294
+ state: 'opened',
295
+ milestone: milestone
296
+ })];
297
+ case 1:
298
+ mergeRequests = _a.sent();
299
+ releaseMR = mergeRequests[0];
300
+ if (!releaseMR)
301
+ return [2 /*return*/, null];
302
+ return [2 /*return*/, GitLabMapper_1.GitLabMapper.mergeRequest(releaseMR)];
303
+ }
304
+ });
305
+ });
306
+ };
231
307
  GitLabApiClient.prototype.createMergeRequest = function (projectId, sourceBranch, targetBranch, title, description, milestone) {
232
308
  return __awaiter(this, void 0, void 0, function () {
233
309
  var mergeRequest;
@@ -307,6 +383,19 @@ var GitLabApiClient = /** @class */ (function () {
307
383
  });
308
384
  });
309
385
  };
386
+ GitLabApiClient.prototype.getLabels = function (projectId) {
387
+ return __awaiter(this, void 0, void 0, function () {
388
+ var labels;
389
+ return __generator(this, function (_a) {
390
+ switch (_a.label) {
391
+ case 0: return [4 /*yield*/, this.client.Labels.all(projectId)];
392
+ case 1:
393
+ labels = _a.sent();
394
+ return [2 /*return*/, labels.map(GitLabMapper_1.GitLabMapper.label)];
395
+ }
396
+ });
397
+ });
398
+ };
310
399
  GitLabApiClient = __decorate([
311
400
  (0, inversify_1.injectable)(),
312
401
  __param(0, (0, inversify_1.inject)(types_1.MISC.GitLabConfig)),
@@ -15,7 +15,9 @@ exports.GitLabMapper = {
15
15
  url: m.web_url,
16
16
  hasConflicts: m.has_conflicts,
17
17
  targetBranch: m.target_branch,
18
- milestone: exports.GitLabMapper.milestone(m.milestone)
18
+ sourceBranch: m.source_branch,
19
+ milestone: exports.GitLabMapper.milestone(m.milestone),
20
+ labels: m.labels
19
21
  };
20
22
  },
21
23
  project: function (p) {
@@ -56,5 +58,21 @@ exports.GitLabMapper = {
56
58
  id: m.id,
57
59
  name: m.title
58
60
  };
61
+ },
62
+ label: function (m) {
63
+ return {
64
+ name: m.name,
65
+ description: m.description
66
+ };
67
+ },
68
+ release: function (m) {
69
+ var _a;
70
+ return {
71
+ name: m.name,
72
+ tag: m.tag_name,
73
+ description: m.description,
74
+ ref: m.commit.id,
75
+ milestones: (_a = m.milestones) === null || _a === void 0 ? void 0 : _a.map(function (m) { return m.title; })
76
+ };
59
77
  }
60
78
  };
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./git-lab/GitLabApiClient"), exports);
18
+ __exportStar(require("./team-city/TeamCityApiClient"), exports);
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ var __generator = (this && this.__generator) || function (thisArg, body) {
24
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
25
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
26
+ function verb(n) { return function (v) { return step([n, v]); }; }
27
+ function step(op) {
28
+ if (f) throw new TypeError("Generator is already executing.");
29
+ while (_) try {
30
+ 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;
31
+ if (y = 0, t) op = [op[0] & 2, t.value];
32
+ switch (op[0]) {
33
+ case 0: case 1: t = op; break;
34
+ case 4: _.label++; return { value: op[1], done: false };
35
+ case 5: _.label++; y = op[1]; op = [0]; continue;
36
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
37
+ default:
38
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
39
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
40
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
41
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
42
+ if (t[2]) _.ops.pop();
43
+ _.trys.pop(); continue;
44
+ }
45
+ op = body.call(thisArg, _);
46
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
47
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
48
+ }
49
+ };
50
+ var __importDefault = (this && this.__importDefault) || function (mod) {
51
+ return (mod && mod.__esModule) ? mod : { "default": mod };
52
+ };
53
+ Object.defineProperty(exports, "__esModule", { value: true });
54
+ exports.TeamCityApiClient = void 0;
55
+ require("reflect-metadata");
56
+ var teamcity_rest_api_1 = __importDefault(require("teamcity-rest-api"));
57
+ var inversify_1 = require("inversify");
58
+ var types_1 = require("../../types");
59
+ var TeamCityApiClient = /** @class */ (function () {
60
+ function TeamCityApiClient(config) {
61
+ this.client = teamcity_rest_api_1.default.create(config);
62
+ }
63
+ TeamCityApiClient.prototype.startBuild = function (buildId, branchName) {
64
+ return __awaiter(this, void 0, void 0, function () {
65
+ var buildXml, build;
66
+ return __generator(this, function (_a) {
67
+ switch (_a.label) {
68
+ case 0:
69
+ buildXml = "\n <build branchName=\"".concat(branchName, "\">\n <buildType id=\"").concat(buildId, "\" />\n </build>\n ");
70
+ return [4 /*yield*/, this.client.builds.startBuild(buildXml)];
71
+ case 1:
72
+ build = _a.sent();
73
+ return [2 /*return*/, build];
74
+ }
75
+ });
76
+ });
77
+ };
78
+ TeamCityApiClient = __decorate([
79
+ (0, inversify_1.injectable)(),
80
+ __param(0, (0, inversify_1.inject)(types_1.MISC.TeamCityConfig)),
81
+ __metadata("design:paramtypes", [Object])
82
+ ], TeamCityApiClient);
83
+ return TeamCityApiClient;
84
+ }());
85
+ exports.TeamCityApiClient = TeamCityApiClient;
@@ -53,7 +53,7 @@ require("reflect-metadata");
53
53
  var inversify_1 = require("inversify");
54
54
  var types_1 = require("../types");
55
55
  var ReleaseCommand = /** @class */ (function () {
56
- function ReleaseCommand(validateTask, versionTask, validateDescriptionsTask, validateCommitsTask, createBranchTask, bumpVersionTxtTask, createMergeRequestTask) {
56
+ function ReleaseCommand(validateTask, versionTask, validateDescriptionsTask, validateCommitsTask, createBranchTask, bumpVersionTxtTask, createMergeRequestTask, startMonorepoBuildTask) {
57
57
  this.validateTask = validateTask;
58
58
  this.versionTask = versionTask;
59
59
  this.validateDescriptionsTask = validateDescriptionsTask;
@@ -61,6 +61,7 @@ var ReleaseCommand = /** @class */ (function () {
61
61
  this.createBranchTask = createBranchTask;
62
62
  this.bumpVersionTxtTask = bumpVersionTxtTask;
63
63
  this.createMergeRequestTask = createMergeRequestTask;
64
+ this.startMonorepoBuildTask = startMonorepoBuildTask;
64
65
  }
65
66
  ReleaseCommand.prototype.run = function (options) {
66
67
  return __awaiter(this, void 0, void 0, function () {
@@ -99,7 +100,14 @@ var ReleaseCommand = /** @class */ (function () {
99
100
  if (!cont)
100
101
  return [2 /*return*/, false];
101
102
  return [4 /*yield*/, this.createMergeRequestTask.run(options)];
102
- case 7: return [2 /*return*/, _a.sent()];
103
+ case 7:
104
+ cont = _a.sent();
105
+ if (!cont)
106
+ return [2 /*return*/, false];
107
+ if (!options.triggerMonorepoBuild)
108
+ return [2 /*return*/, true];
109
+ return [4 /*yield*/, this.startMonorepoBuildTask.run(options)];
110
+ case 8: return [2 /*return*/, _a.sent()];
103
111
  }
104
112
  });
105
113
  });
@@ -113,7 +121,8 @@ var ReleaseCommand = /** @class */ (function () {
113
121
  __param(4, (0, inversify_1.inject)(types_1.TASKS.CreateBranchTask)),
114
122
  __param(5, (0, inversify_1.inject)(types_1.TASKS.BumpVersionTxtTask)),
115
123
  __param(6, (0, inversify_1.inject)(types_1.TASKS.CreateMergeRequestTask)),
116
- __metadata("design:paramtypes", [Object, Object, Object, Object, Object, Object, Object])
124
+ __param(7, (0, inversify_1.inject)(types_1.TASKS.StartMonorepoBuildTask)),
125
+ __metadata("design:paramtypes", [Object, Object, Object, Object, Object, Object, Object, Object])
117
126
  ], ReleaseCommand);
118
127
  return ReleaseCommand;
119
128
  }());
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ var __generator = (this && this.__generator) || function (thisArg, body) {
24
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
25
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
26
+ function verb(n) { return function (v) { return step([n, v]); }; }
27
+ function step(op) {
28
+ if (f) throw new TypeError("Generator is already executing.");
29
+ while (_) try {
30
+ 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;
31
+ if (y = 0, t) op = [op[0] & 2, t.value];
32
+ switch (op[0]) {
33
+ case 0: case 1: t = op; break;
34
+ case 4: _.label++; return { value: op[1], done: false };
35
+ case 5: _.label++; y = op[1]; op = [0]; continue;
36
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
37
+ default:
38
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
39
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
40
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
41
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
42
+ if (t[2]) _.ops.pop();
43
+ _.trys.pop(); continue;
44
+ }
45
+ op = body.call(thisArg, _);
46
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
47
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
48
+ }
49
+ };
50
+ Object.defineProperty(exports, "__esModule", { value: true });
51
+ exports.StartConsumingProjectBuildsCommand = void 0;
52
+ require("reflect-metadata");
53
+ var inversify_1 = require("inversify");
54
+ var types_1 = require("../types");
55
+ var StartConsumingProjectBuildsCommand = /** @class */ (function () {
56
+ function StartConsumingProjectBuildsCommand(startConsumingProjectBuildsTask) {
57
+ this.startConsumingProjectBuildsTask = startConsumingProjectBuildsTask;
58
+ }
59
+ StartConsumingProjectBuildsCommand.prototype.run = function (options) {
60
+ return __awaiter(this, void 0, void 0, function () {
61
+ return __generator(this, function (_a) {
62
+ switch (_a.label) {
63
+ case 0: return [4 /*yield*/, this.startConsumingProjectBuildsTask.run(options)];
64
+ case 1: return [2 /*return*/, _a.sent()];
65
+ }
66
+ });
67
+ });
68
+ };
69
+ StartConsumingProjectBuildsCommand = __decorate([
70
+ (0, inversify_1.injectable)(),
71
+ __param(0, (0, inversify_1.inject)(types_1.TASKS.StartConsumingProjectBuildsTask)),
72
+ __metadata("design:paramtypes", [Object])
73
+ ], StartConsumingProjectBuildsCommand);
74
+ return StartConsumingProjectBuildsCommand;
75
+ }());
76
+ exports.StartConsumingProjectBuildsCommand = StartConsumingProjectBuildsCommand;
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ var __generator = (this && this.__generator) || function (thisArg, body) {
24
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
25
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
26
+ function verb(n) { return function (v) { return step([n, v]); }; }
27
+ function step(op) {
28
+ if (f) throw new TypeError("Generator is already executing.");
29
+ while (_) try {
30
+ 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;
31
+ if (y = 0, t) op = [op[0] & 2, t.value];
32
+ switch (op[0]) {
33
+ case 0: case 1: t = op; break;
34
+ case 4: _.label++; return { value: op[1], done: false };
35
+ case 5: _.label++; y = op[1]; op = [0]; continue;
36
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
37
+ default:
38
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
39
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
40
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
41
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
42
+ if (t[2]) _.ops.pop();
43
+ _.trys.pop(); continue;
44
+ }
45
+ op = body.call(thisArg, _);
46
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
47
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
48
+ }
49
+ };
50
+ Object.defineProperty(exports, "__esModule", { value: true });
51
+ exports.TagMasterCommand = void 0;
52
+ require("reflect-metadata");
53
+ var inversify_1 = require("inversify");
54
+ var types_1 = require("../types");
55
+ var TagMasterCommand = /** @class */ (function () {
56
+ function TagMasterCommand(tagMasterTask) {
57
+ this.tagMasterTask = tagMasterTask;
58
+ }
59
+ TagMasterCommand.prototype.run = function (options) {
60
+ return __awaiter(this, void 0, void 0, function () {
61
+ return __generator(this, function (_a) {
62
+ switch (_a.label) {
63
+ case 0: return [4 /*yield*/, this.tagMasterTask.run(options)];
64
+ case 1: return [2 /*return*/, _a.sent()];
65
+ }
66
+ });
67
+ });
68
+ };
69
+ TagMasterCommand = __decorate([
70
+ (0, inversify_1.injectable)(),
71
+ __param(0, (0, inversify_1.inject)(types_1.TASKS.TagMasterTask)),
72
+ __metadata("design:paramtypes", [Object])
73
+ ], TagMasterCommand);
74
+ return TagMasterCommand;
75
+ }());
76
+ exports.TagMasterCommand = TagMasterCommand;
@@ -20,6 +20,8 @@ __exportStar(require("./CreateMergeRequestCommand"), exports);
20
20
  __exportStar(require("./CreateReleaseNotesCommand"), exports);
21
21
  __exportStar(require("./InstallPackagesCommand"), exports);
22
22
  __exportStar(require("./ReleaseCommand"), exports);
23
+ __exportStar(require("./StartConsumingProjectBuildsCommand"), exports);
23
24
  __exportStar(require("./StatusCommand"), exports);
25
+ __exportStar(require("./TagMasterCommand"), exports);
24
26
  __exportStar(require("./ValidateMergeRequestCommand"), exports);
25
27
  __exportStar(require("./VersionCommand"), exports);
@@ -11,5 +11,7 @@ exports.CommandTypeMapping = {
11
11
  'create-notes': types_1.COMMANDS.CreateReleaseNotesCommand,
12
12
  'install-packages': types_1.COMMANDS.InstallPackagesCommand,
13
13
  'bump-packages': types_1.COMMANDS.BumpPackagesCommand,
14
- 'validate-mr': types_1.COMMANDS.ValidateMergeRequestCommand
14
+ 'validate-mr': types_1.COMMANDS.ValidateMergeRequestCommand,
15
+ 'start-consuming-project-builds': types_1.COMMANDS.StartConsumingProjectBuildsCommand,
16
+ 'tag-master': types_1.COMMANDS.TagMasterCommand
15
17
  };
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var _a;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.TeamCityBuildIds = void 0;
5
+ var utils_1 = require("../utils");
6
+ exports.TeamCityBuildIds = (_a = {},
7
+ _a[utils_1.PROJECT_NAMES.monorepo] = 'Frontend_BuildAndPublishReleaseCandidate',
8
+ _a[utils_1.PROJECT_NAMES.online] = 'online_web_build_and_package',
9
+ _a[utils_1.PROJECT_NAMES.curator] = 'curator_web_build_and_package',
10
+ _a[utils_1.PROJECT_NAMES.cloud] = 'ClickViewCloud_BuildAndPackageDocker',
11
+ _a[utils_1.PROJECT_NAMES.reports] = 'Web_AnalyticsWeb_BuildAndPackageDocker',
12
+ _a[utils_1.PROJECT_NAMES.lite] = 'ClickViewLiteWeb_BuildAndPackageDocker',
13
+ _a);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./MilestoneCommandCliOptions"), exports);
18
+ __exportStar(require("./ReleaseCommandCliOptions"), exports);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./BumpPackagesCommandOptions"), exports);
18
- __exportStar(require("./InstallPackagesCommandOptions"), exports);
18
+ __exportStar(require("./DockerMilestoneCommandOptions"), exports);
19
19
  __exportStar(require("./MilestoneCommandOptions"), exports);
20
20
  __exportStar(require("./ValidateMRCommandOptions"), exports);
21
+ __exportStar(require("./ReleaseCommandOptions"), exports);
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./command-cli-options"), exports);
17
18
  __exportStar(require("./command-options"), exports);
18
19
  __exportStar(require("./models"), exports);
19
20
  __exportStar(require("./view-models"), exports);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -18,7 +18,9 @@ __exportStar(require("./Branch"), exports);
18
18
  __exportStar(require("./Commit"), exports);
19
19
  __exportStar(require("./CommitFile"), exports);
20
20
  __exportStar(require("./File"), exports);
21
+ __exportStar(require("./Label"), exports);
21
22
  __exportStar(require("./MergeRequest"), exports);
22
23
  __exportStar(require("./Milestone"), exports);
23
24
  __exportStar(require("./Project"), exports);
25
+ __exportStar(require("./Release"), exports);
24
26
  __exportStar(require("./Tag"), exports);
@@ -13,14 +13,17 @@ function createContainer(config) {
13
13
  * Misc
14
14
  */
15
15
  container.bind(types_1.MISC.GitLabConfig).toConstantValue(config.gitLab);
16
+ container.bind(types_1.MISC.TeamCityConfig).toConstantValue(config.teamCity);
16
17
  /**
17
18
  * Clients
18
19
  */
19
20
  container.bind(types_1.API_CLIENTS.GitLabApiClient).to(api_clients_1.GitLabApiClient);
21
+ container.bind(types_1.API_CLIENTS.TeamCityApiClient).to(api_clients_1.TeamCityApiClient);
20
22
  /**
21
23
  * Services
22
24
  */
23
25
  container.bind(types_1.SERVICES.GitLabService).to(services_1.GitLabService).inSingletonScope();
26
+ container.bind(types_1.SERVICES.TeamCityService).to(services_1.TeamCityService).inSingletonScope();
24
27
  /**
25
28
  * Tasks
26
29
  */
@@ -36,6 +39,10 @@ function createContainer(config) {
36
39
  container.bind(types_1.TASKS.BumpPackagesTask).to(tasks_1.BumpPackagesTask);
37
40
  container.bind(types_1.TASKS.CommitPackageVersionsTask).to(tasks_1.CommitPackageVersionsTask);
38
41
  container.bind(types_1.TASKS.ValidateMergeRequestTask).to(tasks_1.ValidateMergeRequestTask);
42
+ container.bind(types_1.TASKS.StartMonorepoBuildTask).to(tasks_1.StartMonorepoBuildTask);
43
+ container.bind(types_1.TASKS.TagMasterTask).to(tasks_1.TagMasterTask);
44
+ container.bind(types_1.TASKS.StartConsumingProjectBuildsTask)
45
+ .to(tasks_1.StartConsumingProjectBuildsTask);
39
46
  /**
40
47
  * Commands
41
48
  */
@@ -48,6 +55,9 @@ function createContainer(config) {
48
55
  container.bind(types_1.COMMANDS.InstallPackagesCommand).to(commands_1.InstallPackagesCommand);
49
56
  container.bind(types_1.COMMANDS.BumpPackagesCommand).to(commands_1.BumpPackagesCommand);
50
57
  container.bind(types_1.COMMANDS.ValidateMergeRequestCommand).to(commands_1.ValidateMergeRequestCommand);
58
+ container.bind(types_1.COMMANDS.TagMasterCommand).to(commands_1.TagMasterCommand);
59
+ container.bind(types_1.COMMANDS.StartConsumingProjectBuildsCommand)
60
+ .to(commands_1.StartConsumingProjectBuildsCommand);
51
61
  return container;
52
62
  }
53
63
  exports.createContainer = createContainer;