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 1 commit
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
20 changes: 19 additions & 1 deletion 10/s2i/bin/assemble
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,30 @@ 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"
NODE_ENV=development 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
npm install
NODE_ENV=development npm install

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated my PR.


NODE_ENV=development
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
NODE_ENV=development


#do not fail when there is no build script
echo "---> Building in production mode"
Expand Down
21 changes: 19 additions & 2 deletions 12/s2i/bin/assemble
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,29 @@ 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"
NODE_ENV=development 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
aksgupta14 marked this conversation as resolved.
Show resolved Hide resolved

NODE_ENV=development
aksgupta14 marked this conversation as resolved.
Show resolved Hide resolved

#do not fail when there is no build script
echo "---> Building in production mode"
Expand Down