Merge pull request #500 from resin-io/fix-ssh

fix ssh proxy URL retrieval
This commit is contained in:
Eugene Mirotin 2017-04-27 16:24:08 +03:00 committed by GitHub
commit 110e18bc88
4 changed files with 12 additions and 8 deletions

View File

@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
- The `ssh` command was broken
## [5.8.0] - 2017-04-26
### Added

View File

@ -115,7 +115,7 @@ uploadToPromise = function(request, size, logStreams) {
module.exports = {
signature: 'deploy <appName> [image]',
description: 'Deploy a container to a resin.io application',
help: 'Use this command to deploy and optionally build an image to an application.\n\nUsage: deploy <appName> ([image] | --build [--source build-dir])\n\nNote: If building with this command, all options supported by `resin build`\nare also support with this command.\n\nExamples:\n$ resin deploy myApp --build --source myBuildDir/\n$ resin deploy myApp myApp/myImage',
help: 'Use this command to deploy and optionally build an image to an application.\n\nUsage: deploy <appName> ([image] | --build [--source build-dir])\n\nNote: If building with this command, all options supported by `resin build`\nare also supported with this command.\n\nExamples:\n $ resin deploy myApp --build --source myBuildDir/\n $ resin deploy myApp myApp/myImage',
permission: 'user',
options: dockerUtils.appendOptions([
{

View File

@ -53,12 +53,11 @@ module.exports = {
}
],
action: function(params, options, done) {
var Promise, child_process, patterns, proxyUrl, resin, verbose;
var Promise, child_process, patterns, resin, verbose;
child_process = require('child_process');
Promise = require('bluebird');
resin = require('resin-sdk-preconfigured');
patterns = require('../utils/patterns');
proxyUrl = resin.settings.get('proxyUrl');
if (options.port == null) {
options.port = 22;
}
@ -83,10 +82,11 @@ module.exports = {
return Promise.props({
username: resin.auth.whoami(),
uuid: device.uuid,
containerId: resin.models.device.getApplicationInfo(device.uuid).get('containerId')
containerId: resin.models.device.getApplicationInfo(device.uuid).get('containerId'),
proxyUrl: resin.settings.get('proxyUrl')
}).then(function(arg) {
var containerId, username, uuid;
username = arg.username, uuid = arg.uuid, containerId = arg.containerId;
var containerId, proxyUrl, username, uuid;
username = arg.username, uuid = arg.uuid, containerId = arg.containerId, proxyUrl = arg.proxyUrl;
if (containerId == null) {
throw new Error('Did not find running application container');
}

View File

@ -71,7 +71,6 @@ module.exports =
Promise = require 'bluebird'
resin = require('resin-sdk-preconfigured')
patterns = require('../utils/patterns')
proxyUrl = resin.settings.get('proxyUrl')
if not options.port?
options.port = 22
@ -95,7 +94,8 @@ module.exports =
uuid: device.uuid
# get full uuid
containerId: resin.models.device.getApplicationInfo(device.uuid).get('containerId')
.then ({ username, uuid, containerId }) ->
proxyUrl: resin.settings.get('proxyUrl')
.then ({ username, uuid, containerId, proxyUrl }) ->
throw new Error('Did not find running application container') if not containerId?
Promise.try ->
command = "ssh #{verbose} -t \