From 9a7324917618b57fbdfc5439baefd5beaf62b4e2 Mon Sep 17 00:00:00 2001 From: codebymikey <9484406+codebymikey@users.noreply.github.com> Date: Wed, 1 Mar 2023 20:21:04 +0000 Subject: [PATCH] run docker-compose build with an optional --pull --- lib/compose.js | 2 +- lib/router.js | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/compose.js b/lib/compose.js index 1d1d33c38..234771dde 100644 --- a/lib/compose.js +++ b/lib/compose.js @@ -77,7 +77,7 @@ const buildShell = (run, name, compose, opts = {}) => ({ * Run docker compose build */ exports.build = (compose, project, opts = {}) => { - return buildShell('build', project, compose, {pull: _.isEmpty(opts.local)}); + return buildShell('build', project, compose, {pull: _.isEmpty(opts.local) || !_.isEmpty(opts.pullable)}); }; /* diff --git a/lib/router.js b/lib/router.js index 570371db3..75130633d 100644 --- a/lib/router.js +++ b/lib/router.js @@ -30,10 +30,8 @@ exports.eventWrapper = (name, daemon, events, data, run) => daemon.up() * Helper to route to build command */ exports.build = (data, compose) => { - // Pull - return retryEach(data, datum => compose('pull', datum)) - // then build - .then(() => retryEach(data, datum => compose('build', datum))); + // Build (with optional "--pull") + return retryEach(data, datum => compose('build', datum)); }; /*