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

Backport few changes previously done in RHOAR container #226

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

hhorak
Copy link
Member

@hhorak hhorak commented Dec 23, 2019

Most notable changes:

  • npx is used for nodemon execution
  • GIT_COMMITTER_NAME and GIT_COMMITTER_EMAIL variables are set
  • npm cache is cleared by rm -rf .npm (this is commented out, since we've actually had a test for specifically this, that cache is not removed)
  • npm install is run once more when starting the node
  • run npm run build when a build script is present
  • run yarn if is set, although we do not ship yarn in our images

As a site-effect, these changes were done:

  • Match also singular in the test_incremental_build
  • Print the overall test result after the cleanup messages, so it is more visible.
  • Use supported fedora 31 for v10 Fedora Dockerfile
  • Move install-time steps to nodejs_container_install file (fixes also a wrong /usr/bin/nodemon symlink in case of SCLs)

More details in the commit messages in particular commits.

Removing ln -s /usr/lib/node_modules/nodemon/bin/nodemon.js /usr/bin/nodemon
from Dockerfiles because it does not work anyway for SCLs.
Moving it in to nodejs_container_install script that can be used for more actions.

Also fix path for /usr/bin/nodemon symlink, the previous did not work for SCLs.

Similar to RHOAR image, DEBUG_PORT is specified directly in the Dockerfile.

Other steps included in nodejs_container_install file are originally in the install_node.sh file in the RHOAR image.
Most notable changes:
* npx is used for nodemon execution
* GIT_COMMITTER_NAME and GIT_COMMITTER_EMAIL variables are set
* npm cache is cleared by rm -rf .npm
* npm install is run once more when starting the node
* run npm run build when a build script is present
* run yarn if  is set, although we do not ship yarn in our images
We've actually had a test for specifically this, that cache is not removed.

It was added by this commit:
sclorg@0e9b5cb

So it is probable better to not removing it.
When only one package is installed, it says added 1 package.

Also print the overall test result after the cleanup messages, so it is more visible.
@hhorak
Copy link
Member Author

hhorak commented Dec 23, 2019

[test-openshift]

@phracek phracek self-requested a review January 2, 2020 12:41
Copy link
Member

@phracek phracek left a comment

Choose a reason for hiding this comment

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

echo -e "Current git config"
git config --list

if [ -n "$YARN_ENABLED" ]; then
Copy link
Member

Choose a reason for hiding this comment

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

Implementation of YARN_ENABLED is fine. But we will have the same problem with NEXUS_REGISTRY.
I would prefer to add to the condition NPM_MIRROR also yarn config set registry or define a new variable called YARN_MIRROR.

echo -e "Current git config"
git config --list

if [ -n "$YARN_ENABLED" ]; then
Copy link
Member

Choose a reason for hiding this comment

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

The same here with YARN registry

@phracek
Copy link
Member

phracek commented Jan 7, 2020

Thanks for the PR! Nicely done with a couple of comments.

@phracek
Copy link
Member

phracek commented Oct 2, 2023

@hhorak Is this still valid? If so, I would prefer to update it. If not feel free to close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants