heroku 10.3.0-beta.0 → 10.3.1-alpha.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.
- package/bin/heroku-prompts.js +235 -0
- package/bin/heroku-repl.js +581 -0
- package/bin/run +36 -7
- package/lib/commands/addons/plans.d.ts +1 -0
- package/lib/commands/addons/plans.js +11 -2
- package/lib/commands/releases/retry.d.ts +11 -0
- package/lib/commands/releases/retry.js +51 -0
- package/lib/lib/addons/util.js +2 -0
- package/oclif.manifest.json +348 -313
- package/package.json +4 -3
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const command_1 = require("@heroku-cli/command");
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const color_1 = require("@heroku-cli/color");
|
|
6
|
+
const output_1 = require("../../lib/releases/output");
|
|
7
|
+
const releases_1 = require("../../lib/releases/releases");
|
|
8
|
+
class Retry extends command_1.Command {
|
|
9
|
+
async run() {
|
|
10
|
+
var _a;
|
|
11
|
+
const { flags } = await this.parse(Retry);
|
|
12
|
+
const { app } = flags;
|
|
13
|
+
const release = await (0, releases_1.findByLatestOrId)(this.heroku, app);
|
|
14
|
+
const { body: formations } = await this.heroku.get(`/apps/${app}/formation`);
|
|
15
|
+
const releasePhase = formations.filter(formation => formation.type === 'release');
|
|
16
|
+
if (!release) {
|
|
17
|
+
return core_1.ux.error('No release found for this app.');
|
|
18
|
+
}
|
|
19
|
+
if (releasePhase.length === 0) {
|
|
20
|
+
return core_1.ux.error('App must have a release-phase command to use this command.');
|
|
21
|
+
}
|
|
22
|
+
core_1.ux.action.start(`Retrying ${color_1.default.green('v' + release.version)} on ${color_1.default.app(app)}`);
|
|
23
|
+
const { body: retry } = await this.heroku.post(`/apps/${app}/releases`, {
|
|
24
|
+
body: {
|
|
25
|
+
slug: (_a = release === null || release === void 0 ? void 0 : release.slug) === null || _a === void 0 ? void 0 : _a.id,
|
|
26
|
+
description: `Retry of v${release.version}: ${release.description}`,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
core_1.ux.action.stop(`done, ${color_1.default.green('v' + retry.version)}`);
|
|
30
|
+
if (retry.output_stream_url) {
|
|
31
|
+
core_1.ux.log('Running release command...');
|
|
32
|
+
await (0, output_1.stream)(retry.output_stream_url)
|
|
33
|
+
.catch(error => {
|
|
34
|
+
var _a;
|
|
35
|
+
if (error.statusCode === 404 || ((_a = error.response) === null || _a === void 0 ? void 0 : _a.statusCode) === 404) {
|
|
36
|
+
core_1.ux.warn(`Release command starting. Use ${color_1.default.cmd('heroku releases:output --app ' + app)} to view the log.`);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
throw error;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.default = Retry;
|
|
45
|
+
Retry.topic = 'releases';
|
|
46
|
+
Retry.description = 'retry the latest release-phase command';
|
|
47
|
+
Retry.examples = ['heroku releases:retry --app happy-samurai-42'];
|
|
48
|
+
Retry.help = 'Copies the latest release into a new release and retries the latest release-phase command. App must have a release-phase command.';
|
|
49
|
+
Retry.flags = {
|
|
50
|
+
app: command_1.flags.app({ required: true }),
|
|
51
|
+
};
|
package/lib/lib/addons/util.js
CHANGED