diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ede03f9..562c6b13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/build/actions/deploy.js b/build/actions/deploy.js index 67b7d5cf..0e942189 100644 --- a/build/actions/deploy.js +++ b/build/actions/deploy.js @@ -171,8 +171,8 @@ uploadToPromise = function(uploadRequest, logStreams) { module.exports = { signature: 'deploy [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 ([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 ([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) { diff --git a/doc/cli.markdown b/doc/cli.markdown index e313e073..d4a2e444 100644 --- a/doc/cli.markdown +++ b/doc/cli.markdown @@ -1354,7 +1354,7 @@ Run an emulated build using Qemu ## deploy <appName> [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 ([image] | --build [--source build-dir]) diff --git a/lib/actions/deploy.coffee b/lib/actions/deploy.coffee index 62765a78..5d311a3c 100644 --- a/lib/actions/deploy.coffee +++ b/lib/actions/deploy.coffee @@ -126,9 +126,9 @@ uploadToPromise = (uploadRequest, logStreams) -> module.exports = signature: 'deploy [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 ([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)}")