From bea7b2035af0b65f2e5c1b9f01ec642de0d27e11 Mon Sep 17 00:00:00 2001 From: Jacinto Arias Date: Fri, 23 Jun 2017 17:20:16 +0200 Subject: [PATCH] Added --squash option to resin build command --- build/utils/docker.js | 7 +++++++ doc/cli.markdown | 8 ++++++++ lib/utils/docker.coffee | 7 +++++++ 3 files changed, 22 insertions(+) diff --git a/build/utils/docker.js b/build/utils/docker.js index 8e336259..beef09de 100644 --- a/build/utils/docker.js +++ b/build/utils/docker.js @@ -53,6 +53,10 @@ exports.appendOptions = function(opts) { description: 'Run an emulated build using Qemu', boolean: true, alias: 'e' + }, { + signature: 'squash', + description: 'Squash newly built layers into a single new layer', + boolean: true } ]); }; @@ -280,6 +284,9 @@ exports.runBuild = function(params, options, getBundleInfo, logStreams) { return logging.logWarn(logStreams, "Could not parse variable: '" + arg + "'"); }); } + if (options.squash != null) { + opts['squash'] = true; + } return builder.createBuildStream(opts, hooks, reject); }); }); diff --git a/doc/cli.markdown b/doc/cli.markdown index fbd83a26..c1ea7cb6 100644 --- a/doc/cli.markdown +++ b/doc/cli.markdown @@ -1406,6 +1406,10 @@ Don't use docker layer caching when building Run an emulated build using Qemu +#### --squash + +Squash newly built layers into a single new layer + ## deploy <appName> [image] Use this command to deploy an image to an application, optionally building it first. @@ -1473,6 +1477,10 @@ Don't use docker layer caching when building Run an emulated build using Qemu +#### --squash + +Squash newly built layers into a single new layer + # Utilities ## util available-drives diff --git a/lib/utils/docker.coffee b/lib/utils/docker.coffee index a7dfd025..8f246f0e 100644 --- a/lib/utils/docker.coffee +++ b/lib/utils/docker.coffee @@ -66,6 +66,11 @@ exports.appendOptions = (opts) -> description: 'Run an emulated build using Qemu' boolean: true alias: 'e' + }, + { + signature: 'squash' + description: 'Squash newly built layers into a single new layer' + boolean: true } ] @@ -290,6 +295,8 @@ exports.runBuild = (params, options, getBundleInfo, logStreams) -> if options.buildArg? opts['buildargs'] = parseBuildArgs options.buildArg, (arg) -> logging.logWarn(logStreams, "Could not parse variable: '#{arg}'") + if options.squash? + opts['squash'] = true builder.createBuildStream(opts, hooks, reject)