buildnator-personal 0.0.4 → 0.0.5
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 +8 -4
- package/package.json +1 -1
package/buildnator.client.ts
CHANGED
|
@@ -487,13 +487,17 @@ export class BuildnatorClient {
|
|
|
487
487
|
const numbuild = await this.jenkinsPost(`${this.jobs.criarbackup}/${id}/api/json`);
|
|
488
488
|
if (numbuild && numbuild.inProgress === false) {
|
|
489
489
|
if (numbuild.result === "SUCCESS") {
|
|
490
|
-
|
|
490
|
+
const consoleText = await this.jenkinsGet(`${this.jobs.criarbackup}/${id}/consoleText`);
|
|
491
|
+
const match = consoleText.match(/([a-zA-Z0-9._-]+_bck_\d{8}_\d{6})/);
|
|
492
|
+
const branch = match ? match[1] : null;
|
|
493
|
+
|
|
494
|
+
return { terminado: true, resultado: true, tipo: "criarbackup", retorno: numbuild.result, parou: branch };
|
|
491
495
|
}
|
|
492
|
-
return { terminado: true, resultado: false, tipo: "criarbackup", retorno: numbuild.result };
|
|
496
|
+
return { terminado: true, resultado: false, tipo: "criarbackup", retorno: numbuild.result, parou: "" };
|
|
493
497
|
}
|
|
494
|
-
return { terminado: false, resultado: false, tipo: "criarbackup", retorno: numbuild?.result };
|
|
498
|
+
return { terminado: false, resultado: false, tipo: "criarbackup", retorno: numbuild?.result, parou: "" };
|
|
495
499
|
} catch {
|
|
496
|
-
return { terminado: true, resultado: false, tipo: "criarbackup", retorno: "erro interno" };
|
|
500
|
+
return { terminado: true, resultado: false, tipo: "criarbackup", retorno: "erro interno", parou: "" };
|
|
497
501
|
}
|
|
498
502
|
}
|
|
499
503
|
}
|