@clickview/ship-it 0.0.43-rc.1 → 0.0.43
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/Dockerfile +7 -3
- package/lib/src/api-clients/git-lab/GitLabApiClient.js +1 -1
- package/lib/src/commands/CreateHotfixCommand.js +76 -0
- package/lib/src/commands/index.js +1 -0
- package/lib/src/constants/CommandTypeMapping.js +2 -1
- package/lib/src/interfaces/command-options/CreateHotfixCommandOptions.js +2 -0
- package/lib/src/interfaces/command-options/index.js +1 -0
- package/lib/src/inversify.config.js +2 -0
- package/lib/src/services/GitLabService.js +38 -7
- package/lib/src/startup/SetupCommands.js +9 -0
- package/lib/src/tasks/CreateHotfixTask.js +126 -0
- package/lib/src/tasks/index.js +1 -0
- package/lib/src/types.js +3 -1
- package/package.json +1 -1
- package/temp/Tooling-N1/Analytics Web/package-lock.json +0 -2320
- package/temp/Tooling-N1/Analytics Web/package.json +0 -46
- package/temp/Tooling-N1/ClickView Online/package-lock.json +0 -13944
- package/temp/Tooling-N1/ClickView Online/package.json +0 -152
- package/temp/Tooling-N1/ClickView.Curator/package-lock.json +0 -10414
- package/temp/Tooling-N1/ClickView.Curator/package.json +0 -39
- package/temp/Tooling-N1/Exchange.Web/package-lock.json +0 -2014
- package/temp/Tooling-N1/Exchange.Web/package.json +0 -41
- package/temp/Tooling-N1/Library Editor/package-lock.json +0 -2844
- package/temp/Tooling-N1/Library Editor/package.json +0 -48
- package/temp/Tooling-N1/Lite/package-lock.json +0 -2664
- package/temp/Tooling-N1/Lite/package.json +0 -56
- package/temp/Tooling-N1/Master.Auth/package-lock.json +0 -2488
- package/temp/Tooling-N1/Master.Auth/package.json +0 -27
- package/temp/Tooling-N1/StreamableLearning.Web/package-lock.json +0 -2099
- package/temp/Tooling-N1/StreamableLearning.Web/package.json +0 -45
package/Dockerfile
CHANGED
|
@@ -30,8 +30,12 @@ RUN npm link
|
|
|
30
30
|
|
|
31
31
|
RUN cliOptions=$(echo "$options" | sed -e 's/^"//' -e 's/"$//') && \
|
|
32
32
|
echo "Build option: $cliOptions" && \
|
|
33
|
-
if [ "$milestone"
|
|
34
|
-
|
|
33
|
+
if [ -n "$milestone" ]; then \
|
|
34
|
+
if [ "$milestone" = "sprint" ]; then \
|
|
35
|
+
ship-it $command -s $sprint $cliOptions; \
|
|
36
|
+
else \
|
|
37
|
+
ship-it $command -m $milestone $cliOptions; \
|
|
38
|
+
fi \
|
|
35
39
|
else \
|
|
36
|
-
ship-it $command
|
|
40
|
+
ship-it $command $cliOptions; \
|
|
37
41
|
fi
|
|
@@ -341,7 +341,7 @@ var GitLabApiClient = /** @class */ (function () {
|
|
|
341
341
|
projectId = options.projectId, sourceBranch = options.sourceBranch, targetBranch = options.targetBranch, title = options.title, description = options.description, milestone = options.milestone, removeSourceBranch = options.removeSourceBranch;
|
|
342
342
|
return [4 /*yield*/, this.client.MergeRequests.create(projectId, sourceBranch, targetBranch, title, {
|
|
343
343
|
description: description,
|
|
344
|
-
milestoneId: milestone.id,
|
|
344
|
+
milestoneId: milestone === null || milestone === void 0 ? void 0 : milestone.id,
|
|
345
345
|
assigneeId: GitLabMemberIds_1.GitLabMemberIds.SHIP_IT,
|
|
346
346
|
removeSourceBranch: removeSourceBranch
|
|
347
347
|
})];
|
|
@@ -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.CreateHotfixCommand = void 0;
|
|
52
|
+
require("reflect-metadata");
|
|
53
|
+
var inversify_1 = require("inversify");
|
|
54
|
+
var types_1 = require("../types");
|
|
55
|
+
var CreateHotfixCommand = /** @class */ (function () {
|
|
56
|
+
function CreateHotfixCommand(createHotfixTask) {
|
|
57
|
+
this.createHotfixTask = createHotfixTask;
|
|
58
|
+
}
|
|
59
|
+
CreateHotfixCommand.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.createHotfixTask.run(options)];
|
|
64
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
CreateHotfixCommand = __decorate([
|
|
70
|
+
(0, inversify_1.injectable)(),
|
|
71
|
+
__param(0, (0, inversify_1.inject)(types_1.TASKS.CreateHotfixTask)),
|
|
72
|
+
__metadata("design:paramtypes", [Object])
|
|
73
|
+
], CreateHotfixCommand);
|
|
74
|
+
return CreateHotfixCommand;
|
|
75
|
+
}());
|
|
76
|
+
exports.CreateHotfixCommand = CreateHotfixCommand;
|
|
@@ -30,3 +30,4 @@ __exportStar(require("./TagMasterCommand"), exports);
|
|
|
30
30
|
__exportStar(require("./ValidateMergeRequestCommand"), exports);
|
|
31
31
|
__exportStar(require("./VersionCommand"), exports);
|
|
32
32
|
__exportStar(require("./CreateTrelloCardsCommand"), exports);
|
|
33
|
+
__exportStar(require("./CreateHotfixCommand"), exports);
|
|
@@ -18,5 +18,6 @@ exports.CommandTypeMapping = {
|
|
|
18
18
|
'tag-master': types_1.COMMANDS.TagMasterCommand,
|
|
19
19
|
'list-projects': types_1.COMMANDS.ListProjectsCommand,
|
|
20
20
|
'create-trello-cards': types_1.COMMANDS.CreateTrelloCardsCommand,
|
|
21
|
-
'configure-projects': types_1.COMMANDS.ConfigureProjectsCommand
|
|
21
|
+
'configure-projects': types_1.COMMANDS.ConfigureProjectsCommand,
|
|
22
|
+
'create-hotfix': types_1.COMMANDS.CreateHotfixCommand
|
|
22
23
|
};
|
|
@@ -21,4 +21,5 @@ __exportStar(require("./ValidateMRCommandOptions"), exports);
|
|
|
21
21
|
__exportStar(require("./ReleaseCommandOptions"), exports);
|
|
22
22
|
__exportStar(require("./StatusCommandOptions"), exports);
|
|
23
23
|
__exportStar(require("./ConfigureProjectsOptions"), exports);
|
|
24
|
+
__exportStar(require("./CreateHotfixCommandOptions"), exports);
|
|
24
25
|
__exportStar(require("./ToolingReleaseCommandOptions"), exports);
|
|
@@ -56,6 +56,7 @@ function createContainer(config) {
|
|
|
56
56
|
container.bind(types_1.TASKS.AddApprovalRulesTask).to(tasks_1.AddApprovalRulesTask);
|
|
57
57
|
container.bind(types_1.TASKS.EnsureApprovalRulesTask).to(EnsureApprovalRulesTask_1.EnsureApprovalRulesTask);
|
|
58
58
|
container.bind(types_1.TASKS.CreateToolingBranchTask).to(tasks_1.CreateToolingBranchTask);
|
|
59
|
+
container.bind(types_1.TASKS.CreateHotfixTask).to(tasks_1.CreateHotfixTask);
|
|
59
60
|
container.bind(types_1.TASKS.ChangeMilestoneTask).to(ChangeMilestoneTask_1.ChangeMilestoneTask);
|
|
60
61
|
/**
|
|
61
62
|
* Commands
|
|
@@ -77,6 +78,7 @@ function createContainer(config) {
|
|
|
77
78
|
container.bind(types_1.COMMANDS.StartProjectBuildsCommand)
|
|
78
79
|
.to(commands_1.StartProjectBuildsCommand);
|
|
79
80
|
container.bind(types_1.COMMANDS.ConfigureProjectsCommand).to(commands_1.ConfigureProjectsCommand);
|
|
81
|
+
container.bind(types_1.COMMANDS.CreateHotfixCommand).to(commands_1.CreateHotfixCommand);
|
|
80
82
|
return container;
|
|
81
83
|
}
|
|
82
84
|
exports.createContainer = createContainer;
|
|
@@ -454,6 +454,28 @@ var GitLabService = /** @class */ (function () {
|
|
|
454
454
|
});
|
|
455
455
|
});
|
|
456
456
|
};
|
|
457
|
+
GitLabService.prototype.getCurrentPatchVersionTag = function (projectId) {
|
|
458
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
459
|
+
var tags, tagNames, sortedTagNames, currentTag;
|
|
460
|
+
return __generator(this, function (_a) {
|
|
461
|
+
switch (_a.label) {
|
|
462
|
+
case 0: return [4 /*yield*/, this.apiClient.getLatestTags(projectId)];
|
|
463
|
+
case 1:
|
|
464
|
+
tags = _a.sent();
|
|
465
|
+
if (!(tags === null || tags === void 0 ? void 0 : tags.length))
|
|
466
|
+
throw new errors_1.ShipItError("Project ".concat(projectId, " does not have any tags"));
|
|
467
|
+
tagNames = tags.map(function (t) { return t.name; }).filter(function (t) { return semver_1.default.valid(t); });
|
|
468
|
+
if (!tagNames.length)
|
|
469
|
+
return [2 /*return*/, null];
|
|
470
|
+
sortedTagNames = semver_1.default.sort(tagNames).reverse();
|
|
471
|
+
currentTag = tags.find(function (t) { return t.name === sortedTagNames[0]; });
|
|
472
|
+
if (!currentTag)
|
|
473
|
+
return [2 /*return*/, null];
|
|
474
|
+
return [2 /*return*/, currentTag];
|
|
475
|
+
}
|
|
476
|
+
});
|
|
477
|
+
});
|
|
478
|
+
};
|
|
457
479
|
GitLabService.prototype.hasSomeTags = function (projectId) {
|
|
458
480
|
return __awaiter(this, void 0, void 0, function () {
|
|
459
481
|
var tags;
|
|
@@ -469,12 +491,21 @@ var GitLabService = /** @class */ (function () {
|
|
|
469
491
|
};
|
|
470
492
|
GitLabService.prototype.getNextBranchInfo = function (projectId, version) {
|
|
471
493
|
return __awaiter(this, void 0, void 0, function () {
|
|
472
|
-
var tag, nextVersion, branchName, branch;
|
|
473
|
-
return __generator(this, function (
|
|
474
|
-
switch (
|
|
475
|
-
case 0:
|
|
494
|
+
var tag, _a, nextVersion, branchName, branch;
|
|
495
|
+
return __generator(this, function (_b) {
|
|
496
|
+
switch (_b.label) {
|
|
497
|
+
case 0:
|
|
498
|
+
if (!(version === 'patch')) return [3 /*break*/, 2];
|
|
499
|
+
return [4 /*yield*/, this.getCurrentPatchVersionTag(projectId)];
|
|
476
500
|
case 1:
|
|
477
|
-
|
|
501
|
+
_a = _b.sent();
|
|
502
|
+
return [3 /*break*/, 4];
|
|
503
|
+
case 2: return [4 /*yield*/, this.getCurrentMinorVersionTag(projectId)];
|
|
504
|
+
case 3:
|
|
505
|
+
_a = _b.sent();
|
|
506
|
+
_b.label = 4;
|
|
507
|
+
case 4:
|
|
508
|
+
tag = _a;
|
|
478
509
|
if (!tag)
|
|
479
510
|
throw new errors_1.ShipItError("Could not find the latest semver tag for projectId: ".concat(projectId));
|
|
480
511
|
nextVersion = utils_1.Versions.getNextVersion(tag.name, version);
|
|
@@ -482,8 +513,8 @@ var GitLabService = /** @class */ (function () {
|
|
|
482
513
|
utils_1.BranchNames.getHotfix(nextVersion) :
|
|
483
514
|
utils_1.BranchNames.getRelease(nextVersion);
|
|
484
515
|
return [4 /*yield*/, this.getBranch(projectId, branchName)];
|
|
485
|
-
case
|
|
486
|
-
branch =
|
|
516
|
+
case 5:
|
|
517
|
+
branch = _b.sent();
|
|
487
518
|
return [2 /*return*/, {
|
|
488
519
|
nextVersion: nextVersion,
|
|
489
520
|
branchName: branchName,
|
|
@@ -163,6 +163,15 @@ function setupCommands(program, container) {
|
|
|
163
163
|
.requiredOption('-b, --branchName <branchName>')
|
|
164
164
|
.option('-p, --preId <preId>')
|
|
165
165
|
.action(getAction('bump-packages'));
|
|
166
|
+
program.command('create-hotfix')
|
|
167
|
+
.description('Creates hotfix branches for given projects')
|
|
168
|
+
.requiredOption('-p, --projectIds <projectIds...>')
|
|
169
|
+
.action(function (opts) { return __awaiter(_this, void 0, void 0, function () {
|
|
170
|
+
return __generator(this, function (_a) {
|
|
171
|
+
opts.projectIds = utils_1.ProjectIds.getProjectIds(opts.projectIds);
|
|
172
|
+
return [2 /*return*/, getAction('create-hotfix')(opts)];
|
|
173
|
+
});
|
|
174
|
+
}); });
|
|
166
175
|
program.command('install-packages')
|
|
167
176
|
.description('Install the latest clickview npm packages in all consuming projects that are part of a milestone')
|
|
168
177
|
.option('-m, --milestone <milestone>')
|
|
@@ -0,0 +1,126 @@
|
|
|
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.CreateHotfixTask = void 0;
|
|
52
|
+
require("reflect-metadata");
|
|
53
|
+
var inversify_1 = require("inversify");
|
|
54
|
+
var types_1 = require("../types");
|
|
55
|
+
var services_1 = require("../services");
|
|
56
|
+
var utils_1 = require("../utils");
|
|
57
|
+
var CreateHotfixTask = /** @class */ (function () {
|
|
58
|
+
function CreateHotfixTask(service) {
|
|
59
|
+
this.service = service;
|
|
60
|
+
}
|
|
61
|
+
CreateHotfixTask.prototype.run = function (options) {
|
|
62
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
63
|
+
var _i, _a, id, project, _b, branch, branchName, nextVersion, versionBumped, mergeRequest;
|
|
64
|
+
return __generator(this, function (_c) {
|
|
65
|
+
switch (_c.label) {
|
|
66
|
+
case 0:
|
|
67
|
+
utils_1.Logger.logTask('Creating hotfix branches');
|
|
68
|
+
_i = 0, _a = options.projectIds;
|
|
69
|
+
_c.label = 1;
|
|
70
|
+
case 1:
|
|
71
|
+
if (!(_i < _a.length)) return [3 /*break*/, 8];
|
|
72
|
+
id = _a[_i];
|
|
73
|
+
return [4 /*yield*/, this.service.getProject(id)];
|
|
74
|
+
case 2:
|
|
75
|
+
project = _c.sent();
|
|
76
|
+
utils_1.Logger.logMessage(project.title);
|
|
77
|
+
return [4 /*yield*/, this.service.getNextBranchInfo(project.id, 'patch')];
|
|
78
|
+
case 3:
|
|
79
|
+
_b = _c.sent(), branch = _b.branch, branchName = _b.branchName, nextVersion = _b.nextVersion;
|
|
80
|
+
if (branch) {
|
|
81
|
+
utils_1.Logger.logWarning("[".concat(project.title, "]: [").concat(branchName, "] Already exists"));
|
|
82
|
+
return [3 /*break*/, 7];
|
|
83
|
+
}
|
|
84
|
+
// Create the branch
|
|
85
|
+
return [4 /*yield*/, this.service.createBranch(project, 'master', branchName)];
|
|
86
|
+
case 4:
|
|
87
|
+
// Create the branch
|
|
88
|
+
_c.sent();
|
|
89
|
+
utils_1.Logger.logMessage("[".concat(project.title, "]: [").concat(branchName, "] Has been created"));
|
|
90
|
+
return [4 /*yield*/, this.service.bumpVersionTxt(project.id, branchName, nextVersion)];
|
|
91
|
+
case 5:
|
|
92
|
+
versionBumped = _c.sent();
|
|
93
|
+
if (versionBumped)
|
|
94
|
+
utils_1.Logger.logMessage("[".concat(project.title, "]: Bumped to ").concat(nextVersion));
|
|
95
|
+
else
|
|
96
|
+
utils_1.Logger.logWarning("[".concat(project.title, "]: Has already been bumped, or does not have a version.txt"));
|
|
97
|
+
return [4 /*yield*/, this.service.createMergeRequest({
|
|
98
|
+
projectId: project.id,
|
|
99
|
+
sourceBranch: branchName,
|
|
100
|
+
targetBranch: 'master',
|
|
101
|
+
title: branchName,
|
|
102
|
+
description: '',
|
|
103
|
+
milestoneName: 'hotfix',
|
|
104
|
+
removeSourceBranch: true
|
|
105
|
+
})];
|
|
106
|
+
case 6:
|
|
107
|
+
mergeRequest = _c.sent();
|
|
108
|
+
utils_1.Logger.logMessage("[".concat(project.title, "]: MR created"));
|
|
109
|
+
utils_1.Logger.logInfo(mergeRequest.url);
|
|
110
|
+
_c.label = 7;
|
|
111
|
+
case 7:
|
|
112
|
+
_i++;
|
|
113
|
+
return [3 /*break*/, 1];
|
|
114
|
+
case 8: return [2 /*return*/, true];
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
CreateHotfixTask = __decorate([
|
|
120
|
+
(0, inversify_1.injectable)(),
|
|
121
|
+
__param(0, (0, inversify_1.inject)(types_1.SERVICES.GitLabService)),
|
|
122
|
+
__metadata("design:paramtypes", [services_1.GitLabService])
|
|
123
|
+
], CreateHotfixTask);
|
|
124
|
+
return CreateHotfixTask;
|
|
125
|
+
}());
|
|
126
|
+
exports.CreateHotfixTask = CreateHotfixTask;
|
package/lib/src/tasks/index.js
CHANGED
|
@@ -32,3 +32,4 @@ __exportStar(require("./ValidateMergeRequestTask"), exports);
|
|
|
32
32
|
__exportStar(require("./ValidateTask"), exports);
|
|
33
33
|
__exportStar(require("./VersionTask"), exports);
|
|
34
34
|
__exportStar(require("./PopulateTrelloBoardTask"), exports);
|
|
35
|
+
__exportStar(require("./CreateHotfixTask"), exports);
|
package/lib/src/types.js
CHANGED
|
@@ -40,6 +40,7 @@ exports.TASKS = {
|
|
|
40
40
|
AddApprovalRulesTask: Symbol.for('AddApprovalRulesTask'),
|
|
41
41
|
CreateToolingBranchTask: Symbol.for('CreateToolingBranchTask'),
|
|
42
42
|
EnsureApprovalRulesTask: Symbol.for('EnsureApprovalRulesTask'),
|
|
43
|
+
CreateHotfixTask: Symbol.for('CreateHotfixTask'),
|
|
43
44
|
ChangeMilestoneTask: Symbol.for('ChangeMilestoneTask'),
|
|
44
45
|
};
|
|
45
46
|
exports.COMMANDS = {
|
|
@@ -58,5 +59,6 @@ exports.COMMANDS = {
|
|
|
58
59
|
TagMasterCommand: Symbol.for('TagMasterCommand'),
|
|
59
60
|
ListProjectsCommand: Symbol.for('ListProjectsCommand'),
|
|
60
61
|
CreateTrelloCardsCommand: Symbol.for('CreateTrelloCardsCommand'),
|
|
61
|
-
ConfigureProjectsCommand: Symbol.for('ConfigureProjectsCommand')
|
|
62
|
+
ConfigureProjectsCommand: Symbol.for('ConfigureProjectsCommand'),
|
|
63
|
+
CreateHotfixCommand: Symbol.for('CreateHotfixCommand')
|
|
62
64
|
};
|