heroku 9.0.0-alpha.3 → 9.0.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/lib/commands/addons/create.d.ts +1 -0
- package/lib/commands/addons/create.js +13 -1
- package/lib/commands/apps/info.js +7 -7
- package/lib/commands/ci/config/get.js +2 -2
- package/lib/commands/ci/config/index.d.ts +1 -0
- package/lib/commands/ci/config/index.js +3 -2
- package/lib/commands/ci/config/set.d.ts +1 -1
- package/lib/commands/ci/config/set.js +1 -1
- package/lib/commands/ci/config/unset.d.ts +0 -1
- package/lib/commands/ci/config/unset.js +2 -3
- package/lib/commands/container/pull.js +3 -0
- package/lib/commands/container/push.js +3 -1
- package/lib/commands/container/release.js +3 -1
- package/lib/commands/container/rm.js +3 -0
- package/lib/commands/container/run.js +3 -0
- package/lib/commands/spaces/transfer.js +2 -2
- package/lib/commands/spaces/trusted-ips/remove.d.ts +1 -1
- package/lib/commands/spaces/trusted-ips/remove.js +1 -1
- package/lib/commands/spaces/vpn/config.js +1 -1
- package/lib/commands/spaces/vpn/connect.js +5 -2
- package/lib/commands/spaces/vpn/destroy.js +4 -1
- package/lib/commands/spaces/vpn/info.js +1 -1
- package/lib/commands/spaces/vpn/update.js +5 -2
- package/lib/commands/spaces/vpn/wait.d.ts +4 -1
- package/lib/commands/spaces/vpn/wait.js +20 -3
- package/lib/lib/container/helpers.d.ts +8 -0
- package/lib/lib/container/helpers.js +26 -0
- package/lib/lib/git/git.js +3 -3
- package/oclif.manifest.json +699 -858
- package/package.json +6 -9
- package/lib/commands/spaces/outbound-rules/add.d.ts +0 -15
- package/lib/commands/spaces/outbound-rules/add.js +0 -81
- package/lib/commands/spaces/outbound-rules/index.d.ts +0 -15
- package/lib/commands/spaces/outbound-rules/index.js +0 -49
- package/lib/commands/spaces/outbound-rules/remove.d.ts +0 -17
- package/lib/commands/spaces/outbound-rules/remove.js +0 -53
|
@@ -6,6 +6,7 @@ const command_1 = require("@heroku-cli/command");
|
|
|
6
6
|
const core_1 = require("@oclif/core");
|
|
7
7
|
const notify_1 = require("../../lib/notify");
|
|
8
8
|
const create_addon_1 = require("../../lib/addons/create_addon");
|
|
9
|
+
const tsheredoc_1 = require("tsheredoc");
|
|
9
10
|
function parseConfig(args) {
|
|
10
11
|
const config = {};
|
|
11
12
|
while (args.length > 0) {
|
|
@@ -68,7 +69,18 @@ class Create extends command_1.Command {
|
|
|
68
69
|
}
|
|
69
70
|
exports.default = Create;
|
|
70
71
|
Create.topic = 'addons';
|
|
71
|
-
Create.description =
|
|
72
|
+
Create.description = (0, tsheredoc_1.default) `
|
|
73
|
+
Create a new add-on resource.
|
|
74
|
+
|
|
75
|
+
In order to add additional config items, please place them at the end of the command after a double-dash (--).
|
|
76
|
+
`;
|
|
77
|
+
Create.example = (0, tsheredoc_1.default) `
|
|
78
|
+
Create an add-on resource:
|
|
79
|
+
$heroku addons:create heroku-redis --app my-app
|
|
80
|
+
|
|
81
|
+
Create an add-on resource with additional config items:
|
|
82
|
+
$heroku addons:create heroku-postgresql:standard-0 --app my-app -- --fork DATABASE
|
|
83
|
+
`;
|
|
72
84
|
Create.strict = false;
|
|
73
85
|
Create.hiddenAliases = ['addons:add'];
|
|
74
86
|
Create.flags = {
|
|
@@ -4,7 +4,7 @@ const core_1 = require("@oclif/core");
|
|
|
4
4
|
const command_1 = require("@heroku-cli/command");
|
|
5
5
|
const util = require("util");
|
|
6
6
|
const _ = require("lodash");
|
|
7
|
-
const
|
|
7
|
+
const filesize_1 = require("filesize");
|
|
8
8
|
const { countBy, snakeCase } = _;
|
|
9
9
|
function formatDate(date) {
|
|
10
10
|
return date.toISOString();
|
|
@@ -49,7 +49,7 @@ function print(info, addons, collaborators, extended) {
|
|
|
49
49
|
if (info.app.cron_next_run)
|
|
50
50
|
data['Cron Next Run'] = formatDate(new Date(info.app.cron_next_run));
|
|
51
51
|
if (info.app.database_size)
|
|
52
|
-
data['Database Size'] = filesize(info.app.database_size, { round: 0 });
|
|
52
|
+
data['Database Size'] = (0, filesize_1.filesize)(info.app.database_size, { standard: 'jedec', round: 0 });
|
|
53
53
|
if (info.app.create_status !== 'complete')
|
|
54
54
|
data['Create Status'] = info.app.create_status;
|
|
55
55
|
if (info.app.space)
|
|
@@ -61,8 +61,8 @@ function print(info, addons, collaborators, extended) {
|
|
|
61
61
|
data['Auto Cert Mgmt'] = info.app.acm;
|
|
62
62
|
data['Git URL'] = info.app.git_url;
|
|
63
63
|
data['Web URL'] = info.app.web_url;
|
|
64
|
-
data['Repo Size'] = filesize(info.app.repo_size, { round: 0 });
|
|
65
|
-
data['Slug Size'] = filesize(info.app.slug_size, { round: 0 });
|
|
64
|
+
data['Repo Size'] = (0, filesize_1.filesize)(info.app.repo_size, { standard: 'jedec', round: 0 });
|
|
65
|
+
data['Slug Size'] = (0, filesize_1.filesize)(info.app.slug_size, { standard: 'jedec', round: 0 });
|
|
66
66
|
data.Owner = info.app.owner.email;
|
|
67
67
|
data.Region = info.app.region.name;
|
|
68
68
|
data.Dynos = countBy(info.dynos, 'type');
|
|
@@ -107,15 +107,15 @@ class AppsInfo extends command_1.Command {
|
|
|
107
107
|
if (info.app.cron_next_run)
|
|
108
108
|
print('cron_next_run', formatDate(new Date(info.app.cron_next_run)));
|
|
109
109
|
if (info.app.database_size)
|
|
110
|
-
print('database_size', filesize(info.app.database_size, { round: 0 }));
|
|
110
|
+
print('database_size', (0, filesize_1.filesize)(info.app.database_size, { standard: 'jedec', round: 0 }));
|
|
111
111
|
if (info.app.create_status !== 'complete')
|
|
112
112
|
print('create_status', info.app.create_status);
|
|
113
113
|
if (info.pipeline_coupling)
|
|
114
114
|
print('pipeline', `${info.pipeline_coupling.pipeline.name}:${info.pipeline_coupling.stage}`);
|
|
115
115
|
print('git_url', info.app.git_url);
|
|
116
116
|
print('web_url', info.app.web_url);
|
|
117
|
-
print('repo_size', filesize(info.app.repo_size, { round: 0 }));
|
|
118
|
-
print('slug_size', filesize(info.app.slug_size, { round: 0 }));
|
|
117
|
+
print('repo_size', (0, filesize_1.filesize)(info.app.repo_size, { standard: 'jedec', round: 0 }));
|
|
118
|
+
print('slug_size', (0, filesize_1.filesize)(info.app.slug_size, { standard: 'jedec', round: 0 }));
|
|
119
119
|
print('owner', info.app.owner.email);
|
|
120
120
|
print('region', info.app.region.name);
|
|
121
121
|
print('dynos', util.inspect(countBy(info.dynos, 'type')));
|
|
@@ -28,9 +28,9 @@ CiConfigGet.examples = [
|
|
|
28
28
|
];
|
|
29
29
|
CiConfigGet.flags = {
|
|
30
30
|
help: command_1.flags.help({ char: 'h' }),
|
|
31
|
-
app: command_1.flags.app(
|
|
31
|
+
app: command_1.flags.app(),
|
|
32
32
|
remote: command_1.flags.remote(),
|
|
33
|
-
pipeline: command_1.flags.pipeline({
|
|
33
|
+
pipeline: command_1.flags.pipeline({ exactlyOne: ['pipeline', 'app'] }),
|
|
34
34
|
shell: command_1.flags.boolean({ char: 's', description: 'output config var in shell format' }),
|
|
35
35
|
};
|
|
36
36
|
CiConfigGet.args = {
|
|
@@ -4,6 +4,7 @@ export default class CiConfig extends Command {
|
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
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>;
|
|
7
8
|
shell: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
9
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
10
|
pipeline: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
@@ -36,8 +36,9 @@ CiConfig.examples = [
|
|
|
36
36
|
`,
|
|
37
37
|
];
|
|
38
38
|
CiConfig.flags = {
|
|
39
|
-
app: command_1.flags.
|
|
39
|
+
app: command_1.flags.app(),
|
|
40
|
+
remote: command_1.flags.remote(),
|
|
40
41
|
shell: command_1.flags.boolean({ char: 's', description: 'output config vars in shell format' }),
|
|
41
42
|
json: command_1.flags.boolean({ description: 'output config vars in json format' }),
|
|
42
|
-
pipeline: command_1.flags.pipeline(),
|
|
43
|
+
pipeline: command_1.flags.pipeline({ exactlyOne: ['pipeline', 'app'] }),
|
|
43
44
|
};
|
|
@@ -6,7 +6,7 @@ export default class CiConfigSet extends Command {
|
|
|
6
6
|
static flags: {
|
|
7
7
|
app: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
8
|
remote: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
|
-
pipeline: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
|
+
pipeline: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
10
|
};
|
|
11
11
|
static strict: boolean;
|
|
12
12
|
run(): Promise<void>;
|
|
@@ -44,6 +44,6 @@ CiConfigSet.examples = [
|
|
|
44
44
|
CiConfigSet.flags = {
|
|
45
45
|
app: command_1.flags.app(),
|
|
46
46
|
remote: command_1.flags.remote(),
|
|
47
|
-
pipeline: command_1.flags.pipeline({
|
|
47
|
+
pipeline: command_1.flags.pipeline({ exactlyOne: ['pipeline', 'app'] }),
|
|
48
48
|
};
|
|
49
49
|
CiConfigSet.strict = false;
|
|
@@ -5,7 +5,6 @@ export default class CiConfigUnset extends Command {
|
|
|
5
5
|
static examples: string[];
|
|
6
6
|
static strict: boolean;
|
|
7
7
|
static flags: {
|
|
8
|
-
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
9
8
|
app: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
9
|
remote: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
10
|
pipeline: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
@@ -29,8 +29,7 @@ CiConfigUnset.examples = [
|
|
|
29
29
|
];
|
|
30
30
|
CiConfigUnset.strict = false;
|
|
31
31
|
CiConfigUnset.flags = {
|
|
32
|
-
|
|
33
|
-
app: command_1.flags.app({ required: false }),
|
|
32
|
+
app: command_1.flags.app(),
|
|
34
33
|
remote: command_1.flags.remote(),
|
|
35
|
-
pipeline: command_1.flags.pipeline({
|
|
34
|
+
pipeline: command_1.flags.pipeline({ exactlyOne: ['pipeline', 'app'] }),
|
|
36
35
|
};
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const command_1 = require("@heroku-cli/command");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
5
|
const DockerHelper = require("../../lib/container/docker_helper");
|
|
6
|
+
const helpers_1 = require("../../lib/container/helpers");
|
|
6
7
|
const debug_1 = require("../../lib/container/debug");
|
|
7
8
|
const color_1 = require("@heroku-cli/color");
|
|
8
9
|
class Pull extends command_1.Command {
|
|
@@ -12,6 +13,8 @@ class Pull extends command_1.Command {
|
|
|
12
13
|
if (argv.length === 0) {
|
|
13
14
|
this.error(`Error: Requires one or more process types\n${Pull.example}`);
|
|
14
15
|
}
|
|
16
|
+
const { body: appBody } = await this.heroku.get(`/apps/${app}`);
|
|
17
|
+
(0, helpers_1.ensureContainerStack)(appBody, 'pull');
|
|
15
18
|
const herokuHost = process.env.HEROKU_HOST || 'heroku.com';
|
|
16
19
|
const registry = `registry.${herokuHost}`;
|
|
17
20
|
if (verbose) {
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const command_1 = require("@heroku-cli/command");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
5
|
const DockerHelper = require("../../lib/container/docker_helper");
|
|
6
|
+
const helpers_1 = require("../../lib/container/helpers");
|
|
6
7
|
const debug_1 = require("../../lib/container/debug");
|
|
7
8
|
async function selectJobs(jobs, processTypes, recursive) {
|
|
8
9
|
let filteredJobs = {};
|
|
@@ -37,7 +38,8 @@ class Push extends command_1.Command {
|
|
|
37
38
|
if (processTypes.length > 1 && !recursive) {
|
|
38
39
|
core_1.ux.error('Requires exactly one target process type, or --recursive option', { exit: 1 });
|
|
39
40
|
}
|
|
40
|
-
await this.heroku.get(`/apps/${app}`);
|
|
41
|
+
const { body: appBody } = await this.heroku.get(`/apps/${app}`);
|
|
42
|
+
(0, helpers_1.ensureContainerStack)(appBody, 'push');
|
|
41
43
|
const herokuHost = process.env.HEROKU_HOST || 'heroku.com';
|
|
42
44
|
const registry = `registry.${herokuHost}`;
|
|
43
45
|
const dockerfiles = DockerHelper.getDockerfiles(process.cwd(), recursive);
|
|
@@ -5,6 +5,7 @@ const command_1 = require("@heroku-cli/command");
|
|
|
5
5
|
const core_1 = require("@oclif/core");
|
|
6
6
|
const debug_1 = require("../../lib/container/debug");
|
|
7
7
|
const streamer_1 = require("../../lib/container/streamer");
|
|
8
|
+
const helpers_1 = require("../../lib/container/helpers");
|
|
8
9
|
class ContainerRelease extends command_1.Command {
|
|
9
10
|
async run() {
|
|
10
11
|
const { flags, argv } = await this.parse(ContainerRelease);
|
|
@@ -15,7 +16,8 @@ class ContainerRelease extends command_1.Command {
|
|
|
15
16
|
if (verbose) {
|
|
16
17
|
debug_1.debug.enabled = true;
|
|
17
18
|
}
|
|
18
|
-
await this.heroku.get(`/apps/${app}`);
|
|
19
|
+
const { body: appBody } = await this.heroku.get(`/apps/${app}`);
|
|
20
|
+
(0, helpers_1.ensureContainerStack)(appBody, 'release');
|
|
19
21
|
const herokuHost = process.env.HEROKU_HOST || 'heroku.com';
|
|
20
22
|
const updateData = [];
|
|
21
23
|
for (const process of argv) {
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const command_1 = require("@heroku-cli/command");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
5
|
const color_1 = require("@heroku-cli/color");
|
|
6
|
+
const helpers_1 = require("../../lib/container/helpers");
|
|
6
7
|
class Rm extends command_1.Command {
|
|
7
8
|
async run() {
|
|
8
9
|
const { argv, flags } = await this.parse(Rm);
|
|
@@ -10,6 +11,8 @@ class Rm extends command_1.Command {
|
|
|
10
11
|
if (argv.length === 0) {
|
|
11
12
|
this.error(`Error: Requires one or more process types\n${Rm.example}`);
|
|
12
13
|
}
|
|
14
|
+
const { body: appBody } = await this.heroku.get(`/apps/${app}`);
|
|
15
|
+
(0, helpers_1.ensureContainerStack)(appBody, 'rm');
|
|
13
16
|
for (const process of argv) {
|
|
14
17
|
core_1.ux.action.start(`Removing container ${process} for ${color_1.default.app(app)}`);
|
|
15
18
|
await this.heroku.patch(`/apps/${app}/formation/${process}`, {
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const command_1 = require("@heroku-cli/command");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
5
|
const DockerHelper = require("../../lib/container/docker_helper");
|
|
6
|
+
const helpers_1 = require("../../lib/container/helpers");
|
|
6
7
|
const debug_1 = require("../../lib/container/debug");
|
|
7
8
|
const color_1 = require("@heroku-cli/color");
|
|
8
9
|
class Run extends command_1.Command {
|
|
@@ -15,6 +16,8 @@ class Run extends command_1.Command {
|
|
|
15
16
|
if (verbose) {
|
|
16
17
|
debug_1.debug.enabled = true;
|
|
17
18
|
}
|
|
19
|
+
const { body: appBody } = await this.heroku.get(`/apps/${app}`);
|
|
20
|
+
(0, helpers_1.ensureContainerStack)(appBody, 'run');
|
|
18
21
|
const processType = argv.shift();
|
|
19
22
|
const command = argv.join(' ');
|
|
20
23
|
const herokuHost = process.env.HEROKU_HOST || 'heroku.com';
|
|
@@ -30,6 +30,6 @@ Transfer.examples = [(0, tsheredoc_1.default)(`
|
|
|
30
30
|
Transferring space-name to team-name... done
|
|
31
31
|
`)];
|
|
32
32
|
Transfer.flags = {
|
|
33
|
-
space: command_1.flags.string({ required: true, description: 'name of space' }),
|
|
34
|
-
team: command_1.flags.string({ required: true, description: 'desired owner of space' }),
|
|
33
|
+
space: command_1.flags.string({ required: true, char: 's', description: 'name of space' }),
|
|
34
|
+
team: command_1.flags.string({ required: true, char: 't', description: 'desired owner of space' }),
|
|
35
35
|
};
|
|
@@ -5,7 +5,7 @@ export default class Remove extends Command {
|
|
|
5
5
|
static description: string;
|
|
6
6
|
static examples: string[];
|
|
7
7
|
static flags: {
|
|
8
|
-
space: import("@oclif/core/lib/interfaces").OptionFlag<string
|
|
8
|
+
space: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
9
|
confirm: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
10
|
};
|
|
11
11
|
static args: {
|
|
@@ -36,7 +36,7 @@ Remove.examples = [(0, tsheredoc_1.default)(`
|
|
|
36
36
|
Removed 192.168.2.0/24 from trusted IP ranges on my-space
|
|
37
37
|
`)];
|
|
38
38
|
Remove.flags = {
|
|
39
|
-
space: command_1.flags.string({
|
|
39
|
+
space: command_1.flags.string({ required: true, char: 's', description: 'space to remove rule from' }),
|
|
40
40
|
confirm: command_1.flags.string({ description: 'set to space name to bypass confirm prompt' }),
|
|
41
41
|
};
|
|
42
42
|
Remove.args = {
|
|
@@ -31,7 +31,7 @@ Config.description = (0, tsheredoc_1.default)(`
|
|
|
31
31
|
- The VPN Gateway must use the IKE Version shown and the Pre-shared Keys as the authentication method
|
|
32
32
|
`);
|
|
33
33
|
Config.example = (0, tsheredoc_1.default)(`
|
|
34
|
-
$ heroku spaces:vpn:config --space my-space
|
|
34
|
+
$ heroku spaces:vpn:config vpn-connection-name --space my-space
|
|
35
35
|
=== vpn-connection-name VPN Tunnels
|
|
36
36
|
VPN Tunnel Customer Gateway VPN Gateway Pre-shared Key Routable Subnets IKE Version
|
|
37
37
|
────────── ──────────────── ────────────── ────────────── ──────────────── ───────────
|
|
@@ -31,7 +31,7 @@ Connect.description = (0, tsheredoc_1.default) `
|
|
|
31
31
|
The connection is established over the public Internet but all traffic is encrypted using IPSec.
|
|
32
32
|
`;
|
|
33
33
|
Connect.examples = [(0, tsheredoc_1.default) `
|
|
34
|
-
$ heroku spaces:vpn:connect
|
|
34
|
+
$ heroku spaces:vpn:connect vpn-connection-name --ip 35.161.69.30 --cidrs 172.16.0.0/16,10.0.0.0/24 --space my-space
|
|
35
35
|
Creating VPN Connection in space my-space... done
|
|
36
36
|
▸ Use spaces:vpn:wait to track allocation.
|
|
37
37
|
`];
|
|
@@ -41,5 +41,8 @@ Connect.flags = {
|
|
|
41
41
|
space: command_1.flags.string({ char: 's', description: 'space name', required: true }),
|
|
42
42
|
};
|
|
43
43
|
Connect.args = {
|
|
44
|
-
name: core_1.Args.string({
|
|
44
|
+
name: core_1.Args.string({
|
|
45
|
+
required: true,
|
|
46
|
+
description: 'name or id of the VPN connection to create',
|
|
47
|
+
}),
|
|
45
48
|
};
|
|
@@ -31,5 +31,8 @@ Destroy.flags = {
|
|
|
31
31
|
confirm: command_1.flags.string({ description: 'set to VPN connection name to bypass confirm prompt', hidden: true }),
|
|
32
32
|
};
|
|
33
33
|
Destroy.args = {
|
|
34
|
-
name: core_1.Args.string({
|
|
34
|
+
name: core_1.Args.string({
|
|
35
|
+
required: true,
|
|
36
|
+
description: 'name or id of the VPN connection to destroy',
|
|
37
|
+
}),
|
|
35
38
|
};
|
|
@@ -52,7 +52,7 @@ exports.default = Info;
|
|
|
52
52
|
Info.topic = 'spaces';
|
|
53
53
|
Info.description = 'display the information for VPN';
|
|
54
54
|
Info.example = (0, tsheredoc_1.default)(`
|
|
55
|
-
$ heroku spaces:vpn:info --space my-space
|
|
55
|
+
$ heroku spaces:vpn:info vpn-connection-name --space my-space
|
|
56
56
|
=== vpn-connection-name VPN Tunnel Info
|
|
57
57
|
Name: vpn-connection-name
|
|
58
58
|
ID: 123456789012
|
|
@@ -28,9 +28,12 @@ Update.flags = {
|
|
|
28
28
|
space: command_1.flags.string({ char: 's', description: 'space name', required: true }),
|
|
29
29
|
};
|
|
30
30
|
Update.example = (0, tsheredoc_1.default) `
|
|
31
|
-
$ heroku spaces:vpn:update
|
|
31
|
+
$ heroku spaces:vpn:update vpn-connection-name --space my-space --cidrs 172.16.0.0/16,10.0.0.0/24
|
|
32
32
|
Updating VPN Connection in space my-space... done
|
|
33
33
|
`;
|
|
34
34
|
Update.args = {
|
|
35
|
-
name: core_1.Args.string({
|
|
35
|
+
name: core_1.Args.string({
|
|
36
|
+
required: true,
|
|
37
|
+
description: 'name or id of the VPN connection to update',
|
|
38
|
+
}),
|
|
36
39
|
};
|
|
@@ -2,12 +2,15 @@ import { Command } from '@heroku-cli/command';
|
|
|
2
2
|
export default class Wait extends Command {
|
|
3
3
|
static topic: string;
|
|
4
4
|
static description: string;
|
|
5
|
+
static examples: string[];
|
|
5
6
|
static flags: {
|
|
6
7
|
space: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
|
-
name: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
8
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
9
|
interval: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
10
|
timeout: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
11
|
};
|
|
12
|
+
static args: {
|
|
13
|
+
name: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
14
|
+
};
|
|
12
15
|
run(): Promise<void>;
|
|
13
16
|
}
|
|
@@ -4,13 +4,15 @@ const color_1 = require("@heroku-cli/color");
|
|
|
4
4
|
const command_1 = require("@heroku-cli/command");
|
|
5
5
|
const core_1 = require("@oclif/core");
|
|
6
6
|
const vpn_connections_1 = require("../../../lib/spaces/vpn-connections");
|
|
7
|
+
const tsheredoc_1 = require("tsheredoc");
|
|
7
8
|
const wait = (ms) => new Promise(resolve => {
|
|
8
9
|
setTimeout(resolve, ms);
|
|
9
10
|
});
|
|
10
11
|
class Wait extends command_1.Command {
|
|
11
12
|
async run() {
|
|
12
|
-
const { flags } = await this.parse(Wait);
|
|
13
|
-
const {
|
|
13
|
+
const { flags, args } = await this.parse(Wait);
|
|
14
|
+
const { space, json } = flags;
|
|
15
|
+
const { name } = args;
|
|
14
16
|
const interval = (flags.interval ? Number.parseInt(flags.interval, 10) : 10) * 1000;
|
|
15
17
|
const timeout = (flags.timeout ? Number.parseInt(flags.timeout, 10) : 20 * 60) * 1000;
|
|
16
18
|
const deadline = new Date(Date.now() + timeout);
|
|
@@ -44,10 +46,25 @@ class Wait extends command_1.Command {
|
|
|
44
46
|
exports.default = Wait;
|
|
45
47
|
Wait.topic = 'spaces';
|
|
46
48
|
Wait.description = 'wait for VPN Connection to be created';
|
|
49
|
+
Wait.examples = [(0, tsheredoc_1.default) `
|
|
50
|
+
$ heroku spaces:vpn:wait vpn-connection-name --space my-space
|
|
51
|
+
Waiting for VPN Connection vpn-connection-name to allocate... done
|
|
52
|
+
=== my-space VPN Tunnels
|
|
53
|
+
|
|
54
|
+
VPN Tunnel Customer Gateway VPN Gateway Pre-shared Key Routable Subnets IKE Version
|
|
55
|
+
────────── ──────────────── ────────────── ────────────── ──────────────── ───────────
|
|
56
|
+
Tunnel 1 104.196.121.200 35.171.237.136 abcdef12345 10.0.0.0/16 1
|
|
57
|
+
Tunnel 2 104.196.121.200 52.44.7.216 fedcba54321 10.0.0.0/16 1
|
|
58
|
+
`];
|
|
47
59
|
Wait.flags = {
|
|
48
60
|
space: command_1.flags.string({ char: 's', description: 'space the vpn connection belongs to', required: true }),
|
|
49
|
-
name: command_1.flags.string({ char: 'n', description: 'name or id of the vpn connection to wait for', required: true }),
|
|
50
61
|
json: command_1.flags.boolean({ description: 'output in json format' }),
|
|
51
62
|
interval: command_1.flags.string({ char: 'i', description: 'seconds to wait between poll intervals' }),
|
|
52
63
|
timeout: command_1.flags.string({ char: 't', description: 'maximum number of seconds to wait' }),
|
|
53
64
|
};
|
|
65
|
+
Wait.args = {
|
|
66
|
+
name: core_1.Args.string({
|
|
67
|
+
description: 'name or id of the VPN connection you are waiting on for allocation.',
|
|
68
|
+
required: true,
|
|
69
|
+
}),
|
|
70
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as Heroku from '@heroku-cli/schema';
|
|
2
|
+
/**
|
|
3
|
+
* Ensure that the given app is a container app.
|
|
4
|
+
* @param app {Heroku.App} heroku app
|
|
5
|
+
* @param cmd {String} command name
|
|
6
|
+
* @returns {null} null
|
|
7
|
+
*/
|
|
8
|
+
export declare function ensureContainerStack(app: Heroku.App, cmd: string): void;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ensureContainerStack = void 0;
|
|
4
|
+
const color_1 = require("@heroku-cli/color");
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
|
+
const stackLabelMap = {
|
|
7
|
+
cnb: 'Cloud Native Buildpack',
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Ensure that the given app is a container app.
|
|
11
|
+
* @param app {Heroku.App} heroku app
|
|
12
|
+
* @param cmd {String} command name
|
|
13
|
+
* @returns {null} null
|
|
14
|
+
*/
|
|
15
|
+
function ensureContainerStack(app, cmd) {
|
|
16
|
+
var _a, _b, _c;
|
|
17
|
+
if (((_a = app.stack) === null || _a === void 0 ? void 0 : _a.name) !== 'container') {
|
|
18
|
+
const appLabel = (((_b = app.stack) === null || _b === void 0 ? void 0 : _b.name) && stackLabelMap[app.stack.name]) || ((_c = app.stack) === null || _c === void 0 ? void 0 : _c.name);
|
|
19
|
+
let message = 'This command is for Docker apps only.';
|
|
20
|
+
if (['push', 'release'].includes(cmd)) {
|
|
21
|
+
message += ` Run ${color_1.default.cyan('git push heroku main')} to deploy your ${color_1.default.cyan(app.name)} ${color_1.default.cyan(appLabel)} app instead.`;
|
|
22
|
+
}
|
|
23
|
+
core_1.ux.error(message, { exit: 1 });
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.ensureContainerStack = ensureContainerStack;
|
package/lib/lib/git/git.js
CHANGED
|
@@ -44,11 +44,11 @@ class Git {
|
|
|
44
44
|
return `https://${command_1.vars.httpGitHost}/${app}.git`;
|
|
45
45
|
}
|
|
46
46
|
async remoteUrl(name) {
|
|
47
|
+
var _a, _b, _c;
|
|
47
48
|
const remotes = await this.exec(['remote', '-v']);
|
|
48
|
-
return remotes.split('\n')
|
|
49
|
+
return (_c = (_b = (_a = remotes.split('\n')
|
|
49
50
|
.map(r => r.split('\t'))
|
|
50
|
-
.find(r => r[0] === name)[1]
|
|
51
|
-
.split(' ')[0];
|
|
51
|
+
.find(r => r[0] === name)) === null || _a === void 0 ? void 0 : _a[1]) === null || _b === void 0 ? void 0 : _b.split(' ')[0]) !== null && _c !== void 0 ? _c : '';
|
|
52
52
|
}
|
|
53
53
|
url(app) {
|
|
54
54
|
return this.httpGitUrl(app);
|