Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding ability to run npm ci by default #236

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions 10/s2i/bin/assemble
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 16 additions & 1 deletion 12/s2i/bin/assemble
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down