mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-20 22:23:07 +00:00
Merge pull request #497 from resin-io/share-build-opts
Share nocache and tag build options between build and deploy
This commit is contained in:
commit
be0d6d5a99
@ -40,15 +40,6 @@ module.exports = {
|
||||
parameter: 'application',
|
||||
description: 'The target resin.io application this build is for',
|
||||
alias: 'a'
|
||||
}, {
|
||||
signature: 'tag',
|
||||
parameter: 'tag',
|
||||
description: 'The alias to the generated image',
|
||||
alias: 't'
|
||||
}, {
|
||||
signature: 'nocache',
|
||||
description: "Don't use docker layer caching when building",
|
||||
boolean: true
|
||||
}
|
||||
]),
|
||||
action: function(params, options, done) {
|
||||
|
@ -1,8 +1,10 @@
|
||||
// Generated by CoffeeScript 1.12.5
|
||||
var Promise, formatImageName, getBuilderPushEndpoint, getBundleInfo, parseInput, performUpload, pushProgress, uploadToPromise;
|
||||
var Promise, dockerUtils, formatImageName, getBuilderPushEndpoint, getBundleInfo, parseInput, performUpload, pushProgress, uploadToPromise;
|
||||
|
||||
Promise = require('bluebird');
|
||||
|
||||
dockerUtils = require('../utils/docker');
|
||||
|
||||
getBuilderPushEndpoint = function(baseUrl, owner, app) {
|
||||
var escApp, escOwner;
|
||||
escOwner = encodeURIComponent(owner);
|
||||
@ -115,7 +117,7 @@ module.exports = {
|
||||
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',
|
||||
permission: 'user',
|
||||
options: [
|
||||
options: dockerUtils.appendOptions([
|
||||
{
|
||||
signature: 'build',
|
||||
boolean: true,
|
||||
@ -127,14 +129,13 @@ module.exports = {
|
||||
description: 'The source directory to use when building the image',
|
||||
alias: 's'
|
||||
}
|
||||
],
|
||||
]),
|
||||
action: function(params, options, done) {
|
||||
var _, docker, dockerUtils, resin, tmp, tmpNameAsync;
|
||||
var _, docker, resin, tmp, tmpNameAsync;
|
||||
_ = require('lodash');
|
||||
tmp = require('tmp');
|
||||
tmpNameAsync = Promise.promisify(tmp.tmpName);
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
dockerUtils = require('../utils/docker');
|
||||
tmp.setGracefulCleanup();
|
||||
docker = dockerUtils.getDocker(options);
|
||||
return parseInput(params, options).then(function(arg) {
|
||||
|
@ -30,6 +30,15 @@ exports.appendOptions = function(opts) {
|
||||
signature: 'key',
|
||||
parameter: 'key',
|
||||
description: 'Docker host TLS key file'
|
||||
}, {
|
||||
signature: 'tag',
|
||||
parameter: 'tag',
|
||||
description: 'The alias to the generated image',
|
||||
alias: 't'
|
||||
}, {
|
||||
signature: 'nocache',
|
||||
description: "Don't use docker layer caching when building",
|
||||
boolean: true
|
||||
}
|
||||
]);
|
||||
};
|
||||
|
@ -56,17 +56,6 @@ module.exports =
|
||||
description: 'The target resin.io application this build is for'
|
||||
alias: 'a'
|
||||
},
|
||||
{
|
||||
signature: 'tag'
|
||||
parameter: 'tag'
|
||||
description: 'The alias to the generated image'
|
||||
alias: 't'
|
||||
},
|
||||
{
|
||||
signature: 'nocache'
|
||||
description: "Don't use docker layer caching when building"
|
||||
boolean: true
|
||||
},
|
||||
]
|
||||
action: (params, options, done) ->
|
||||
dockerUtils.runBuild(params, options, getBundleInfo)
|
||||
|
@ -1,4 +1,5 @@
|
||||
Promise = require('bluebird')
|
||||
dockerUtils = require('../utils/docker')
|
||||
|
||||
getBuilderPushEndpoint = (baseUrl, owner, app) ->
|
||||
escOwner = encodeURIComponent(owner)
|
||||
@ -99,7 +100,7 @@ module.exports =
|
||||
$ resin deploy myApp myApp/myImage
|
||||
'''
|
||||
permission: 'user'
|
||||
options: [
|
||||
options: dockerUtils.appendOptions [
|
||||
{
|
||||
signature: 'build'
|
||||
boolean: true
|
||||
@ -119,8 +120,6 @@ module.exports =
|
||||
tmpNameAsync = Promise.promisify(tmp.tmpName)
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
|
||||
dockerUtils = require('../utils/docker')
|
||||
|
||||
# Ensure the tmp files gets deleted
|
||||
tmp.setGracefulCleanup()
|
||||
|
||||
|
@ -40,7 +40,18 @@ exports.appendOptions = (opts) ->
|
||||
signature: 'key'
|
||||
parameter: 'key'
|
||||
description: 'Docker host TLS key file'
|
||||
}
|
||||
},
|
||||
{
|
||||
signature: 'tag'
|
||||
parameter: 'tag'
|
||||
description: 'The alias to the generated image'
|
||||
alias: 't'
|
||||
},
|
||||
{
|
||||
signature: 'nocache'
|
||||
description: "Don't use docker layer caching when building"
|
||||
boolean: true
|
||||
},
|
||||
]
|
||||
|
||||
exports.generateConnectOpts = generateConnectOpts = (opts) ->
|
||||
|
Loading…
Reference in New Issue
Block a user