buildnator-personal 0.0.2 → 0.0.3
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/buildnator.client.ts +33 -0
- package/dist/buildnator.client.js +51 -2
- package/package.json +1 -1
package/buildnator.client.ts
CHANGED
|
@@ -437,4 +437,37 @@ export class BuildnatorClient {
|
|
|
437
437
|
return { terminado: true, resultado: false, tipo: "unificar", retorno: "erro interno" };
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
+
|
|
441
|
+
async verificarExecucaoLiberaVersao(projeto: any, tipo?: any) {
|
|
442
|
+
|
|
443
|
+
try {
|
|
444
|
+
|
|
445
|
+
if (tipo && tipo === "especifica" && projeto === "agrimanager") {
|
|
446
|
+
const numbuild = await this.jenkinsPost(`${this.jobs.qaAgmLiberaEspecifica}/api/json`);
|
|
447
|
+
const numbuildExecucao = await this.jenkinsPost(`${this.jobs.qaAgmLiberaEspecifica}/${numbuild.builds[0].number}/api/json`);
|
|
448
|
+
if (numbuildExecucao && numbuildExecucao.inProgress === false) {
|
|
449
|
+
return false;
|
|
450
|
+
}
|
|
451
|
+
return true;
|
|
452
|
+
} else {
|
|
453
|
+
if (projeto === "agrimanager") {
|
|
454
|
+
const numbuild = await this.jenkinsPost(`${this.jobs.qaAgmLibera}/api/json`);
|
|
455
|
+
const numbuildExecucao = await this.jenkinsPost(`${this.jobs.qaAgmLibera}/${numbuild.builds[0].number}/api/json`);
|
|
456
|
+
if (numbuildExecucao && numbuildExecucao.inProgress === false) {
|
|
457
|
+
return false;
|
|
458
|
+
}
|
|
459
|
+
return true;
|
|
460
|
+
} else {
|
|
461
|
+
const numbuild = await this.jenkinsPost(`${this.jobs.qaTaAgbLibera}/api/json`);
|
|
462
|
+
const numbuildExecucao = await this.jenkinsPost(`${this.jobs.qaTaAgbLibera}/${numbuild.builds[0].number}/api/json`);
|
|
463
|
+
if (numbuildExecucao && numbuildExecucao.inProgress === false) {
|
|
464
|
+
return false;
|
|
465
|
+
}
|
|
466
|
+
return true;
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
} catch {
|
|
470
|
+
return false
|
|
471
|
+
}
|
|
472
|
+
}
|
|
440
473
|
}
|
|
@@ -20,8 +20,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
22
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
-
return g =
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
24
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
25
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
26
|
function step(op) {
|
|
27
27
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -681,6 +681,55 @@ var BuildnatorClient = /** @class */ (function () {
|
|
|
681
681
|
});
|
|
682
682
|
});
|
|
683
683
|
};
|
|
684
|
+
BuildnatorClient.prototype.verificarExecucaoLiberaVersao = function (projeto, tipo) {
|
|
685
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
686
|
+
var numbuild, numbuildExecucao, numbuild, numbuildExecucao, numbuild, numbuildExecucao, _a;
|
|
687
|
+
return __generator(this, function (_b) {
|
|
688
|
+
switch (_b.label) {
|
|
689
|
+
case 0:
|
|
690
|
+
_b.trys.push([0, 10, , 11]);
|
|
691
|
+
if (!(tipo && tipo === "especifica" && projeto === "agrimanager")) return [3 /*break*/, 3];
|
|
692
|
+
return [4 /*yield*/, this.jenkinsPost("".concat(this.jobs.qaAgmLiberaEspecifica, "/api/json"))];
|
|
693
|
+
case 1:
|
|
694
|
+
numbuild = _b.sent();
|
|
695
|
+
return [4 /*yield*/, this.jenkinsPost("".concat(this.jobs.qaAgmLiberaEspecifica, "/").concat(numbuild.builds[0].number, "/api/json"))];
|
|
696
|
+
case 2:
|
|
697
|
+
numbuildExecucao = _b.sent();
|
|
698
|
+
if (numbuildExecucao && numbuildExecucao.inProgress === false) {
|
|
699
|
+
return [2 /*return*/, false];
|
|
700
|
+
}
|
|
701
|
+
return [2 /*return*/, true];
|
|
702
|
+
case 3:
|
|
703
|
+
if (!(projeto === "agrimanager")) return [3 /*break*/, 6];
|
|
704
|
+
return [4 /*yield*/, this.jenkinsPost("".concat(this.jobs.qaAgmLibera, "/api/json"))];
|
|
705
|
+
case 4:
|
|
706
|
+
numbuild = _b.sent();
|
|
707
|
+
return [4 /*yield*/, this.jenkinsPost("".concat(this.jobs.qaAgmLibera, "/").concat(numbuild.builds[0].number, "/api/json"))];
|
|
708
|
+
case 5:
|
|
709
|
+
numbuildExecucao = _b.sent();
|
|
710
|
+
if (numbuildExecucao && numbuildExecucao.inProgress === false) {
|
|
711
|
+
return [2 /*return*/, false];
|
|
712
|
+
}
|
|
713
|
+
return [2 /*return*/, true];
|
|
714
|
+
case 6: return [4 /*yield*/, this.jenkinsPost("".concat(this.jobs.qaTaAgbLibera, "/api/json"))];
|
|
715
|
+
case 7:
|
|
716
|
+
numbuild = _b.sent();
|
|
717
|
+
return [4 /*yield*/, this.jenkinsPost("".concat(this.jobs.qaTaAgbLibera, "/").concat(numbuild.builds[0].number, "/api/json"))];
|
|
718
|
+
case 8:
|
|
719
|
+
numbuildExecucao = _b.sent();
|
|
720
|
+
if (numbuildExecucao && numbuildExecucao.inProgress === false) {
|
|
721
|
+
return [2 /*return*/, false];
|
|
722
|
+
}
|
|
723
|
+
return [2 /*return*/, true];
|
|
724
|
+
case 9: return [3 /*break*/, 11];
|
|
725
|
+
case 10:
|
|
726
|
+
_a = _b.sent();
|
|
727
|
+
return [2 /*return*/, false];
|
|
728
|
+
case 11: return [2 /*return*/];
|
|
729
|
+
}
|
|
730
|
+
});
|
|
731
|
+
});
|
|
732
|
+
};
|
|
684
733
|
return BuildnatorClient;
|
|
685
734
|
}());
|
|
686
735
|
exports.BuildnatorClient = BuildnatorClient;
|