diff --git a/10/s2i/bin/assemble b/10/s2i/bin/assemble index 78c9b975..baa16ed1 100755 --- a/10/s2i/bin/assemble +++ b/10/s2i/bin/assemble @@ -81,11 +81,27 @@ fi if [ "$NODE_ENV" != "production" ]; then echo "---> Building your Node application from source" + + # We will be using npm CI by default for more information please refer to + # https://github.com/sclorg/s2i-nodejs-container/issues/212 + echo "---> Installing dependencies with npm ci" + npm ci || \ + # npm ci will fail if certain conditions aren't met as mentioned in + # https://docs.npmjs.com/cli-commands/ci.html#description + echo "---> npm ci failed, installing dependencies with npm install"; \ npm install else echo "---> Installing all dependencies" + + # We will be using npm CI by default for more information please refer to + # https://github.com/sclorg/s2i-nodejs-container/issues/212 + echo "---> Installing dependencies with npm ci" + NODE_ENV=development npm ci || \ + # npm ci will fail if certain conditions aren't met as mentioned in + # https://docs.npmjs.com/cli-commands/ci.html#description + echo "---> npm ci failed, installing dependencies with npm install"; \ NODE_ENV=development npm install #do not fail when there is no build script diff --git a/12/s2i/bin/assemble b/12/s2i/bin/assemble index 78c9b975..e1e46671 100755 --- a/12/s2i/bin/assemble +++ b/12/s2i/bin/assemble @@ -81,11 +81,26 @@ fi if [ "$NODE_ENV" != "production" ]; then echo "---> Building your Node application from source" - npm install + # We will be using npm CI by default for more information please refer to + # https://github.com/sclorg/s2i-nodejs-container/issues/212 + echo "---> Installing dependencies with npm ci" + npm ci || \ + # npm ci will fail if certain conditions aren't met as mentioned in + # https://docs.npmjs.com/cli-commands/ci.html#description + echo "---> npm ci failed, installing dependencies with npm install"; \ + npm install else echo "---> Installing all dependencies" + + # We will be using npm CI by default for more information please refer to + # https://github.com/sclorg/s2i-nodejs-container/issues/212 + echo "---> Installing dependencies with npm ci" + NODE_ENV=development npm ci || \ + # npm ci will fail if certain conditions aren't met as mentioned in + # https://docs.npmjs.com/cli-commands/ci.html#description + echo "---> npm ci failed, installing dependencies with npm install"; \ NODE_ENV=development npm install #do not fail when there is no build script