From 1a48fed1f7e3ba1ca7b918f0cfa15018133916f4 Mon Sep 17 00:00:00 2001 From: Cameron Diver Date: Wed, 30 May 2018 14:33:05 +0100 Subject: [PATCH] Support pinned release preloading Change-type: minor Closes: #886 Signed-off-by: Cameron Diver --- doc/cli.markdown | 4 ++++ lib/actions/preload.coffee | 10 ++++++++++ package.json | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/doc/cli.markdown b/doc/cli.markdown index c21856c8..48a4f46a 100644 --- a/doc/cli.markdown +++ b/doc/cli.markdown @@ -1206,6 +1206,10 @@ path to a png image to replace the splash screen Disables check for matching device types in image and application +#### --pin-device-to-release, -p + +Pin the preloaded device to the preloaded release on provision + #### --docker, -P <docker> Path to a local docker socket diff --git a/lib/actions/preload.coffee b/lib/actions/preload.coffee index fd35ce91..1f4731e5 100644 --- a/lib/actions/preload.coffee +++ b/lib/actions/preload.coffee @@ -144,6 +144,12 @@ module.exports = boolean: true description: 'Disables check for matching device types in image and application' } + { + signature: 'pin-device-to-release' + boolean: true + description: 'Pin the preloaded device to the preloaded release on provision' + alias: 'p' + } ] action: (params, options, done) -> _ = require('lodash') @@ -186,6 +192,9 @@ module.exports = if options.dontCheckDeviceType and not options.appId exitWithExpectedError('You need to specify an app id if you disable the device type check.') + options.pinDevice = options['pin-device-to-release'] + delete options['pin-device-to-release'] + # Get a configured dockerode instance dockerUtils.getDocker(options) .then (docker) -> @@ -199,6 +208,7 @@ module.exports = options.splashImage options.proxy options.dontCheckDeviceType + options.pinDevice ) gotSignal = false diff --git a/package.json b/package.json index dcc57d9b..3e2eda8f 100644 --- a/package.json +++ b/package.json @@ -146,7 +146,7 @@ "resin-image-fs": "^5.0.2", "resin-image-manager": "^5.0.0", "resin-multibuild": "^0.5.1", - "resin-preload": "^6.2.0", + "resin-preload": "^6.3.0", "resin-release": "^1.2.0", "resin-sdk": "9.0.0-beta18", "resin-sdk-preconfigured": "^6.9.0",