heroku 8.1.8 → 8.2.0-beta.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/autocomplete-scripts/README.md +7 -0
- package/autocomplete-scripts/bash/heroku.bash +59 -0
- package/autocomplete-scripts/brew/bash +4 -0
- package/autocomplete-scripts/brew/zsh/_heroku +59 -0
- package/autocomplete-scripts/zsh/_heroku +53 -0
- package/bin/bats-test-runner.js +7 -0
- package/bin/dev +17 -0
- package/bin/dev.cmd +3 -0
- package/bin/run +36 -1
- package/lib/analytics.d.ts +2 -2
- package/lib/analytics.js +3 -4
- package/lib/commands/auth/2fa/disable.d.ts +7 -0
- package/lib/commands/auth/2fa/disable.js +16 -0
- package/lib/commands/auth/2fa/index.d.ts +6 -0
- package/lib/commands/auth/2fa/index.js +18 -0
- package/lib/commands/auth/login.d.ts +8 -0
- package/lib/commands/auth/login.js +25 -0
- package/lib/commands/auth/logout.d.ts +6 -0
- package/lib/commands/auth/logout.js +14 -0
- package/lib/commands/auth/token.d.ts +7 -0
- package/lib/commands/auth/token.js +31 -0
- package/lib/commands/auth/whoami.d.ts +7 -0
- package/lib/commands/auth/whoami.js +26 -0
- package/lib/commands/authorizations/create.d.ts +13 -0
- package/lib/commands/authorizations/create.js +41 -0
- package/lib/commands/authorizations/index.d.ts +9 -0
- package/lib/commands/authorizations/index.js +35 -0
- package/lib/commands/authorizations/info.d.ts +11 -0
- package/lib/commands/authorizations/info.js +25 -0
- package/lib/commands/authorizations/revoke.d.ts +10 -0
- package/lib/commands/authorizations/revoke.js +22 -0
- package/lib/commands/authorizations/rotate.d.ts +8 -0
- package/lib/commands/authorizations/rotate.js +19 -0
- package/lib/commands/authorizations/update.d.ts +13 -0
- package/lib/commands/authorizations/update.js +36 -0
- package/lib/commands/autocomplete/create.d.ts +29 -0
- package/lib/commands/autocomplete/create.js +213 -0
- package/lib/commands/autocomplete/doctor.d.ts +12 -0
- package/lib/commands/autocomplete/doctor.js +97 -0
- package/lib/commands/autocomplete/index.d.ts +12 -0
- package/lib/commands/autocomplete/index.js +67 -0
- package/lib/commands/autocomplete/options.d.ts +25 -0
- package/lib/commands/autocomplete/options.js +210 -0
- package/lib/commands/autocomplete/script.d.ts +10 -0
- package/lib/commands/autocomplete/script.js +23 -0
- package/lib/commands/buildpacks/add.d.ts +13 -0
- package/lib/commands/buildpacks/add.js +43 -0
- package/lib/commands/buildpacks/clear.d.ts +9 -0
- package/lib/commands/buildpacks/clear.js +17 -0
- package/lib/commands/buildpacks/index.d.ts +9 -0
- package/lib/commands/buildpacks/index.js +25 -0
- package/lib/commands/buildpacks/info.d.ts +8 -0
- package/lib/commands/buildpacks/info.js +41 -0
- package/lib/commands/buildpacks/remove.d.ts +13 -0
- package/lib/commands/buildpacks/remove.js +55 -0
- package/lib/commands/buildpacks/search.d.ts +13 -0
- package/lib/commands/buildpacks/search.js +69 -0
- package/lib/commands/buildpacks/set.d.ts +13 -0
- package/lib/commands/buildpacks/set.js +42 -0
- package/lib/commands/buildpacks/versions.d.ts +8 -0
- package/lib/commands/buildpacks/versions.js +56 -0
- package/lib/commands/certs/auto/wait.d.ts +9 -0
- package/lib/commands/certs/auto/wait.js +14 -0
- package/lib/commands/ci/index.d.ts +12 -0
- package/lib/commands/ci/index.js +25 -0
- package/lib/commands/ci/info.d.ts +14 -0
- package/lib/commands/ci/info.js +29 -0
- package/lib/commands/ci/last.d.ts +11 -0
- package/lib/commands/ci/last.js +31 -0
- package/lib/commands/ci/rerun.d.ts +13 -0
- package/lib/commands/ci/rerun.js +53 -0
- package/lib/commands/ci/run.d.ts +10 -0
- package/lib/commands/ci/run.js +42 -0
- package/lib/commands/clients/create.d.ts +14 -0
- package/lib/commands/clients/create.js +37 -0
- package/lib/commands/clients/destroy.d.ts +8 -0
- package/lib/commands/clients/destroy.js +18 -0
- package/lib/commands/clients/index.d.ts +8 -0
- package/lib/commands/clients/index.js +32 -0
- package/lib/commands/clients/info.d.ts +13 -0
- package/lib/commands/clients/info.js +33 -0
- package/lib/commands/clients/rotate.d.ts +12 -0
- package/lib/commands/clients/rotate.js +33 -0
- package/lib/commands/clients/update.d.ts +13 -0
- package/lib/commands/clients/update.js +38 -0
- package/lib/commands/config/edit.d.ts +23 -0
- package/lib/commands/config/edit.js +132 -0
- package/lib/commands/config/get.d.ts +16 -0
- package/lib/commands/config/get.js +35 -0
- package/lib/commands/config/index.d.ts +11 -0
- package/lib/commands/config/index.js +33 -0
- package/lib/commands/config/unset.d.ts +12 -0
- package/lib/commands/config/unset.js +51 -0
- package/lib/commands/console.d.ts +11 -0
- package/lib/commands/console.js +30 -0
- package/lib/commands/domains/add.d.ts +19 -0
- package/lib/commands/domains/add.js +117 -0
- package/lib/commands/domains/clear.d.ts +11 -0
- package/lib/commands/domains/clear.js +26 -0
- package/lib/commands/domains/index.d.ts +40 -0
- package/lib/commands/domains/index.js +79 -0
- package/lib/commands/domains/info.d.ts +14 -0
- package/lib/commands/domains/info.js +25 -0
- package/lib/commands/domains/remove.d.ts +14 -0
- package/lib/commands/domains/remove.js +26 -0
- package/lib/commands/domains/update.d.ts +15 -0
- package/lib/commands/domains/update.js +40 -0
- package/lib/commands/domains/wait.d.ts +13 -0
- package/lib/commands/domains/wait.js +32 -0
- package/lib/commands/git/clone.d.ts +13 -0
- package/lib/commands/git/clone.js +29 -0
- package/lib/commands/git/credentials.d.ts +9 -0
- package/lib/commands/git/credentials.js +32 -0
- package/lib/commands/git/remote.d.ts +11 -0
- package/lib/commands/git/remote.js +44 -0
- package/lib/commands/labs/disable.d.ts +11 -0
- package/lib/commands/labs/disable.js +65 -0
- package/lib/commands/local/index.d.ts +17 -0
- package/lib/commands/local/index.js +75 -0
- package/lib/commands/local/run.d.ts +11 -0
- package/lib/commands/local/run.js +38 -0
- package/lib/commands/local/version.d.ts +5 -0
- package/lib/commands/local/version.js +13 -0
- package/lib/commands/logs.d.ts +16 -0
- package/lib/commands/logs.js +45 -0
- package/lib/commands/pipelines/add.d.ts +14 -0
- package/lib/commands/pipelines/add.js +61 -0
- package/lib/commands/pipelines/connect.d.ts +12 -0
- package/lib/commands/pipelines/connect.js +52 -0
- package/lib/commands/pipelines/create.d.ts +15 -0
- package/lib/commands/pipelines/create.js +91 -0
- package/lib/commands/pipelines/destroy.d.ts +9 -0
- package/lib/commands/pipelines/destroy.js +27 -0
- package/lib/commands/pipelines/diff.d.ts +19 -0
- package/lib/commands/pipelines/diff.js +152 -0
- package/lib/commands/pipelines/index.d.ts +9 -0
- package/lib/commands/pipelines/index.js +27 -0
- package/lib/commands/pipelines/info.d.ts +13 -0
- package/lib/commands/pipelines/info.js +43 -0
- package/lib/commands/pipelines/open.d.ts +9 -0
- package/lib/commands/pipelines/open.js +19 -0
- package/lib/commands/pipelines/promote.d.ts +12 -0
- package/lib/commands/pipelines/promote.js +216 -0
- package/lib/commands/pipelines/remove.d.ts +10 -0
- package/lib/commands/pipelines/remove.js +23 -0
- package/lib/commands/pipelines/rename.d.ts +10 -0
- package/lib/commands/pipelines/rename.js +33 -0
- package/lib/commands/pipelines/setup.d.ts +14 -0
- package/lib/commands/pipelines/setup.js +91 -0
- package/lib/commands/pipelines/transfer.d.ts +13 -0
- package/lib/commands/pipelines/transfer.js +65 -0
- package/lib/commands/pipelines/update.d.ts +11 -0
- package/lib/commands/pipelines/update.js +32 -0
- package/lib/commands/ps/autoscale/disable.d.ts +9 -0
- package/lib/commands/ps/autoscale/disable.js +35 -0
- package/lib/commands/ps/autoscale/enable.d.ts +13 -0
- package/lib/commands/ps/autoscale/enable.js +65 -0
- package/lib/commands/ps/wait.d.ts +12 -0
- package/lib/commands/ps/wait.js +78 -0
- package/lib/commands/rake.d.ts +14 -0
- package/lib/commands/rake.js +46 -0
- package/lib/commands/regions.d.ts +11 -0
- package/lib/commands/regions.js +45 -0
- package/lib/commands/reviewapps/disable.d.ts +17 -0
- package/lib/commands/reviewapps/disable.js +102 -0
- package/lib/commands/reviewapps/enable.d.ts +14 -0
- package/lib/commands/reviewapps/enable.js +89 -0
- package/lib/commands/run/detached.d.ts +15 -0
- package/lib/commands/run/detached.js +56 -0
- package/lib/commands/run/index.d.ts +18 -0
- package/lib/commands/run/index.js +64 -0
- package/lib/commands/run/inside.d.ts +15 -0
- package/lib/commands/run/inside.js +55 -0
- package/lib/commands/sessions/destroy.d.ts +8 -0
- package/lib/commands/sessions/destroy.js +18 -0
- package/lib/commands/sessions/index.d.ts +8 -0
- package/lib/commands/sessions/index.js +31 -0
- package/lib/commands/status.d.ts +8 -0
- package/lib/commands/status.js +46 -0
- package/lib/commands/webhooks/add.d.ts +16 -0
- package/lib/commands/webhooks/add.js +47 -0
- package/lib/commands/webhooks/deliveries/index.d.ts +12 -0
- package/lib/commands/webhooks/deliveries/index.js +80 -0
- package/lib/commands/webhooks/deliveries/info.d.ts +14 -0
- package/lib/commands/webhooks/deliveries/info.js +42 -0
- package/lib/commands/webhooks/events/index.d.ts +11 -0
- package/lib/commands/webhooks/events/index.js +46 -0
- package/lib/commands/webhooks/events/info.d.ts +14 -0
- package/lib/commands/webhooks/events/info.js +31 -0
- package/lib/commands/webhooks/index.d.ts +11 -0
- package/lib/commands/webhooks/index.js +45 -0
- package/lib/commands/webhooks/info.d.ts +14 -0
- package/lib/commands/webhooks/info.js +31 -0
- package/lib/commands/webhooks/remove.d.ts +14 -0
- package/lib/commands/webhooks/remove.js +29 -0
- package/lib/commands/webhooks/update.d.ts +19 -0
- package/lib/commands/webhooks/update.js +41 -0
- package/lib/file.js +2 -3
- package/lib/global_telemetry.d.ts +53 -0
- package/lib/global_telemetry.js +82 -0
- package/lib/hooks/command_not_found/performance_analytics.d.ts +3 -0
- package/lib/hooks/command_not_found/performance_analytics.js +7 -0
- package/lib/hooks/init/terms-of-service.js +3 -4
- package/lib/hooks/init/version.d.ts +2 -1
- package/lib/hooks/init/version.js +1 -2
- package/lib/hooks/postrun/performance_analytics.d.ts +3 -0
- package/lib/hooks/postrun/performance_analytics.js +11 -0
- package/lib/hooks/prerun/analytics.d.ts +2 -1
- package/lib/hooks/prerun/analytics.js +4 -4
- package/lib/hooks/recache.d.ts +3 -0
- package/lib/hooks/recache.js +56 -0
- package/lib/hooks/update/brew.d.ts +2 -1
- package/lib/hooks/update/brew.js +3 -5
- package/lib/hooks/update/completions.d.ts +2 -1
- package/lib/hooks/update/completions.js +2 -3
- package/lib/hooks/update/plugin-migrate.d.ts +2 -1
- package/lib/hooks/update/plugin-migrate.js +3 -5
- package/lib/hooks/update/tidy.d.ts +2 -1
- package/lib/hooks/update/tidy.js +3 -5
- package/lib/lib/authorizations/authorizations.d.ts +2 -0
- package/lib/lib/authorizations/authorizations.js +39 -0
- package/lib/lib/autocomplete/base.d.ts +11 -0
- package/lib/lib/autocomplete/base.js +44 -0
- package/lib/lib/autocomplete/cache.d.ts +2 -0
- package/lib/lib/autocomplete/cache.js +28 -0
- package/lib/lib/autocomplete/completions.d.ts +37 -0
- package/lib/lib/autocomplete/completions.js +261 -0
- package/lib/lib/buildpacks/buildpacks.d.ts +32 -0
- package/lib/lib/buildpacks/buildpacks.js +161 -0
- package/lib/lib/buildpacks/push.d.ts +0 -0
- package/lib/lib/buildpacks/push.js +4 -0
- package/lib/lib/ci/git.d.ts +8 -0
- package/lib/lib/ci/git.js +71 -0
- package/lib/lib/ci/interfaces/kolkrabbi.d.ts +311 -0
- package/lib/lib/ci/interfaces/kolkrabbi.js +7 -0
- package/lib/lib/ci/pipelines.d.ts +3 -0
- package/lib/lib/ci/pipelines.js +57 -0
- package/lib/lib/ci/source.d.ts +2 -0
- package/lib/lib/ci/source.js +42 -0
- package/lib/lib/ci/test-run.d.ts +5 -0
- package/lib/lib/ci/test-run.js +232 -0
- package/lib/lib/clients/clients.d.ts +1 -0
- package/lib/lib/clients/clients.js +25 -0
- package/lib/lib/config/quote.d.ts +2 -0
- package/lib/lib/config/quote.js +33 -0
- package/lib/lib/config/util.d.ts +3 -0
- package/lib/lib/config/util.js +12 -0
- package/lib/lib/domains/wait-for-domain.d.ts +3 -0
- package/lib/lib/domains/wait-for-domain.js +19 -0
- package/lib/lib/git/git.d.ts +8 -0
- package/lib/lib/git/git.js +56 -0
- package/lib/lib/local/fork-foreman.d.ts +1 -0
- package/lib/lib/local/fork-foreman.js +33 -0
- package/lib/lib/local/load-foreman-procfile.d.ts +0 -0
- package/lib/lib/local/load-foreman-procfile.js +2 -0
- package/lib/lib/local/run-foreman.d.ts +0 -0
- package/lib/lib/local/run-foreman.js +2 -0
- package/lib/lib/pipelines/api.d.ts +25 -0
- package/lib/lib/pipelines/api.js +130 -0
- package/lib/lib/pipelines/disambiguate.d.ts +3 -0
- package/lib/lib/pipelines/disambiguate.js +49 -0
- package/lib/lib/pipelines/github-api.d.ts +8 -0
- package/lib/lib/pipelines/github-api.js +18 -0
- package/lib/lib/pipelines/infer.d.ts +1 -0
- package/lib/lib/pipelines/infer.js +11 -0
- package/lib/lib/pipelines/key-by.d.ts +1 -0
- package/lib/lib/pipelines/key-by.js +11 -0
- package/lib/lib/pipelines/kolkrabbi-api.d.ts +14 -0
- package/lib/lib/pipelines/kolkrabbi-api.js +62 -0
- package/lib/lib/pipelines/ownership.d.ts +4 -0
- package/lib/lib/pipelines/ownership.js +40 -0
- package/lib/lib/pipelines/render-pipeline.d.ts +6 -0
- package/lib/lib/pipelines/render-pipeline.js +52 -0
- package/lib/lib/pipelines/setup/create-apps.d.ts +1 -0
- package/lib/lib/pipelines/setup/create-apps.js +44 -0
- package/lib/lib/pipelines/setup/get-ci-settings.d.ts +4 -0
- package/lib/lib/pipelines/setup/get-ci-settings.js +19 -0
- package/lib/lib/pipelines/setup/get-github-token.d.ts +1 -0
- package/lib/lib/pipelines/setup/get-github-token.js +10 -0
- package/lib/lib/pipelines/setup/get-name-and-repo.d.ts +1 -0
- package/lib/lib/pipelines/setup/get-name-and-repo.js +47 -0
- package/lib/lib/pipelines/setup/get-repo.d.ts +1 -0
- package/lib/lib/pipelines/setup/get-repo.js +8 -0
- package/lib/lib/pipelines/setup/get-settings.d.ts +9 -0
- package/lib/lib/pipelines/setup/get-settings.js +39 -0
- package/lib/lib/pipelines/setup/poll-app-setups.d.ts +1 -0
- package/lib/lib/pipelines/setup/poll-app-setups.js +25 -0
- package/lib/lib/pipelines/setup/setup-pipeline.d.ts +1 -0
- package/lib/lib/pipelines/setup/setup-pipeline.js +15 -0
- package/lib/lib/pipelines/setup/validate.d.ts +9 -0
- package/lib/lib/pipelines/setup/validate.js +31 -0
- package/lib/lib/pipelines/stages.d.ts +7 -0
- package/lib/lib/pipelines/stages.js +22 -0
- package/lib/lib/run/colorize.d.ts +2 -0
- package/lib/lib/run/colorize.js +300 -0
- package/lib/lib/run/dyno.d.ts +72 -0
- package/lib/lib/run/dyno.js +397 -0
- package/lib/lib/run/helpers.d.ts +2 -0
- package/lib/lib/run/helpers.js +34 -0
- package/lib/lib/run/line-transform.d.ts +4 -0
- package/lib/lib/run/line-transform.js +26 -0
- package/lib/lib/run/log-displayer.d.ts +10 -0
- package/lib/lib/run/log-displayer.js +79 -0
- package/lib/lib/sessions/sessions.d.ts +7 -0
- package/lib/lib/sessions/sessions.js +2 -0
- package/lib/lib/status/util.d.ts +1 -0
- package/lib/lib/status/util.js +14 -0
- package/lib/lib/webhooks/base.d.ts +13 -0
- package/lib/lib/webhooks/base.js +28 -0
- package/lib/user-config.js +2 -3
- package/oclif.manifest.json +3376 -2
- package/package.json +81 -43
- package/lib/hooks/update/b.d.ts +0 -2
- package/lib/hooks/update/b.js +0 -48
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Command } from '@heroku-cli/command';
|
|
2
|
+
export default class Wait extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
app: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
6
|
+
remote: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
|
+
type: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
|
+
'wait-interval': import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
|
+
'with-run': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const command_1 = require("@heroku-cli/command");
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
|
+
class Wait extends command_1.Command {
|
|
7
|
+
async run() {
|
|
8
|
+
const { flags } = await this.parse(Wait);
|
|
9
|
+
const { body: releases } = await this.heroku.request(`/apps/${flags.app}/releases`, {
|
|
10
|
+
partial: true,
|
|
11
|
+
headers: {
|
|
12
|
+
Range: 'version ..; max=1, order=desc',
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
if (releases.length === 0) {
|
|
16
|
+
this.warn(`App ${flags.app} has no releases`);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const latestRelease = releases[0];
|
|
20
|
+
let released = true;
|
|
21
|
+
const interval = flags['wait-interval'];
|
|
22
|
+
while (1) {
|
|
23
|
+
const { body: dynos } = await this.heroku.get(`/apps/${flags.app}/dynos`);
|
|
24
|
+
const relevantDynos = dynos
|
|
25
|
+
.filter(dyno => dyno.type !== 'release')
|
|
26
|
+
.filter(dyno => flags['with-run'] || dyno.type !== 'run')
|
|
27
|
+
.filter(dyno => !flags.type || dyno.type === flags.type);
|
|
28
|
+
const onLatest = relevantDynos.filter((dyno) => {
|
|
29
|
+
return dyno.state === 'up' &&
|
|
30
|
+
latestRelease.version !== undefined &&
|
|
31
|
+
dyno.release !== undefined &&
|
|
32
|
+
dyno.release.version !== undefined &&
|
|
33
|
+
dyno.release.version >= latestRelease.version;
|
|
34
|
+
});
|
|
35
|
+
const releasedFraction = `${onLatest.length} / ${relevantDynos.length}`;
|
|
36
|
+
if (onLatest.length === relevantDynos.length) {
|
|
37
|
+
if (!released) {
|
|
38
|
+
core_1.ux.action.stop(`${releasedFraction}, done`);
|
|
39
|
+
}
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
if (released) {
|
|
43
|
+
released = false;
|
|
44
|
+
core_1.ux.action.start(`Waiting for every dyno to be running v${latestRelease.version}`);
|
|
45
|
+
}
|
|
46
|
+
core_1.ux.action.status = releasedFraction;
|
|
47
|
+
await core_1.ux.wait(interval * 1000);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.default = Wait;
|
|
52
|
+
_a = Wait;
|
|
53
|
+
Wait.description = 'wait for all dynos to be running latest version after a release';
|
|
54
|
+
Wait.flags = {
|
|
55
|
+
app: command_1.flags.app({ required: true }),
|
|
56
|
+
remote: command_1.flags.remote(),
|
|
57
|
+
type: command_1.flags.string({
|
|
58
|
+
char: 't',
|
|
59
|
+
description: 'wait for one specific dyno type',
|
|
60
|
+
}),
|
|
61
|
+
'wait-interval': command_1.flags.integer({
|
|
62
|
+
char: 'w',
|
|
63
|
+
description: 'how frequently to poll in seconds (to avoid hitting Heroku API rate limits)',
|
|
64
|
+
parse: async (input) => {
|
|
65
|
+
const w = Number.parseInt(input, 10);
|
|
66
|
+
if (w < 10) {
|
|
67
|
+
core_1.ux.error('wait-interval must be at least 10', { exit: 1 });
|
|
68
|
+
}
|
|
69
|
+
return w;
|
|
70
|
+
},
|
|
71
|
+
default: 10,
|
|
72
|
+
}),
|
|
73
|
+
'with-run': command_1.flags.boolean({
|
|
74
|
+
char: 'R',
|
|
75
|
+
description: 'whether to wait for one-off run dynos',
|
|
76
|
+
exclusive: ['type'],
|
|
77
|
+
}),
|
|
78
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Command } from '@heroku-cli/command';
|
|
2
|
+
export default class RunRake extends Command {
|
|
3
|
+
static hidden: boolean;
|
|
4
|
+
static strict: boolean;
|
|
5
|
+
static flags: {
|
|
6
|
+
app: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
|
+
remote: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
|
+
size: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
|
+
'exit-code': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
env: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
|
+
'no-tty': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// tslint:disable:file-name-casing
|
|
4
|
+
const command_1 = require("@heroku-cli/command");
|
|
5
|
+
const completions_1 = require("@heroku-cli/command/lib/completions");
|
|
6
|
+
const core_1 = require("@oclif/core");
|
|
7
|
+
const dyno_1 = require("../lib/run/dyno");
|
|
8
|
+
const helpers_1 = require("../lib/run/helpers");
|
|
9
|
+
class RunRake extends command_1.Command {
|
|
10
|
+
async run() {
|
|
11
|
+
const { flags, argv } = await this.parse(RunRake);
|
|
12
|
+
const opts = {
|
|
13
|
+
heroku: this.heroku,
|
|
14
|
+
app: flags.app,
|
|
15
|
+
command: (0, helpers_1.buildCommand)(['rake', ...argv]),
|
|
16
|
+
size: flags.size,
|
|
17
|
+
'exit-code': flags['exit-code'],
|
|
18
|
+
env: flags.env,
|
|
19
|
+
'no-tty': flags['no-tty'],
|
|
20
|
+
attach: true,
|
|
21
|
+
};
|
|
22
|
+
const dyno = new dyno_1.default(opts);
|
|
23
|
+
try {
|
|
24
|
+
await dyno.start();
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
if (error.exitCode) {
|
|
28
|
+
core_1.ux.error(error, { exit: error.exitCode });
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
throw error;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.default = RunRake;
|
|
37
|
+
RunRake.hidden = true;
|
|
38
|
+
RunRake.strict = false;
|
|
39
|
+
RunRake.flags = {
|
|
40
|
+
app: command_1.flags.app({ description: 'parent app used by review apps', required: true }),
|
|
41
|
+
remote: command_1.flags.remote(),
|
|
42
|
+
size: command_1.flags.string({ char: 's', description: 'dyno size', completion: completions_1.DynoSizeCompletion }),
|
|
43
|
+
'exit-code': command_1.flags.boolean({ char: 'x', description: 'passthrough the exit code of the remote command' }),
|
|
44
|
+
env: command_1.flags.string({ char: 'e', description: "environment variables to set (use ';' to split multiple vars)" }),
|
|
45
|
+
'no-tty': command_1.flags.boolean({ description: 'force the command to not run in a tty' }),
|
|
46
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Command } from '@heroku-cli/command';
|
|
2
|
+
export default class Regions extends Command {
|
|
3
|
+
static topic: string;
|
|
4
|
+
static description: string;
|
|
5
|
+
static flags: {
|
|
6
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
private: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
common: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
};
|
|
10
|
+
run(): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const color_1 = require("@heroku-cli/color");
|
|
4
|
+
const command_1 = require("@heroku-cli/command");
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
|
+
const _ = require("lodash");
|
|
7
|
+
class Regions extends command_1.Command {
|
|
8
|
+
async run() {
|
|
9
|
+
const { flags } = await this.parse(Regions);
|
|
10
|
+
let { body: regions } = await this.heroku.get('/regions');
|
|
11
|
+
if (flags.private) {
|
|
12
|
+
regions = regions.filter((region) => region.private_capable);
|
|
13
|
+
}
|
|
14
|
+
else if (flags.common) {
|
|
15
|
+
regions = regions.filter((region) => !region.private_capable);
|
|
16
|
+
}
|
|
17
|
+
regions = _.sortBy(regions, ['private_capable', 'name']);
|
|
18
|
+
if (flags.json) {
|
|
19
|
+
core_1.ux.styledJSON(regions);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
core_1.ux.table(regions, {
|
|
23
|
+
name: {
|
|
24
|
+
header: 'ID',
|
|
25
|
+
get: ({ name }) => color_1.default.green(name),
|
|
26
|
+
},
|
|
27
|
+
description: {
|
|
28
|
+
header: 'Location',
|
|
29
|
+
},
|
|
30
|
+
private_capable: {
|
|
31
|
+
header: 'Runtime',
|
|
32
|
+
get: ({ private_capable }) => private_capable ? 'Private Spaces' : 'Common Runtime',
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.default = Regions;
|
|
39
|
+
Regions.topic = 'regions';
|
|
40
|
+
Regions.description = 'list available regions for deployment';
|
|
41
|
+
Regions.flags = {
|
|
42
|
+
json: command_1.flags.boolean({ description: 'output in json format' }),
|
|
43
|
+
private: command_1.flags.boolean({ description: 'show regions for private spaces' }),
|
|
44
|
+
common: command_1.flags.boolean({ description: 'show regions for common runtime' }),
|
|
45
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Command } from '@heroku-cli/command';
|
|
2
|
+
export default class ReviewappsDisable extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
app: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
|
+
remote: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
|
+
pipeline: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
|
+
autodeploy: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
autodestroy: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
'wait-for-ci': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
'no-autodeploy': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
'no-autodestroy': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
'no-wait-for-ci': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<void>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
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 kolkrabbi_api_1 = require("../../lib/pipelines/kolkrabbi-api");
|
|
6
|
+
class ReviewappsDisable extends command_1.Command {
|
|
7
|
+
async run() {
|
|
8
|
+
const { flags } = await this.parse(ReviewappsDisable);
|
|
9
|
+
if (flags.app) {
|
|
10
|
+
// remove app & remote flags when Review Apps 1.0 is deprecated
|
|
11
|
+
this.warn('Specifying an app via --app or --remote is no longer needed with Review Apps');
|
|
12
|
+
}
|
|
13
|
+
const settings = {
|
|
14
|
+
automatic_review_apps: undefined,
|
|
15
|
+
destroy_stale_apps: undefined,
|
|
16
|
+
wait_for_ci: undefined,
|
|
17
|
+
pipeline: undefined,
|
|
18
|
+
repo: undefined,
|
|
19
|
+
};
|
|
20
|
+
// flags.autodeploy are back supported
|
|
21
|
+
if (flags['no-autodeploy'] || flags.autodeploy) {
|
|
22
|
+
this.log('Disabling auto deployment...');
|
|
23
|
+
settings.automatic_review_apps = false;
|
|
24
|
+
}
|
|
25
|
+
// flags.autodestroy are back supported
|
|
26
|
+
if (flags['no-autodestroy'] || flags.autodestroy) {
|
|
27
|
+
this.log('Disabling auto destroy...');
|
|
28
|
+
settings.destroy_stale_apps = false;
|
|
29
|
+
}
|
|
30
|
+
// flags['wait-for-ci'] are back supported
|
|
31
|
+
if (flags['no-wait-for-ci'] || flags['wait-for-ci']) {
|
|
32
|
+
this.log('Disabling wait for CI...');
|
|
33
|
+
settings.wait_for_ci = false;
|
|
34
|
+
}
|
|
35
|
+
const kolkrabbi = new kolkrabbi_api_1.default(this.config.userAgent, () => this.heroku.auth);
|
|
36
|
+
core_1.ux.action.start('Configuring pipeline');
|
|
37
|
+
const { body: pipeline } = await this.heroku.get(`/pipelines/${flags.pipeline}`);
|
|
38
|
+
settings.pipeline = pipeline.id;
|
|
39
|
+
try {
|
|
40
|
+
const { body: feature } = await this.heroku.get('/account/features/dashboard-repositories-api');
|
|
41
|
+
if (feature.enabled) {
|
|
42
|
+
const { body: repo } = await this.heroku.get(`/pipelines/${pipeline.id}/repo`, {
|
|
43
|
+
headers: { Accept: 'application/vnd.heroku+json; version=3.repositories-api' },
|
|
44
|
+
});
|
|
45
|
+
settings.repo = repo.full_name;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
catch (_a) {
|
|
49
|
+
const { repository } = await kolkrabbi.getPipelineRepository(pipeline.id);
|
|
50
|
+
settings.repo = repository.name;
|
|
51
|
+
}
|
|
52
|
+
if (flags.autodeploy || flags['no-autodeploy'] || flags.autodestroy || flags['no-autodestroy'] || flags['wait-for-ci'] || flags['no-wait-for-ci']) {
|
|
53
|
+
await this.heroku.patch(`/pipelines/${pipeline.id}/review-app-config`, {
|
|
54
|
+
body: settings,
|
|
55
|
+
headers: { Accept: 'application/vnd.heroku+json; version=3.review-apps' },
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
// if no flags are passed then the user is disabling review apps
|
|
60
|
+
await this.heroku.delete(`/pipelines/${pipeline.id}/review-app-config`, {
|
|
61
|
+
body: settings,
|
|
62
|
+
headers: { Accept: 'application/vnd.heroku+json; version=3.review-apps' },
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
core_1.ux.action.stop();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.default = ReviewappsDisable;
|
|
69
|
+
ReviewappsDisable.description = 'disable review apps and/or settings on an existing pipeline';
|
|
70
|
+
ReviewappsDisable.examples = [
|
|
71
|
+
'$ heroku reviewapps:disable -p my-pipeline -a my-app --no-autodeploy',
|
|
72
|
+
];
|
|
73
|
+
ReviewappsDisable.flags = {
|
|
74
|
+
app: command_1.flags.app({
|
|
75
|
+
description: 'parent app used by review apps',
|
|
76
|
+
}),
|
|
77
|
+
remote: command_1.flags.remote(),
|
|
78
|
+
pipeline: command_1.flags.pipeline({
|
|
79
|
+
required: true,
|
|
80
|
+
}),
|
|
81
|
+
autodeploy: command_1.flags.boolean({
|
|
82
|
+
description: 'disable autodeployments',
|
|
83
|
+
hidden: true,
|
|
84
|
+
}),
|
|
85
|
+
autodestroy: command_1.flags.boolean({
|
|
86
|
+
description: 'disable automatically destroying review apps',
|
|
87
|
+
hidden: true,
|
|
88
|
+
}),
|
|
89
|
+
'wait-for-ci': command_1.flags.boolean({
|
|
90
|
+
description: 'disable wait for CI',
|
|
91
|
+
hidden: true,
|
|
92
|
+
}),
|
|
93
|
+
'no-autodeploy': command_1.flags.boolean({
|
|
94
|
+
description: 'disable autodeployments',
|
|
95
|
+
}),
|
|
96
|
+
'no-autodestroy': command_1.flags.boolean({
|
|
97
|
+
description: 'disable automatically destroying review apps',
|
|
98
|
+
}),
|
|
99
|
+
'no-wait-for-ci': command_1.flags.boolean({
|
|
100
|
+
description: 'disable wait for CI',
|
|
101
|
+
}),
|
|
102
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Command } from '@heroku-cli/command';
|
|
2
|
+
export default class ReviewappsEnable extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
app: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
|
+
remote: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
|
+
pipeline: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
|
+
autodeploy: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
autodestroy: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
'wait-for-ci': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
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 kolkrabbi_api_1 = require("../../lib/pipelines/kolkrabbi-api");
|
|
6
|
+
class ReviewappsEnable extends command_1.Command {
|
|
7
|
+
async run() {
|
|
8
|
+
const { flags } = await this.parse(ReviewappsEnable);
|
|
9
|
+
if (flags.app) {
|
|
10
|
+
// remove app & remote flags when Review Apps 1.0 is deprecated
|
|
11
|
+
this.warn('Specifying an app via --app or --remote is no longer needed with Review Apps');
|
|
12
|
+
}
|
|
13
|
+
const settings = {
|
|
14
|
+
automatic_review_apps: undefined,
|
|
15
|
+
destroy_stale_apps: undefined,
|
|
16
|
+
wait_for_ci: undefined,
|
|
17
|
+
pipeline: undefined,
|
|
18
|
+
repo: undefined,
|
|
19
|
+
};
|
|
20
|
+
if (flags.autodeploy) {
|
|
21
|
+
this.log('Enabling auto deployment...');
|
|
22
|
+
settings.automatic_review_apps = true;
|
|
23
|
+
}
|
|
24
|
+
if (flags.autodestroy) {
|
|
25
|
+
this.log('Enabling auto destroy...');
|
|
26
|
+
settings.destroy_stale_apps = true;
|
|
27
|
+
}
|
|
28
|
+
if (flags['wait-for-ci']) {
|
|
29
|
+
this.log('Enabling wait for CI...');
|
|
30
|
+
settings.wait_for_ci = true;
|
|
31
|
+
}
|
|
32
|
+
const kolkrabbi = new kolkrabbi_api_1.default(this.config.userAgent, () => this.heroku.auth);
|
|
33
|
+
core_1.ux.action.start('Configuring pipeline');
|
|
34
|
+
const { body: pipeline } = await this.heroku.get(`/pipelines/${flags.pipeline}`);
|
|
35
|
+
settings.pipeline = pipeline.id;
|
|
36
|
+
try {
|
|
37
|
+
const { body: feature } = await this.heroku.get('/account/features/dashboard-repositories-api');
|
|
38
|
+
if (feature.enabled) {
|
|
39
|
+
const { body: repo } = await this.heroku.get(`/pipelines/${pipeline.id}/repo`, {
|
|
40
|
+
headers: { Accept: 'application/vnd.heroku+json; version=3.repositories-api' },
|
|
41
|
+
});
|
|
42
|
+
settings.repo = repo.full_name;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
catch (_a) {
|
|
46
|
+
const { repository } = await kolkrabbi.getPipelineRepository(pipeline.id);
|
|
47
|
+
settings.repo = repository.name;
|
|
48
|
+
}
|
|
49
|
+
if (flags.autodeploy || flags.autodestroy || flags['wait-for-ci']) {
|
|
50
|
+
await this.heroku.patch(`/pipelines/${pipeline.id}/review-app-config`, {
|
|
51
|
+
body: settings,
|
|
52
|
+
headers: { Accept: 'application/vnd.heroku+json; version=3.review-apps' },
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
// if no flags are passed then the user is enabling review apps
|
|
57
|
+
await this.heroku.post(`/pipelines/${pipeline.id}/review-app-config`, {
|
|
58
|
+
body: settings,
|
|
59
|
+
headers: { Accept: 'application/vnd.heroku+json; version=3.review-apps' },
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
core_1.ux.action.stop();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.default = ReviewappsEnable;
|
|
66
|
+
ReviewappsEnable.description = 'enable review apps and/or settings on an existing pipeline';
|
|
67
|
+
ReviewappsEnable.examples = [
|
|
68
|
+
'$ heroku reviewapps:enable -p my-pipeline -a my-app --autodeploy --autodestroy',
|
|
69
|
+
];
|
|
70
|
+
ReviewappsEnable.flags = {
|
|
71
|
+
app: command_1.flags.app({
|
|
72
|
+
description: 'parent app used by review apps',
|
|
73
|
+
}),
|
|
74
|
+
remote: command_1.flags.remote(),
|
|
75
|
+
pipeline: command_1.flags.string({
|
|
76
|
+
char: 'p',
|
|
77
|
+
description: 'name of pipeline',
|
|
78
|
+
required: true,
|
|
79
|
+
}),
|
|
80
|
+
autodeploy: command_1.flags.boolean({
|
|
81
|
+
description: 'autodeploy the review app',
|
|
82
|
+
}),
|
|
83
|
+
autodestroy: command_1.flags.boolean({
|
|
84
|
+
description: 'autodestroy the review app',
|
|
85
|
+
}),
|
|
86
|
+
'wait-for-ci': command_1.flags.boolean({
|
|
87
|
+
description: 'wait for CI to pass before deploying',
|
|
88
|
+
}),
|
|
89
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Command } from '@heroku-cli/command';
|
|
2
|
+
export default class RunDetached extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static strict: boolean;
|
|
6
|
+
static flags: {
|
|
7
|
+
app: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
|
+
remote: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
|
+
env: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
+
size: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
|
+
tail: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
type: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
4
|
+
// tslint:disable:file-name-casing
|
|
5
|
+
const color_1 = require("@heroku-cli/color");
|
|
6
|
+
const command_1 = require("@heroku-cli/command");
|
|
7
|
+
const completions_1 = require("@heroku-cli/command/lib/completions");
|
|
8
|
+
const core_1 = require("@oclif/core");
|
|
9
|
+
const dyno_1 = require("../../lib/run/dyno");
|
|
10
|
+
const helpers_1 = require("../../lib/run/helpers");
|
|
11
|
+
const log_displayer_1 = require("../../lib/run/log-displayer");
|
|
12
|
+
class RunDetached extends command_1.Command {
|
|
13
|
+
async run() {
|
|
14
|
+
const { flags, argv } = await this.parse(RunDetached);
|
|
15
|
+
const opts = {
|
|
16
|
+
heroku: this.heroku,
|
|
17
|
+
app: flags.app,
|
|
18
|
+
command: (0, helpers_1.buildCommand)(argv),
|
|
19
|
+
size: flags.size,
|
|
20
|
+
type: flags.type,
|
|
21
|
+
env: flags.env,
|
|
22
|
+
attach: false,
|
|
23
|
+
};
|
|
24
|
+
if (!opts.command) {
|
|
25
|
+
throw new Error('Usage: heroku run COMMAND\n\nExample: heroku run bash');
|
|
26
|
+
}
|
|
27
|
+
const dyno = new dyno_1.default(opts);
|
|
28
|
+
await dyno.start();
|
|
29
|
+
if (flags.tail) {
|
|
30
|
+
await (0, log_displayer_1.default)(this.heroku, {
|
|
31
|
+
app: flags.app,
|
|
32
|
+
// @ts-ignore
|
|
33
|
+
dyno: dyno.dyno.name,
|
|
34
|
+
tail: true,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
// @ts-ignore
|
|
39
|
+
core_1.ux.log(`Run ${color_1.default.cmd('heroku logs --app ' + dyno.opts.app + ' --dyno ' + dyno.dyno.name)} to view the output.`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.default = RunDetached;
|
|
44
|
+
RunDetached.description = 'run a detached dyno, where output is sent to your logs';
|
|
45
|
+
RunDetached.examples = [
|
|
46
|
+
'$ heroku run:detached ls',
|
|
47
|
+
];
|
|
48
|
+
RunDetached.strict = false;
|
|
49
|
+
RunDetached.flags = {
|
|
50
|
+
app: command_1.flags.app({ required: true }),
|
|
51
|
+
remote: command_1.flags.remote(),
|
|
52
|
+
env: command_1.flags.string({ char: 'e', description: "environment variables to set (use ';' to split multiple vars)" }),
|
|
53
|
+
size: command_1.flags.string({ char: 's', description: 'dyno size', completion: completions_1.DynoSizeCompletion }),
|
|
54
|
+
tail: command_1.flags.boolean({ char: 't', description: 'continually stream logs' }),
|
|
55
|
+
type: command_1.flags.string({ description: 'process type', completion: completions_1.ProcessTypeCompletion }),
|
|
56
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Command } from '@heroku-cli/command';
|
|
2
|
+
export default class Run extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static strict: boolean;
|
|
6
|
+
static flags: {
|
|
7
|
+
app: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
|
+
remote: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
|
+
size: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
+
type: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
|
+
'exit-code': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
env: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
13
|
+
'no-tty': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
listen: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
'no-notify': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
};
|
|
17
|
+
run(): Promise<void>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const command_1 = require("@heroku-cli/command");
|
|
4
|
+
const completions_1 = require("@heroku-cli/command/lib/completions");
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
|
+
const debug_1 = require("debug");
|
|
7
|
+
const dyno_1 = require("../../lib/run/dyno");
|
|
8
|
+
const helpers_1 = require("../../lib/run/helpers");
|
|
9
|
+
const debug = (0, debug_1.default)('heroku:run');
|
|
10
|
+
class Run extends command_1.Command {
|
|
11
|
+
async run() {
|
|
12
|
+
const { argv, flags } = await this.parse(Run);
|
|
13
|
+
const opts = {
|
|
14
|
+
'exit-code': flags['exit-code'],
|
|
15
|
+
'no-tty': flags['no-tty'],
|
|
16
|
+
app: flags.app,
|
|
17
|
+
attach: true,
|
|
18
|
+
command: (0, helpers_1.buildCommand)(argv),
|
|
19
|
+
env: flags.env,
|
|
20
|
+
heroku: this.heroku,
|
|
21
|
+
listen: flags.listen,
|
|
22
|
+
notify: !flags['no-notify'],
|
|
23
|
+
size: flags.size,
|
|
24
|
+
type: flags.type,
|
|
25
|
+
};
|
|
26
|
+
if (!opts.command) {
|
|
27
|
+
throw new Error('Usage: heroku run COMMAND\n\nExample: heroku run bash');
|
|
28
|
+
}
|
|
29
|
+
await this.heroku.get('/account');
|
|
30
|
+
const dyno = new dyno_1.default(opts);
|
|
31
|
+
try {
|
|
32
|
+
await dyno.start();
|
|
33
|
+
debug('done running');
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
debug(error);
|
|
37
|
+
if (error.exitCode) {
|
|
38
|
+
core_1.ux.error(error.message, { code: error.exitCode, exit: error.exitCode });
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
throw error;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.default = Run;
|
|
47
|
+
Run.description = 'run a one-off process inside a heroku dyno\nShows a notification if the dyno takes more than 20 seconds to start.';
|
|
48
|
+
Run.examples = [
|
|
49
|
+
'$ heroku run bash',
|
|
50
|
+
'$ heroku run -s standard-2x -- myscript.sh -a arg1 -s arg2',
|
|
51
|
+
];
|
|
52
|
+
// This is to allow for variable length arguments
|
|
53
|
+
Run.strict = false;
|
|
54
|
+
Run.flags = {
|
|
55
|
+
app: command_1.flags.app({ description: 'parent app used by review apps', required: true }),
|
|
56
|
+
remote: command_1.flags.remote(),
|
|
57
|
+
size: command_1.flags.string({ char: 's', description: 'dyno size', completion: completions_1.DynoSizeCompletion }),
|
|
58
|
+
type: command_1.flags.string({ description: 'process type', completion: completions_1.ProcessTypeCompletion }),
|
|
59
|
+
'exit-code': command_1.flags.boolean({ char: 'x', description: 'passthrough the exit code of the remote command' }),
|
|
60
|
+
env: command_1.flags.string({ char: 'e', description: "environment variables to set (use ';' to split multiple vars)" }),
|
|
61
|
+
'no-tty': command_1.flags.boolean({ description: 'force the command to not run in a tty' }),
|
|
62
|
+
listen: command_1.flags.boolean({ description: 'listen on a local port', hidden: true }),
|
|
63
|
+
'no-notify': command_1.flags.boolean({ description: 'disables notification when dyno is up (alternatively use HEROKU_NOTIFICATIONS=0)' }),
|
|
64
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Command } from '@heroku-cli/command';
|
|
2
|
+
export default class RunInside extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static hidden: boolean;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
app: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
|
+
remote: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
|
+
'exit-code': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
env: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
|
+
listen: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
};
|
|
13
|
+
static strict: boolean;
|
|
14
|
+
run(): Promise<void>;
|
|
15
|
+
}
|