mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-04-08 03:44:13 +00:00
Merge pull request #500 from resin-io/fix-ssh
fix ssh proxy URL retrieval
This commit is contained in:
commit
110e18bc88
@ -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
|
||||
|
@ -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([
|
||||
{
|
||||
|
@ -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');
|
||||
}
|
||||
|
@ -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 \
|
||||
|
Loading…
x
Reference in New Issue
Block a user