Merge pull request #556 from resin-io/deploy-ux-improvements

Resin deploy ux improvements
This commit is contained in:
Tim Perry 2017-06-15 14:31:27 +02:00 committed by GitHub
commit f465e74a87
4 changed files with 14 additions and 7 deletions

View File

@ -10,6 +10,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- `package-lock.json` for `npm5` users
- Added ability to run an emulated build silently with `resin build`
- Gzip images when uploading in `resin deploy`
- Show a clear message immediately as the deploy starts, if we're deploying an image.
### Fixed

View File

@ -171,8 +171,8 @@ uploadToPromise = function(uploadRequest, 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 supported with this command.\n\nExamples:\n $ resin deploy myApp --build --source myBuildDir/\n $ resin deploy myApp myApp/myImage',
description: 'Deploy an image to a resin.io application',
help: 'Use this command to deploy an image to an application, optionally building it first.\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([
{
@ -226,10 +226,13 @@ module.exports = {
}).then(function(arg1) {
var buildLogs, imageName;
imageName = arg1.image, buildLogs = arg1.log;
logging.logInfo(logStreams, 'Initializing deploy...');
logs = buildLogs;
return Promise.all([dockerUtils.bufferImage(docker, imageName, bufferFile), token, username, url, params.appName, logStreams]).spread(performUpload);
})["finally"](function() {
return require('mz/fs').unlink(bufferFile)["catch"](_.noop);
return Promise["try"](function() {
return require('mz/fs').unlink(bufferFile);
})["catch"](_.noop);
});
});
}).tap(function(arg) {

View File

@ -1354,7 +1354,7 @@ Run an emulated build using Qemu
## deploy &#60;appName&#62; [image]
Use this command to deploy and optionally build an image to an application.
Use this command to deploy an image to an application, optionally building it first.
Usage: deploy <appName> ([image] | --build [--source build-dir])

View File

@ -126,9 +126,9 @@ uploadToPromise = (uploadRequest, logStreams) ->
module.exports =
signature: 'deploy <appName> [image]'
description: 'Deploy a container to a resin.io application'
description: 'Deploy an image to a resin.io application'
help: '''
Use this command to deploy and optionally build an image to an application.
Use this command to deploy an image to an application, optionally building it first.
Usage: deploy <appName> ([image] | --build [--source build-dir])
@ -192,6 +192,8 @@ module.exports =
else
{ image: imageName, log: '' }
.then ({ image: imageName, log: buildLogs }) ->
logging.logInfo(logStreams, 'Initializing deploy...')
logs = buildLogs
Promise.all [
dockerUtils.bufferImage(docker, imageName, bufferFile)
@ -206,7 +208,8 @@ module.exports =
# If the file was never written to (for instance because an error
# has occured before any data was written) this call will throw an
# ugly error, just suppress it
require('mz/fs').unlink(bufferFile)
Promise.try ->
require('mz/fs').unlink(bufferFile)
.catch(_.noop)
.tap ({ image: imageName, buildId }) ->
logging.logSuccess(logStreams, "Successfully deployed image: #{formatImageName(imageName)}")