heroku 8.7.2-beta.2 → 8.7.2-beta.4
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 +2 -5
- package/lib/commands/local/index.d.ts +1 -1
- package/lib/commands/local/index.js +0 -1
- package/lib/commands/local/run.d.ts +1 -1
- package/lib/commands/local/run.js +0 -1
- package/lib/lib/local/run-foreman.d.ts +1 -0
- package/lib/lib/local/run-foreman.js +229 -1
- package/oclif.manifest.json +3 -5
- package/package.json +8 -6
package/README.md
CHANGED
|
@@ -56,7 +56,6 @@ For other issues, [submit a support ticket](https://help.heroku.com/).
|
|
|
56
56
|
* [`heroku logs`](docs/logs.md) - display recent log output
|
|
57
57
|
* [`heroku maintenance`](docs/maintenance.md) - enable/disable access to app
|
|
58
58
|
* [`heroku members`](docs/members.md) - manage organization members
|
|
59
|
-
* [`heroku notifications`](docs/notifications.md) - display notifications
|
|
60
59
|
* [`heroku orgs`](docs/orgs.md) - manage organizations
|
|
61
60
|
* [`heroku pg`](docs/pg.md) - manage postgresql databases
|
|
62
61
|
* [`heroku pipelines`](docs/pipelines.md) - manage pipelines
|
|
@@ -65,7 +64,6 @@ For other issues, [submit a support ticket](https://help.heroku.com/).
|
|
|
65
64
|
* [`heroku psql`](docs/psql.md) - open a psql shell to the database
|
|
66
65
|
* [`heroku redis`](docs/redis.md) - manage heroku redis instances
|
|
67
66
|
* [`heroku regions`](docs/regions.md) - list available regions for deployment
|
|
68
|
-
* [`heroku releases`](docs/releases.md) - display the releases for an app
|
|
69
67
|
* [`heroku reviewapps`](docs/reviewapps.md) - manage reviewapps in pipelines
|
|
70
68
|
* [`heroku run`](docs/run.md) - run a one-off process inside a Heroku dyno
|
|
71
69
|
* [`heroku sessions`](docs/sessions.md) - OAuth sessions
|
|
@@ -85,15 +83,14 @@ This project is built with [lerna](https://lerna.js.org/). The core plugins are
|
|
|
85
83
|
|
|
86
84
|
After cloning the repo
|
|
87
85
|
1. Run `yarn` to install dependencies
|
|
88
|
-
2. Run `yarn
|
|
89
|
-
- This repo currently uses an older version of Lerna. We recommend using the version specified in the package.json instead of a newer version that you may have installed globally.
|
|
86
|
+
2. Run `yarn build` to build the CLI. This will need to be re-run any time you make changes and want to test them locally.
|
|
90
87
|
|
|
91
88
|
To execute Heroku CLI commands locally, use `./bin/run <command>`. For example, to run the `heroku apps` command with your local code, run `./bin/run apps` from the root directory.
|
|
92
89
|
|
|
93
90
|
Testing
|
|
94
91
|
=======
|
|
95
92
|
|
|
96
|
-
Run all tests with `yarn
|
|
93
|
+
Run all tests with `yarn test`.
|
|
97
94
|
|
|
98
95
|
Run one test, in this case plugin-certs-v5, with `yarn lerna run --scope @heroku-cli/plugin-certs-v5 test`.
|
|
99
96
|
|
|
@@ -9,7 +9,7 @@ export default class Index extends Command {
|
|
|
9
9
|
static flags: {
|
|
10
10
|
procfile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
11
|
env: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
12
|
-
port: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
12
|
+
port: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
13
13
|
restart: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
14
|
concurrency: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
15
15
|
};
|
|
@@ -5,7 +5,7 @@ export default class Run extends Command {
|
|
|
5
5
|
static strict: boolean;
|
|
6
6
|
static flags: {
|
|
7
7
|
env: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
|
-
port: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
|
+
port: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
9
|
};
|
|
10
10
|
run(): Promise<void>;
|
|
11
11
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,2 +1,230 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
// Copyright IBM Corp. 2012,2015. All Rights Reserved.
|
|
3
|
+
// Node module: foreman
|
|
4
|
+
// This file is licensed under the MIT License.
|
|
5
|
+
// License text available at https://opensource.org/licenses/MIT
|
|
6
|
+
// This file is copied from the Node Foreman package. It was copied in order to fix
|
|
7
|
+
// a bug related to the use of port 5000 as a default. It is not meant to be a
|
|
8
|
+
// long-term solution, we plan to eventually remove our dependency on Node Foreman.
|
|
9
|
+
// These rules are disabled in order to prevent the need for refactoring
|
|
10
|
+
/* eslint-disable guard-for-in */
|
|
11
|
+
/* eslint-disable new-cap */
|
|
12
|
+
const path = require('path');
|
|
13
|
+
const events = require('events');
|
|
14
|
+
const fs = require('fs');
|
|
15
|
+
const quote = require('shell-quote').quote;
|
|
16
|
+
const program = require('commander');
|
|
17
|
+
const colors = require('foreman/lib/colors');
|
|
18
|
+
const display = require('foreman/lib/console').Console;
|
|
19
|
+
const _proc = require('foreman/lib/proc');
|
|
20
|
+
const _procfile = require('foreman/lib/procfile');
|
|
21
|
+
const _envs = require('foreman/lib/envs');
|
|
22
|
+
const _requirements = require('foreman/lib/requirements');
|
|
23
|
+
const startProxies = require('foreman/lib/proxy').startProxies;
|
|
24
|
+
const startForward = require('foreman/lib/forward').startForward;
|
|
25
|
+
const exporters = require('foreman/lib/exporters');
|
|
26
|
+
const foremanPjson = require('foreman/package.json');
|
|
27
|
+
program.version(foremanPjson.version);
|
|
28
|
+
program.option('-j, --procfile <FILE>', 'load procfile FILE', 'Procfile');
|
|
29
|
+
program.option('-e, --env <FILE>', 'load environment from FILE, a comma-separated list', '.env');
|
|
30
|
+
program.option('-p, --port <PORT>', 'start indexing ports at number PORT', 0);
|
|
31
|
+
// Foreman Event Bus/Emitter //
|
|
32
|
+
var emitter = new events.EventEmitter();
|
|
33
|
+
emitter.once('killall', function (signal) {
|
|
34
|
+
display.Done('Killing all processes with signal ', signal);
|
|
35
|
+
});
|
|
36
|
+
emitter.setMaxListeners(50);
|
|
37
|
+
var start = _proc.start;
|
|
38
|
+
var once = _proc.once;
|
|
39
|
+
var loadProc = _procfile.loadProc;
|
|
40
|
+
var loadEnvs = _envs.loadEnvs;
|
|
41
|
+
var getreqs = _requirements.getreqs;
|
|
42
|
+
var calculatePadding = _requirements.calculatePadding;
|
|
43
|
+
// Kill All Child Processes on SIGINT
|
|
44
|
+
process.once('SIGINT', function () {
|
|
45
|
+
display.Warn('Interrupted by User');
|
|
46
|
+
emitter.emit('killall', 'SIGINT');
|
|
47
|
+
});
|
|
48
|
+
program
|
|
49
|
+
.command('start [procs]')
|
|
50
|
+
.usage('[Options] [Processes] e.g. web=1,log=2,api')
|
|
51
|
+
.option('-s, --showenvs', 'show ENV variables on start', false)
|
|
52
|
+
.option('-x, --proxy <PORT>', 'start a load balancing proxy on PORT')
|
|
53
|
+
.option('--ssl-key <KEY FILE>', 'a key file to use when proxying SSL')
|
|
54
|
+
.option('--ssl-cert <CERT FILE>', 'a cert file to use when proxying SSL')
|
|
55
|
+
.option('-f, --forward <PORT>', 'start a forward proxy on PORT')
|
|
56
|
+
.option('-i, --intercept <HOSTNAME>', 'set forward proxy to intercept HOSTNAME', null)
|
|
57
|
+
.option('-r, --raw', 'raw log output with no app name, timestamp, wrap or trim', false)
|
|
58
|
+
.option('-t, --trim <N>', 'trim logs to N characters', 0)
|
|
59
|
+
.option('-w, --wrap', 'wrap logs (negates trim)')
|
|
60
|
+
.description('Start the jobs in the Procfile')
|
|
61
|
+
.action(function (args) {
|
|
62
|
+
var envs = loadEnvs(program.env);
|
|
63
|
+
var proc = loadProc(program.procfile);
|
|
64
|
+
if (!proc) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (this.showenvs) {
|
|
68
|
+
for (var key in envs) {
|
|
69
|
+
display.Alert('env %s=%s', key, envs[key]);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
var reqs = getreqs(args, proc);
|
|
73
|
+
display.padding = calculatePadding(reqs);
|
|
74
|
+
display.raw = this.raw;
|
|
75
|
+
if (this.wrap) {
|
|
76
|
+
display.wrapline = process.stdout.columns - display.padding - 7;
|
|
77
|
+
display.trimline = 0;
|
|
78
|
+
display.Alert('Wrapping display Output to %d Columns', display.wrapline);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
display.trimline = this.trim;
|
|
82
|
+
if (display.trimline > 0) {
|
|
83
|
+
display.Alert('Trimming display Output to %d Columns', display.trimline);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (this.forward) {
|
|
87
|
+
startForward(this.forward, this.intercept, emitter);
|
|
88
|
+
}
|
|
89
|
+
// using port 5006 because it is not known to be used by other common software
|
|
90
|
+
startProxies(reqs, proc, this, emitter, program.port || envs.PORT || process.env.PORT || 5006);
|
|
91
|
+
start(proc, reqs, envs, program.port || envs.PORT || process.env.PORT || 5006, emitter);
|
|
92
|
+
});
|
|
93
|
+
program
|
|
94
|
+
.command('run <COMMAND...>')
|
|
95
|
+
.usage('[Options]')
|
|
96
|
+
.option('-s, --showenvs', 'show ENV variables on start', false)
|
|
97
|
+
.description('Run a one off process using the ENV variables')
|
|
98
|
+
.action(function (args) {
|
|
99
|
+
var envs = loadEnvs(program.env);
|
|
100
|
+
var callback = function (code) {
|
|
101
|
+
process.exit(code);
|
|
102
|
+
};
|
|
103
|
+
if (!args || args.length === 0) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
var input = quote(args);
|
|
107
|
+
if (this.showenvs) {
|
|
108
|
+
for (var key in envs) {
|
|
109
|
+
display.Alert('env %s=%s', key, envs[key]);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
display.trimline = process.stdout.columns - 5;
|
|
113
|
+
once(input, envs, callback);
|
|
114
|
+
});
|
|
115
|
+
program
|
|
116
|
+
.command('export [PROCS]')
|
|
117
|
+
.option('-a, --app <NAME>', 'export upstart application as NAME', 'foreman')
|
|
118
|
+
.option('-u, --user <NAME>', 'export upstart user as NAME', 'root')
|
|
119
|
+
.option('-o, --out <DIR>', 'export upstart files to DIR', '.')
|
|
120
|
+
.option('-c, --cwd <DIR>', 'change current working directory to DIR')
|
|
121
|
+
.option('-g, --gid <GID>', 'set gid of upstart config to GID')
|
|
122
|
+
.option('-l, --log <DIR>', 'specify upstart log directory', '/var/log')
|
|
123
|
+
.option('-t, --type <TYPE>', 'export file to TYPE (default upstart)', 'upstart')
|
|
124
|
+
.option('-m, --template <DIR>', 'use template folder')
|
|
125
|
+
.description('Export to an upstart job independent of foreman')
|
|
126
|
+
.action(function (procArgs) {
|
|
127
|
+
var envs = loadEnvs(program.env);
|
|
128
|
+
var procs = loadProc(program.procfile);
|
|
129
|
+
if (!procs) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
var req = getreqs(procArgs, procs);
|
|
133
|
+
// Variables for Upstart Template
|
|
134
|
+
var config = {
|
|
135
|
+
application: this.app,
|
|
136
|
+
cwd: path.resolve(process.cwd(), this.cwd || ''),
|
|
137
|
+
user: this.user,
|
|
138
|
+
logs: this.log,
|
|
139
|
+
envs: envs,
|
|
140
|
+
group: this.gid || this.user,
|
|
141
|
+
template: this.template,
|
|
142
|
+
};
|
|
143
|
+
config.envfile = path.resolve(program.env);
|
|
144
|
+
var writeout;
|
|
145
|
+
if (exporters[this.type]) {
|
|
146
|
+
writeout = exporters[this.type];
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
display.Error('Unknown Export Format', this.type);
|
|
150
|
+
process.exit(1);
|
|
151
|
+
}
|
|
152
|
+
// Check for Upstart User
|
|
153
|
+
// friendly warning - does not stop export
|
|
154
|
+
var userExists = false;
|
|
155
|
+
fs.readFileSync('/etc/passwd')
|
|
156
|
+
.toString().split(/\n/).forEach(function (line) {
|
|
157
|
+
if (line.match(/^[^:]*/)[0] === config.user) {
|
|
158
|
+
userExists = true;
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
if (!userExists) {
|
|
162
|
+
display.Warn(display.fmt('User %s Does Not Exist on System', config.user));
|
|
163
|
+
}
|
|
164
|
+
// using port 5006 because it is not known to be used by other common software
|
|
165
|
+
var baseport = Number.parseInt(program.port || envs.PORT || process.env.PORT || 5006);
|
|
166
|
+
var baseport_i = 0;
|
|
167
|
+
var baseport_j = 0;
|
|
168
|
+
var envl = [];
|
|
169
|
+
config.processes = [];
|
|
170
|
+
// This is ugly because of shitty support for array copying
|
|
171
|
+
// Cleanup is definitely required
|
|
172
|
+
for (var key in req) {
|
|
173
|
+
var c = {};
|
|
174
|
+
var cmd = procs[key];
|
|
175
|
+
if (!cmd) {
|
|
176
|
+
display.Warn("Required Key '%s' Does Not Exist in Procfile Definition", key);
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
var n = req[key];
|
|
180
|
+
config.processes.push({ process: key, n: n });
|
|
181
|
+
c.process = key;
|
|
182
|
+
c.command = cmd;
|
|
183
|
+
for (var _ in config) {
|
|
184
|
+
c[_] = config[_];
|
|
185
|
+
}
|
|
186
|
+
c.numbers = [];
|
|
187
|
+
for (var i = 1; i <= n; i++) {
|
|
188
|
+
const port = (baseport + baseport_i + baseport_j) * 100;
|
|
189
|
+
const envl = [];
|
|
190
|
+
for (key in envs) {
|
|
191
|
+
envl.push({
|
|
192
|
+
key: key,
|
|
193
|
+
value: envs[key],
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
envl.push({ key: 'PORT', value: conf.port });
|
|
197
|
+
// eslint-disable-next-line unicorn/no-array-push-push
|
|
198
|
+
envl.push({ key: 'FOREMAN_WORKER_NAME', value: conf.process + '.' + conf.number });
|
|
199
|
+
conf.envs = envl;
|
|
200
|
+
const conf = Object.assign(Object.assign({}, c), { number: i, port, envs: envl });
|
|
201
|
+
// Write the APP-PROCESS-N.conf File
|
|
202
|
+
writeout.foreman_app_n(conf, this.out);
|
|
203
|
+
baseport_i++;
|
|
204
|
+
c.numbers.push({ number: i });
|
|
205
|
+
}
|
|
206
|
+
envl = [];
|
|
207
|
+
for (key in envs) {
|
|
208
|
+
envl.push({
|
|
209
|
+
key: key,
|
|
210
|
+
value: envs[key],
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
c.envs = envl;
|
|
214
|
+
// Write the APP-Process.conf File
|
|
215
|
+
writeout.foreman_app(c, this.out);
|
|
216
|
+
baseport_i = 0;
|
|
217
|
+
baseport_j++;
|
|
218
|
+
}
|
|
219
|
+
// Write the APP.conf File
|
|
220
|
+
writeout.foreman(config, this.out);
|
|
221
|
+
});
|
|
222
|
+
program.parse(process.argv);
|
|
223
|
+
if (process.argv.slice(2).length === 0) {
|
|
224
|
+
console.log(colors.cyan(' _____ '));
|
|
225
|
+
console.log(colors.cyan(' | __|___ ___ ___ _____ ___ ___ '));
|
|
226
|
+
console.log(colors.yellow(' | __| . | _| -_| | | |'));
|
|
227
|
+
console.log(colors.magenta(' |__| |___|_| |___|_|_|_|_^_|_|_|'));
|
|
228
|
+
program.outputHelp();
|
|
229
|
+
process.exit(1);
|
|
230
|
+
}
|
package/oclif.manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "8.7.2-beta.
|
|
2
|
+
"version": "8.7.2-beta.4",
|
|
3
3
|
"commands": {
|
|
4
4
|
"console": {
|
|
5
5
|
"id": "console",
|
|
@@ -1876,8 +1876,7 @@
|
|
|
1876
1876
|
"type": "option",
|
|
1877
1877
|
"char": "p",
|
|
1878
1878
|
"description": "port to listen on",
|
|
1879
|
-
"multiple": false
|
|
1880
|
-
"default": "5001"
|
|
1879
|
+
"multiple": false
|
|
1881
1880
|
},
|
|
1882
1881
|
"restart": {
|
|
1883
1882
|
"name": "restart",
|
|
@@ -1925,8 +1924,7 @@
|
|
|
1925
1924
|
"name": "port",
|
|
1926
1925
|
"type": "option",
|
|
1927
1926
|
"char": "p",
|
|
1928
|
-
"multiple": false
|
|
1929
|
-
"default": "5001"
|
|
1927
|
+
"multiple": false
|
|
1930
1928
|
}
|
|
1931
1929
|
},
|
|
1932
1930
|
"args": {}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "heroku",
|
|
3
3
|
"description": "CLI to interact with Heroku",
|
|
4
|
-
"version": "8.7.2-beta.
|
|
4
|
+
"version": "8.7.2-beta.4",
|
|
5
5
|
"author": "Jeff Dickey @jdxcode",
|
|
6
6
|
"bin": "./bin/run",
|
|
7
7
|
"bugs": "https://github.com/heroku/cli/issues",
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
"@heroku-cli/command-v9": "npm:@heroku-cli/command@^9.0.2",
|
|
12
12
|
"@heroku-cli/notifications": "^1.2.2",
|
|
13
13
|
"@heroku-cli/plugin-addons-v5": "^8.6.0",
|
|
14
|
-
"@heroku-cli/plugin-apps-v5": "^8.
|
|
14
|
+
"@heroku-cli/plugin-apps-v5": "^8.7.2-beta.4",
|
|
15
15
|
"@heroku-cli/plugin-certs-v5": "^8.6.0",
|
|
16
|
-
"@heroku-cli/plugin-ci-v5": "^8.7.2-beta.
|
|
16
|
+
"@heroku-cli/plugin-ci-v5": "^8.7.2-beta.3",
|
|
17
17
|
"@heroku-cli/plugin-container-registry-v5": "^8.6.0",
|
|
18
|
-
"@heroku-cli/plugin-orgs-v5": "^8.7.2-beta.
|
|
18
|
+
"@heroku-cli/plugin-orgs-v5": "^8.7.2-beta.3",
|
|
19
19
|
"@heroku-cli/plugin-pg-v5": "^8.7.0",
|
|
20
20
|
"@heroku-cli/plugin-ps": "^8.1.7",
|
|
21
21
|
"@heroku-cli/plugin-ps-exec": "^2.4.0",
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"ansi-escapes": "3.2.0",
|
|
47
47
|
"async-file": "^2.0.2",
|
|
48
48
|
"chalk": "^2.4.2",
|
|
49
|
+
"commander": "^2.15.1",
|
|
49
50
|
"date-fns": "^2.30.0",
|
|
50
51
|
"debug": "4.1.1",
|
|
51
52
|
"edit-string": "^1.1.6",
|
|
@@ -64,7 +65,7 @@
|
|
|
64
65
|
"rollbar": "^2.26.2",
|
|
65
66
|
"semver": "5.6.0",
|
|
66
67
|
"shell-escape": "^0.2.0",
|
|
67
|
-
"shell-quote": "^1.
|
|
68
|
+
"shell-quote": "^1.8.1",
|
|
68
69
|
"tmp": "^0.0.33",
|
|
69
70
|
"true-myth": "2.2.3",
|
|
70
71
|
"tslib": "1.14.1",
|
|
@@ -91,6 +92,7 @@
|
|
|
91
92
|
"@types/phoenix": "^1.4.0",
|
|
92
93
|
"@types/proxyquire": "^1.3.28",
|
|
93
94
|
"@types/shell-escape": "^0.2.0",
|
|
95
|
+
"@types/shell-quote": "^1.7.5",
|
|
94
96
|
"@types/supports-color": "^5.3.0",
|
|
95
97
|
"@types/urijs": "^1.19.4",
|
|
96
98
|
"@types/uuid": "^8.3.0",
|
|
@@ -343,5 +345,5 @@
|
|
|
343
345
|
"version": "oclif readme --multi && git add README.md ../../docs"
|
|
344
346
|
},
|
|
345
347
|
"types": "lib/index.d.ts",
|
|
346
|
-
"gitHead": "
|
|
348
|
+
"gitHead": "a789932e6ea415d0ed841738c02c7d652df0d21a"
|
|
347
349
|
}
|