Skip to content

Commit 5092bfe

Browse files
committed
Merge branch dev into master
2 parents 2b4e689 + baa1009 commit 5092bfe

27 files changed

+200
-122
lines changed

.eslintrc.yml

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,34 @@ env:
77
es6: true
88
node: true
99
mocha: true
10-
ecmaVersion: 2017
11-
ecmaFeatures:
12-
accessor-pairs: 2
13-
arrowFunctions: true
14-
binaryLiterals: true
15-
blockBindings: true
16-
classes: true
17-
defaultParams: true
18-
destructuring: true
19-
experimentalObjectRestSpread: true
20-
forOf: true
21-
generators: true
22-
globalReturn: true
23-
jsx: true
24-
modules: true
25-
objectLiteralComputedProperties: true
26-
objectLiteralDuplicateProperties: true
27-
objectLiteralShorthandMethods: true
28-
objectLiteralShorthandProperties: true
29-
octalLiterals: true
30-
regexUFlag: true
31-
regexYFlag: true
32-
restParams: true
33-
spread: true
34-
superInFunctions: true
35-
templateStrings: true
36-
unicodeCodePointEscapes: true
10+
parserOptions:
11+
ecmaVersion: 2017
12+
ecmaFeatures:
13+
accessor-pairs: 2
14+
arrowFunctions: true
15+
binaryLiterals: true
16+
blockBindings: true
17+
classes: true
18+
defaultParams: true
19+
destructuring: true
20+
experimentalObjectRestSpread: true
21+
forOf: true
22+
generators: true
23+
globalReturn: true
24+
jsx: true
25+
modules: true
26+
objectLiteralComputedProperties: true
27+
objectLiteralDuplicateProperties: true
28+
objectLiteralShorthandMethods: true
29+
objectLiteralShorthandProperties: true
30+
octalLiterals: true
31+
regexUFlag: true
32+
regexYFlag: true
33+
restParams: true
34+
spread: true
35+
superInFunctions: true
36+
templateStrings: true
37+
unicodeCodePointEscapes: true
3738
rules:
3839
arrow-parens:
3940
- 2

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 1.3.1 - August 23, 2017
2+
- Add `mup ssh <server>` command
3+
- Exit code when task list fails is now 1 instead of 0
4+
- Fix deploying when server's default shell is zsh @thsowers
5+
- All docker commands are run with `sudo`
6+
- `mup proxy stop` doesn't require the `proxy` object to be in the config
7+
- Add option `app.docker.prepareBundle` to enable or disable prepare bundle
8+
19
## 1.3.0 - August 22, 2017
210

311
**Hooks**

docs/docs.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ module.exports = {
126126
]
127127
},
128128

129-
// list of servers to deploy to, from the 'servers' list
129+
// list of servers to deploy to, from the 'servers' list
130130
servers: {
131131
one: {},
132132
two: {},
@@ -157,7 +157,7 @@ module.exports = {
157157
// your app url for mobile app access
158158
server: 'http://app.com',
159159

160-
// adds --allow-incompatible-updates arg to build command
160+
// adds --allow-incompatible-updates arg to build command
161161
allowIncompatibleUpdates: true,
162162

163163
// Executable used to build the meteor project
@@ -914,7 +914,7 @@ module.exports = {
914914
alias: 'f',
915915
description: 'Follow log output'
916916
})
917-
.strict(false);
917+
.strict(false);
918918
},
919919
920920
// This is called when the command is run.

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mup",
3-
"version": "1.3.0",
3+
"version": "1.3.1",
44
"description": "Production Quality Meteor Deployments",
55
"main": "lib/index.js",
66
"repository": {
@@ -37,47 +37,47 @@
3737
"docs": "cd docs && bundle exec jekyll serve"
3838
},
3939
"devDependencies": {
40-
"babel-cli": "^6.23.0",
40+
"babel-cli": "^6.26.0",
4141
"babel-eslint": "^7.1.1",
4242
"babel-plugin-istanbul": "^4.1.4",
4343
"babel-preset-es2015": "^6.22.0",
4444
"babel-preset-es2016": "^6.22.0",
4545
"babel-preset-es2017": "^6.22.0",
4646
"babel-preset-stage-2": "^6.24.1",
4747
"babel-preset-stage-3": "^6.22.0",
48-
"babel-register": "^6.24.1",
49-
"chai": "^3.5.0",
48+
"babel-register": "^6.26.0",
49+
"chai": "^4.1.1",
5050
"chai-string": "^1.4.0",
5151
"cross-env": "^5.0.1",
52-
"eslint": "^3.19.0",
52+
"eslint": "^4.5.0",
5353
"eslint-plugin-babel": "^4.1.0",
5454
"eslint-plugin-markdown": "^1.0.0-beta.4",
5555
"keypair": "^1.0.1",
5656
"mocha": "^3.2.0",
5757
"node-forge": "^0.7.1",
5858
"nyc": "^11.0.3",
59-
"sinon": "^2.3.6"
59+
"sinon": "^3.2.1"
6060
},
6161
"dependencies": {
62-
"archiver": "~1.3.0",
62+
"archiver": "^2.0.0",
6363
"async": "~2.5.0",
64-
"babel-polyfill": "6.6.1",
64+
"babel-polyfill": "^6.26.0",
6565
"bluebird": "~3.5.0",
6666
"boxen": "~1.1.0",
67-
"chalk": "~2.0.1",
68-
"debug": "~2.6.8",
67+
"chalk": "^2.1.0",
68+
"debug": "^3.0.0",
6969
"expand-tilde": "~2.0.2",
7070
"global-modules": "^1.0.0",
7171
"joi": "~10.6.0",
7272
"lodash": "^4.17.4",
7373
"nodemiral": "~1.1.1",
74-
"parse-json": "~2.2.0",
74+
"parse-json": "^3.0.0",
7575
"random-seed": "~0.3.0",
7676
"resolve-from": "^3.0.0",
7777
"shelljs": "~0.5.0",
78-
"silent-npm-registry-client": "2.x.x",
78+
"silent-npm-registry-client": "^3.0.1",
7979
"ssh2": "0.4.x",
80-
"uuid": "2.x.x",
80+
"uuid": "^3.1.0",
8181
"yargs": "~8.0.2"
8282
},
8383
"nyc": {

src/__tests__/utils.unit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe('utils', function() {
3434
};
3535

3636
utils.runTaskList(list, {}, {verbose: true})
37-
.then(() => { cb(); });
37+
.then(() => { cb(); });
3838
});
3939

4040
it('should reject if a task failed', cb => {

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ let program = yargs
104104
.strict(true)
105105
.alias('help', 'h')
106106
.epilogue(
107-
'For more information, read the docs at https://github.com/zodern/meteor-up'
107+
'For more information, read the docs at http://zodern.github.io/meteor-up/docs.html'
108108
)
109109
.help('help');
110110

src/plugin-api.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export default class PluginAPI {
3131
this.runTaskList = utils.runTaskList;
3232
this.getDockerLogs = utils.getDockerLogs;
3333
this.runSSHCommand = utils.runSSHCommand;
34+
this._createSSHOptions = utils.createSSHOptions;
3435
}
3536

3637
getArgs() {
@@ -226,14 +227,15 @@ export default class PluginAPI {
226227
return;
227228
};
228229
_commandErrorHandler(e) {
230+
process.exitCode = 1;
231+
229232
if (e.nodemiralHistory instanceof Array) {
230233
// Error is from nodemiral when running a task list.
231234
// Nodemiral should have already displayed the error
232235
return;
233236
}
234237

235238
console.error(e);
236-
process.exitCode = 1;
237239
}
238240
runCommand = async function(name) {
239241
if (!name) {
@@ -302,9 +304,9 @@ export default class PluginAPI {
302304
}
303305

304306
if (
305-
this._enabledSessions.length > 0 &&
307+
this._enabledSessions.length > 0 &&
306308
this._enabledSessions.indexOf(name) === -1
307-
) {
309+
) {
308310
continue;
309311
}
310312

src/plugins/default/command-handlers.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import debug from 'debug';
22
import fs from 'fs';
33
import sh from 'shelljs';
4+
import { Client } from 'ssh2';
45

56
const log = debug('mup:module:default');
67

@@ -95,3 +96,40 @@ export function stop(api) {
9596
log('exec => mup stop');
9697
return api.runCommand('meteor.stop');
9798
}
99+
100+
export function ssh(api) {
101+
const servers = api.getConfig().servers;
102+
const serverOption = api.getArgs()[1];
103+
104+
if (!(serverOption in servers)) {
105+
console.log('mup ssh <server>');
106+
console.log('Available servers are:\n', Object.keys(servers).join('\n'));
107+
process.exitCode = 1;
108+
return;
109+
}
110+
111+
const server = servers[serverOption];
112+
const sshOptions = api._createSSHOptions(server);
113+
114+
var conn = new Client();
115+
conn.on('ready', function() {
116+
conn.shell(function(err, stream) {
117+
if (err) { throw err; }
118+
stream.on('close', function() {
119+
conn.end();
120+
process.exit();
121+
});
122+
123+
process.stdin.setRawMode(true);
124+
process.stdin.pipe(stream);
125+
126+
stream.pipe(process.stdout);
127+
stream.stderr.pipe(process.stderr);
128+
stream.setWindow(process.stdout.rows, process.stdout.columns);
129+
130+
process.stdout.on('resize', () => {
131+
stream.setWindow(process.stdout.rows, process.stdout.columns);
132+
});
133+
});
134+
}).connect(sshOptions);
135+
}

src/plugins/default/commands.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,9 @@ export let stop = {
5858
description: 'Stop app',
5959
handler: commandHandlers.stop
6060
};
61+
62+
export let ssh = {
63+
name: 'ssh [server]',
64+
description: 'SSH into server',
65+
handler: commandHandlers.ssh
66+
};

src/plugins/docker/assets/docker-setup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ minimumMinor=13
2626

2727
# Is docker already installed?
2828
set +e
29-
hasDocker=$(docker version | grep "version")
30-
serverVersion=$(docker version --format '{{.Server.Version}}')
29+
hasDocker=$(sudo docker version | grep "version")
30+
serverVersion=$(sudo docker version --format '{{.Server.Version}}')
3131
parsedVersion=( ${serverVersion//./ })
3232
majorVersion="${parsedVersion[0]}"
3333
minorVersion="${parsedVersion[1]}"

0 commit comments

Comments
 (0)