heroku 8.1.9 → 8.2.0-beta.1
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/README.md +5 -6
- 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 +80 -43
- package/lib/hooks/update/b.d.ts +0 -2
- package/lib/hooks/update/b.js +0 -48
|
@@ -0,0 +1,61 @@
|
|
|
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 completions_1 = require("@heroku-cli/command/lib/completions");
|
|
6
|
+
const core_1 = require("@oclif/core");
|
|
7
|
+
const inquirer_1 = require("inquirer");
|
|
8
|
+
const api_1 = require("../../lib/pipelines/api");
|
|
9
|
+
const disambiguate_1 = require("../../lib/pipelines/disambiguate");
|
|
10
|
+
const infer_1 = require("../../lib/pipelines/infer");
|
|
11
|
+
const stages_1 = require("../../lib/pipelines/stages");
|
|
12
|
+
class PipelinesAdd extends command_1.Command {
|
|
13
|
+
async run() {
|
|
14
|
+
const { args, flags } = await this.parse(PipelinesAdd);
|
|
15
|
+
const app = flags.app;
|
|
16
|
+
let stage;
|
|
17
|
+
const guesses = (0, infer_1.default)(app);
|
|
18
|
+
const questions = [];
|
|
19
|
+
const pipeline = await (0, disambiguate_1.default)(this.heroku, args.pipeline);
|
|
20
|
+
if (flags.stage) {
|
|
21
|
+
stage = flags.stage;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
questions.push({
|
|
25
|
+
type: 'list',
|
|
26
|
+
name: 'stage',
|
|
27
|
+
message: `Stage of ${app}`,
|
|
28
|
+
choices: stages_1.inferrableStageNames,
|
|
29
|
+
default: guesses[1],
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
const answers = await (0, inquirer_1.prompt)(questions);
|
|
33
|
+
if (answers.stage)
|
|
34
|
+
stage = answers.stage;
|
|
35
|
+
core_1.ux.action.start(`Adding ${color_1.default.app(app)} to ${color_1.default.pipeline(pipeline.name)} pipeline as ${stage}`);
|
|
36
|
+
await (0, api_1.createCoupling)(this.heroku, pipeline, app, stage);
|
|
37
|
+
core_1.ux.action.stop();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.default = PipelinesAdd;
|
|
41
|
+
PipelinesAdd.description = `add this app to a pipeline
|
|
42
|
+
The app and pipeline names must be specified.
|
|
43
|
+
The stage of the app will be guessed based on its name if not specified.`;
|
|
44
|
+
PipelinesAdd.examples = [
|
|
45
|
+
'$ heroku pipelines:add my-pipeline -a my-app -s production',
|
|
46
|
+
];
|
|
47
|
+
PipelinesAdd.flags = {
|
|
48
|
+
app: command_1.flags.app({ required: true }),
|
|
49
|
+
remote: command_1.flags.remote(),
|
|
50
|
+
stage: command_1.flags.string({
|
|
51
|
+
char: 's',
|
|
52
|
+
description: 'stage of first app in pipeline',
|
|
53
|
+
completion: completions_1.StageCompletion,
|
|
54
|
+
}),
|
|
55
|
+
};
|
|
56
|
+
PipelinesAdd.args = {
|
|
57
|
+
pipeline: core_1.Args.string({
|
|
58
|
+
description: 'name of pipeline',
|
|
59
|
+
required: true,
|
|
60
|
+
}),
|
|
61
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Command } from '@heroku-cli/command';
|
|
2
|
+
export default class Connect extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
repo: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
|
+
};
|
|
8
|
+
static args: {
|
|
9
|
+
name: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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 api_1 = require("../../lib/pipelines/api");
|
|
6
|
+
const github_api_1 = require("../../lib/pipelines/github-api");
|
|
7
|
+
const kolkrabbi_api_1 = require("../../lib/pipelines/kolkrabbi-api");
|
|
8
|
+
const get_github_token_1 = require("../../lib/pipelines/setup/get-github-token");
|
|
9
|
+
const get_name_and_repo_1 = require("../../lib/pipelines/setup/get-name-and-repo");
|
|
10
|
+
const get_repo_1 = require("../../lib/pipelines/setup/get-repo");
|
|
11
|
+
const validate_1 = require("../../lib/pipelines/setup/validate");
|
|
12
|
+
class Connect extends command_1.Command {
|
|
13
|
+
async run() {
|
|
14
|
+
const { args, flags } = await this.parse(Connect);
|
|
15
|
+
const combinedInputs = {
|
|
16
|
+
name: args.name,
|
|
17
|
+
repo: flags.repo,
|
|
18
|
+
};
|
|
19
|
+
const errors = (0, validate_1.nameAndRepo)({ repo: flags.repo });
|
|
20
|
+
if (errors.length > 0) {
|
|
21
|
+
this.error(errors.join(', '));
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const kolkrabbi = new kolkrabbi_api_1.default(this.config.userAgent, () => this.heroku.auth);
|
|
25
|
+
const github = new github_api_1.default(this.config.userAgent, await (0, get_github_token_1.default)(kolkrabbi));
|
|
26
|
+
const { name: pipelineName, repo: repoName, } = await (0, get_name_and_repo_1.default)(combinedInputs);
|
|
27
|
+
const repo = await (0, get_repo_1.default)(github, repoName);
|
|
28
|
+
const pipeline = await (0, api_1.getPipeline)(this.heroku, pipelineName);
|
|
29
|
+
core_1.ux.action.start('Linking to repo');
|
|
30
|
+
await kolkrabbi.createPipelineRepository(pipeline.body.id, repo.id);
|
|
31
|
+
core_1.ux.action.stop();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.default = Connect;
|
|
35
|
+
Connect.description = 'connect a github repo to an existing pipeline';
|
|
36
|
+
Connect.examples = [
|
|
37
|
+
'$ heroku pipelines:connect my-pipeline -r githuborg/reponame',
|
|
38
|
+
];
|
|
39
|
+
Connect.flags = {
|
|
40
|
+
repo: command_1.flags.string({
|
|
41
|
+
name: 'repo',
|
|
42
|
+
char: 'r',
|
|
43
|
+
description: 'the GitHub repository to connect to',
|
|
44
|
+
required: true,
|
|
45
|
+
}),
|
|
46
|
+
};
|
|
47
|
+
Connect.args = {
|
|
48
|
+
name: core_1.Args.string({
|
|
49
|
+
description: 'name of pipeline',
|
|
50
|
+
required: true,
|
|
51
|
+
}),
|
|
52
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Command } from '@heroku-cli/command';
|
|
2
|
+
export default class Create extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
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
|
+
stage: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
|
+
team: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
+
};
|
|
11
|
+
static args: {
|
|
12
|
+
name: import("@oclif/core/lib/interfaces/parser").Arg<string | undefined, Record<string, unknown>>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
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 completions_1 = require("@heroku-cli/command/lib/completions");
|
|
6
|
+
const core_1 = require("@oclif/core");
|
|
7
|
+
const inquirer_1 = require("inquirer");
|
|
8
|
+
const api_1 = require("../../lib/pipelines/api");
|
|
9
|
+
const infer_1 = require("../../lib/pipelines/infer");
|
|
10
|
+
const stages_1 = require("../../lib/pipelines/stages");
|
|
11
|
+
class Create extends command_1.Command {
|
|
12
|
+
async run() {
|
|
13
|
+
const { args, flags } = await this.parse(Create);
|
|
14
|
+
let name;
|
|
15
|
+
let stage;
|
|
16
|
+
let owner;
|
|
17
|
+
const guesses = (0, infer_1.default)(flags.app);
|
|
18
|
+
const questions = [];
|
|
19
|
+
const app = flags.app;
|
|
20
|
+
if (args.name) {
|
|
21
|
+
name = args.name;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
questions.push({
|
|
25
|
+
type: 'input',
|
|
26
|
+
name: 'name',
|
|
27
|
+
message: 'Pipeline name',
|
|
28
|
+
default: guesses[0],
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
if (flags.stage) {
|
|
32
|
+
stage = flags.stage;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
questions.push({
|
|
36
|
+
type: 'list',
|
|
37
|
+
name: 'stage',
|
|
38
|
+
message: `Stage of ${app}`,
|
|
39
|
+
choices: stages_1.inferrableStageNames,
|
|
40
|
+
default: guesses[1],
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
const teamName = flags.team;
|
|
44
|
+
const ownerType = teamName ? 'team' : 'user';
|
|
45
|
+
// If team or org is not specified, we assign ownership to the user creating
|
|
46
|
+
owner = teamName ? await (0, api_1.getTeam)(this.heroku, teamName) : await (0, api_1.getAccountInfo)(this.heroku);
|
|
47
|
+
owner = owner.body;
|
|
48
|
+
const ownerID = owner.id;
|
|
49
|
+
owner = { id: ownerID, type: ownerType };
|
|
50
|
+
const answers = await (0, inquirer_1.prompt)(questions);
|
|
51
|
+
if (answers.name)
|
|
52
|
+
name = answers.name;
|
|
53
|
+
if (answers.stage)
|
|
54
|
+
stage = answers.stage;
|
|
55
|
+
core_1.ux.action.start(`Creating ${name} pipeline`);
|
|
56
|
+
const { body: pipeline } = await (0, api_1.createPipeline)(this.heroku, name, owner);
|
|
57
|
+
core_1.ux.action.stop();
|
|
58
|
+
core_1.ux.action.start(`Adding ${color_1.default.app(app)} to ${color_1.default.pipeline(pipeline.name)} pipeline as ${stage}`);
|
|
59
|
+
await (0, api_1.createCoupling)(this.heroku, pipeline, app, stage);
|
|
60
|
+
core_1.ux.action.stop();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.default = Create;
|
|
64
|
+
Create.description = `create a new pipeline
|
|
65
|
+
An existing app must be specified as the first app in the pipeline.
|
|
66
|
+
The pipeline name will be inferred from the app name if not specified.
|
|
67
|
+
The stage of the app will be guessed based on its name if not specified.
|
|
68
|
+
The pipeline owner will be the user creating the pipeline if not specified with -t for teams or -o for orgs.`;
|
|
69
|
+
Create.examples = [
|
|
70
|
+
'$ heroku pipelines:create -a my-app-staging',
|
|
71
|
+
'$ heroku pipelines:create my-pipeline -a my-app-staging',
|
|
72
|
+
];
|
|
73
|
+
Create.flags = {
|
|
74
|
+
app: command_1.flags.app({ required: true }),
|
|
75
|
+
remote: command_1.flags.remote(),
|
|
76
|
+
stage: command_1.flags.string({
|
|
77
|
+
name: 'stage',
|
|
78
|
+
char: 's',
|
|
79
|
+
description: 'stage of first app in pipeline',
|
|
80
|
+
completion: completions_1.StageCompletion,
|
|
81
|
+
}),
|
|
82
|
+
team: command_1.flags.team({
|
|
83
|
+
description: 'the team which will own the apps',
|
|
84
|
+
}),
|
|
85
|
+
};
|
|
86
|
+
Create.args = {
|
|
87
|
+
name: core_1.Args.string({
|
|
88
|
+
description: 'name of pipeline (defaults to basename of the app)',
|
|
89
|
+
required: false,
|
|
90
|
+
}),
|
|
91
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Command } from '@heroku-cli/command';
|
|
2
|
+
export default class PipelinesDestroy extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
pipeline: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
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 api_1 = require("../../lib/pipelines/api");
|
|
7
|
+
const disambiguate_1 = require("../../lib/pipelines/disambiguate");
|
|
8
|
+
class PipelinesDestroy extends command_1.Command {
|
|
9
|
+
async run() {
|
|
10
|
+
const { args } = await this.parse(PipelinesDestroy);
|
|
11
|
+
const pipeline = await (0, disambiguate_1.default)(this.heroku, args.pipeline);
|
|
12
|
+
core_1.ux.action.start(`Destroying ${color_1.default.pipeline(pipeline.name)} pipeline`);
|
|
13
|
+
await (0, api_1.destroyPipeline)(this.heroku, pipeline.name, pipeline.id);
|
|
14
|
+
core_1.ux.action.stop();
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.default = PipelinesDestroy;
|
|
18
|
+
PipelinesDestroy.description = 'destroy a pipeline';
|
|
19
|
+
PipelinesDestroy.examples = [
|
|
20
|
+
'$ heroku pipelines:destroy my-pipeline',
|
|
21
|
+
];
|
|
22
|
+
PipelinesDestroy.args = {
|
|
23
|
+
pipeline: core_1.Args.string({
|
|
24
|
+
description: 'name of pipeline',
|
|
25
|
+
required: true,
|
|
26
|
+
}),
|
|
27
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Command } from '@heroku-cli/command';
|
|
2
|
+
import KolkrabbiAPI from '../../lib/pipelines/kolkrabbi-api';
|
|
3
|
+
interface AppInfo {
|
|
4
|
+
name: string;
|
|
5
|
+
repo?: string;
|
|
6
|
+
hash?: string;
|
|
7
|
+
}
|
|
8
|
+
export default class PipelinesDiff extends Command {
|
|
9
|
+
static description: string;
|
|
10
|
+
static examples: string[];
|
|
11
|
+
static flags: {
|
|
12
|
+
app: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
13
|
+
remote: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
14
|
+
};
|
|
15
|
+
kolkrabbi: KolkrabbiAPI;
|
|
16
|
+
getAppInfo: (appName: string, appId: string) => Promise<AppInfo>;
|
|
17
|
+
run(): Promise<undefined>;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,152 @@
|
|
|
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 http_call_1 = require("http-call");
|
|
7
|
+
const api_1 = require("../../lib/pipelines/api");
|
|
8
|
+
const kolkrabbi_api_1 = require("../../lib/pipelines/kolkrabbi-api");
|
|
9
|
+
const PROMOTION_ORDER = ['development', 'staging', 'production'];
|
|
10
|
+
async function diff(targetApp, downstreamApp, githubToken, herokuUserAgent) {
|
|
11
|
+
if (!downstreamApp.repo) {
|
|
12
|
+
return core_1.ux.log(`\n${color_1.default.app(targetApp.name)} was not compared to ${color_1.default.app(downstreamApp.name)} as ${color_1.default.app(downstreamApp.name)} is not connected to GitHub`);
|
|
13
|
+
}
|
|
14
|
+
if (downstreamApp.repo !== targetApp.repo) {
|
|
15
|
+
return core_1.ux.log(`\n${color_1.default.app(targetApp.name)} was not compared to ${color_1.default.app(downstreamApp.name)} as ${color_1.default.app(downstreamApp.name)} is not connected to the same GitHub repo as ${color_1.default.app(targetApp.name)}`);
|
|
16
|
+
}
|
|
17
|
+
if (!downstreamApp.hash) {
|
|
18
|
+
return core_1.ux.log(`\n${color_1.default.app(targetApp.name)} was not compared to ${color_1.default.app(downstreamApp.name)} as ${color_1.default.app(downstreamApp.name)} does not have any releases`);
|
|
19
|
+
}
|
|
20
|
+
if (downstreamApp.hash === targetApp.hash) {
|
|
21
|
+
return core_1.ux.log(`\n${color_1.default.app(targetApp.name)} is up to date with ${color_1.default.app(downstreamApp.name)}`);
|
|
22
|
+
}
|
|
23
|
+
// Do the actual Github diff
|
|
24
|
+
try {
|
|
25
|
+
const path = `${targetApp.repo}/compare/${downstreamApp.hash}...${targetApp.hash}`;
|
|
26
|
+
const headers = { authorization: 'token ' + githubToken };
|
|
27
|
+
if (herokuUserAgent) {
|
|
28
|
+
headers['user-agent'] = herokuUserAgent;
|
|
29
|
+
}
|
|
30
|
+
const githubDiff = await http_call_1.default.get(`https://api.github.com/repos/${path}`, {
|
|
31
|
+
headers,
|
|
32
|
+
}).then(res => res.body);
|
|
33
|
+
core_1.ux.log('');
|
|
34
|
+
core_1.ux.styledHeader(`${color_1.default.app(targetApp.name)} is ahead of ${color_1.default.app(downstreamApp.name)} by ${githubDiff.ahead_by} commit${githubDiff.ahead_by === 1 ? '' : 's'}`);
|
|
35
|
+
const mapped = githubDiff.commits.map((commit) => {
|
|
36
|
+
return {
|
|
37
|
+
sha: commit.sha.slice(0, 7),
|
|
38
|
+
date: commit.commit.author.date,
|
|
39
|
+
author: commit.commit.author.name,
|
|
40
|
+
message: commit.commit.message.split('\n')[0],
|
|
41
|
+
};
|
|
42
|
+
}).reverse();
|
|
43
|
+
core_1.ux.table(mapped, {
|
|
44
|
+
sha: {
|
|
45
|
+
header: 'SHA',
|
|
46
|
+
},
|
|
47
|
+
date: {},
|
|
48
|
+
author: {},
|
|
49
|
+
message: {},
|
|
50
|
+
});
|
|
51
|
+
core_1.ux.log(`\nhttps://github.com/${path}`);
|
|
52
|
+
// tslint:disable-next-line: no-unused
|
|
53
|
+
}
|
|
54
|
+
catch (_a) {
|
|
55
|
+
core_1.ux.log(`\n${color_1.default.app(targetApp.name)} was not compared to ${color_1.default.app(downstreamApp.name)} because we were unable to perform a diff`);
|
|
56
|
+
core_1.ux.log('are you sure you have pushed your latest commits to GitHub?');
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
class PipelinesDiff extends command_1.Command {
|
|
60
|
+
constructor() {
|
|
61
|
+
super(...arguments);
|
|
62
|
+
this.kolkrabbi = new kolkrabbi_api_1.default(this.config.userAgent, () => this.heroku.auth);
|
|
63
|
+
this.getAppInfo = async (appName, appId) => {
|
|
64
|
+
// Find GitHub connection for the app
|
|
65
|
+
const githubApp = await this.kolkrabbi.getAppLink(appId)
|
|
66
|
+
.catch(() => {
|
|
67
|
+
return { name: appName, repo: null, hash: null };
|
|
68
|
+
});
|
|
69
|
+
// Find the commit hash of the latest release for this app
|
|
70
|
+
let slug;
|
|
71
|
+
try {
|
|
72
|
+
const { body: releases } = await (0, api_1.getReleases)(this.heroku, appId);
|
|
73
|
+
const release = releases.find(r => r.status === 'succeeded');
|
|
74
|
+
if (!release || !release.slug) {
|
|
75
|
+
throw new Error(`no release found for ${appName}`);
|
|
76
|
+
}
|
|
77
|
+
slug = await this.heroku.get(`/apps/${appId}/slugs/${release.slug.id}`, {
|
|
78
|
+
headers: { Accept: api_1.V3_HEADER },
|
|
79
|
+
}).then(res => res.body);
|
|
80
|
+
// tslint:disable-next-line: no-unused
|
|
81
|
+
}
|
|
82
|
+
catch (_a) {
|
|
83
|
+
return { name: appName, repo: githubApp.repo, hash: undefined };
|
|
84
|
+
}
|
|
85
|
+
return { name: appName, repo: githubApp.repo, hash: slug.commit };
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
async run() {
|
|
89
|
+
const { flags } = await this.parse(PipelinesDiff);
|
|
90
|
+
const targetAppName = flags.app;
|
|
91
|
+
const coupling = await (0, api_1.getCoupling)(this.heroku, targetAppName)
|
|
92
|
+
.then(res => res.body)
|
|
93
|
+
.catch(() => { });
|
|
94
|
+
if (!coupling) {
|
|
95
|
+
core_1.ux.error(`This app (${targetAppName}) does not seem to be a part of any pipeline`);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const targetAppId = coupling.app.id;
|
|
99
|
+
core_1.ux.action.start('Fetching apps from pipeline');
|
|
100
|
+
const allApps = await (0, api_1.listPipelineApps)(this.heroku, coupling.pipeline.id);
|
|
101
|
+
core_1.ux.action.stop();
|
|
102
|
+
const sourceStage = coupling.stage;
|
|
103
|
+
if (!sourceStage) {
|
|
104
|
+
return core_1.ux.error(`Unable to diff ${targetAppName}`);
|
|
105
|
+
}
|
|
106
|
+
const downstreamStage = PROMOTION_ORDER[PROMOTION_ORDER.indexOf(sourceStage) + 1];
|
|
107
|
+
if (!downstreamStage || PROMOTION_ORDER.indexOf(sourceStage) < 0) { // eslint-disable-line unicorn/prefer-includes
|
|
108
|
+
return core_1.ux.error(`Unable to diff ${targetAppName}`);
|
|
109
|
+
}
|
|
110
|
+
const downstreamApps = allApps.filter(function (app) {
|
|
111
|
+
return app.coupling.stage === downstreamStage;
|
|
112
|
+
});
|
|
113
|
+
if (downstreamApps.length === 0) {
|
|
114
|
+
return core_1.ux.error(`Cannot diff ${targetAppName} as there are no downstream apps configured`);
|
|
115
|
+
}
|
|
116
|
+
// Fetch GitHub repo/latest release hash for [target, downstream[0], .., downstream[n]] apps
|
|
117
|
+
const appInfoPromises = [this.getAppInfo(targetAppName, targetAppId)];
|
|
118
|
+
downstreamApps.forEach(app => {
|
|
119
|
+
if (app.name && app.id) {
|
|
120
|
+
appInfoPromises.push(this.getAppInfo(app.name, app.id));
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
core_1.ux.action.start('Fetching release info for all apps');
|
|
124
|
+
const appInfo = await Promise.all(appInfoPromises);
|
|
125
|
+
core_1.ux.action.stop();
|
|
126
|
+
// Verify the target app
|
|
127
|
+
const targetAppInfo = appInfo[0];
|
|
128
|
+
if (!targetAppInfo.repo) {
|
|
129
|
+
const command = `heroku pipelines:open ${coupling.pipeline.name}`;
|
|
130
|
+
return core_1.ux.error(`${targetAppName} does not seem to be connected to GitHub!\nRun ${color_1.default.cyan(command)} and "Connect to GitHub".`);
|
|
131
|
+
}
|
|
132
|
+
if (!targetAppInfo.hash) {
|
|
133
|
+
return core_1.ux.error(`No release was found for ${targetAppName}, unable to diff`);
|
|
134
|
+
}
|
|
135
|
+
// Fetch GitHub token for the user
|
|
136
|
+
const githubAccount = await this.kolkrabbi.getAccount();
|
|
137
|
+
// Diff [{target, downstream[0]}, {target, downstream[1]}, .., {target, downstream[n]}]
|
|
138
|
+
const downstreamAppsInfo = appInfo.slice(1);
|
|
139
|
+
for (const downstreamAppInfo of downstreamAppsInfo) {
|
|
140
|
+
await diff(targetAppInfo, downstreamAppInfo, githubAccount.github.token, this.config.userAgent);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
exports.default = PipelinesDiff;
|
|
145
|
+
PipelinesDiff.description = 'compares the latest release of this app to its downstream app(s)';
|
|
146
|
+
PipelinesDiff.examples = [
|
|
147
|
+
'$ heroku pipelines:diff -a my-app-staging',
|
|
148
|
+
];
|
|
149
|
+
PipelinesDiff.flags = {
|
|
150
|
+
app: command_1.flags.app({ required: true }),
|
|
151
|
+
remote: command_1.flags.remote(),
|
|
152
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Command } from '@heroku-cli/command';
|
|
2
|
+
export default class Pipelines extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
class Pipelines extends command_1.Command {
|
|
6
|
+
async run() {
|
|
7
|
+
const { flags } = await this.parse(Pipelines);
|
|
8
|
+
const { body: pipelines } = await this.heroku.get('/pipelines');
|
|
9
|
+
if (flags.json) {
|
|
10
|
+
core_1.ux.styledJSON(pipelines);
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
core_1.ux.styledHeader('My Pipelines');
|
|
14
|
+
for (const pipeline of pipelines) {
|
|
15
|
+
core_1.ux.log(pipeline.name);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.default = Pipelines;
|
|
21
|
+
Pipelines.description = 'list pipelines you have access to';
|
|
22
|
+
Pipelines.examples = [
|
|
23
|
+
'$ heroku pipelines',
|
|
24
|
+
];
|
|
25
|
+
Pipelines.flags = {
|
|
26
|
+
json: command_1.flags.boolean({ description: 'output in json format' }),
|
|
27
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Command } from '@heroku-cli/command';
|
|
2
|
+
export default class PipelinesInfo extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
'with-owners': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
};
|
|
9
|
+
static args: {
|
|
10
|
+
pipeline: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
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 api_1 = require("../../lib/pipelines/api");
|
|
6
|
+
const disambiguate_1 = require("../../lib/pipelines/disambiguate");
|
|
7
|
+
const render_pipeline_1 = require("../../lib/pipelines/render-pipeline");
|
|
8
|
+
class PipelinesInfo extends command_1.Command {
|
|
9
|
+
async run() {
|
|
10
|
+
const { args, flags } = await this.parse(PipelinesInfo);
|
|
11
|
+
const pipeline = await (0, disambiguate_1.default)(this.heroku, args.pipeline);
|
|
12
|
+
const pipelineApps = await (0, api_1.listPipelineApps)(this.heroku, pipeline.id);
|
|
13
|
+
if (flags.json) {
|
|
14
|
+
core_1.ux.styledJSON({ pipeline, apps: pipelineApps });
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
await (0, render_pipeline_1.default)(this.heroku, pipeline, pipelineApps, {
|
|
18
|
+
withOwners: flags['with-owners'],
|
|
19
|
+
showOwnerWarning: true,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.default = PipelinesInfo;
|
|
25
|
+
PipelinesInfo.description = 'show list of apps in a pipeline';
|
|
26
|
+
PipelinesInfo.examples = [
|
|
27
|
+
'$ heroku pipelines:info my-pipeline',
|
|
28
|
+
];
|
|
29
|
+
PipelinesInfo.flags = {
|
|
30
|
+
json: command_1.flags.boolean({
|
|
31
|
+
description: 'output in json format',
|
|
32
|
+
}),
|
|
33
|
+
'with-owners': command_1.flags.boolean({
|
|
34
|
+
description: 'shows owner of every app',
|
|
35
|
+
hidden: true,
|
|
36
|
+
}),
|
|
37
|
+
};
|
|
38
|
+
PipelinesInfo.args = {
|
|
39
|
+
pipeline: core_1.Args.string({
|
|
40
|
+
description: 'pipeline to show list of apps for',
|
|
41
|
+
required: true,
|
|
42
|
+
}),
|
|
43
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Command } from '@heroku-cli/command';
|
|
2
|
+
export default class Open extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
pipeline: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
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 open = require("open");
|
|
6
|
+
const disambiguate_1 = require("../../lib/pipelines/disambiguate");
|
|
7
|
+
class Open extends command_1.Command {
|
|
8
|
+
async run() {
|
|
9
|
+
const { args } = await this.parse(Open);
|
|
10
|
+
const pipeline = await (0, disambiguate_1.default)(this.heroku, args.pipeline);
|
|
11
|
+
await open(`https://dashboard.heroku.com/pipelines/${pipeline.id}`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.default = Open;
|
|
15
|
+
Open.description = 'open a pipeline in dashboard';
|
|
16
|
+
Open.examples = ['$ heroku pipelines:open my-pipeline'];
|
|
17
|
+
Open.args = {
|
|
18
|
+
pipeline: core_1.Args.string({ description: 'name of pipeline', required: true }),
|
|
19
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Command } from '@heroku-cli/command';
|
|
2
|
+
export declare const sleep: (time: number) => Promise<unknown>;
|
|
3
|
+
export default class Promote extends Command {
|
|
4
|
+
static description: string;
|
|
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
|
+
to: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|