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

Allow Elixir install for non-Jenkins users #74

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mattbaileyuk
Copy link

In #73 there was a change to install Hex as part of installing Elixir. There is then a step to chown the home directory, presumably because of files added by that install.

However, this broke our pipeline because we use install-elixir.sh when building a container image (so in a Dockerfile) in our pipeline, and so the user running the script is not jenkins.

So I've updated the script to support other users running the script, testing the fork in our pipeline.

Comment on lines 73 to 74
MIX_HOME=${HOME}.mix /usr/local/bin/mix local.hex --force
chown -R $(whoami):$(whoami) ${HOME}
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure if this was running as jenkins or as root. It might have been as root then whoami, won't work. Maybe a CI_USER or similar variable might work here.

This might not be an issue any longer after apache/couchdb#5250. If this gets a bit tricky to fix we can probably just skip installing hex altogether and let make clean || true do it's thing on failure of make clean.

Copy link
Author

Choose a reason for hiding this comment

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

In our case it was running as root rather than jenkins which is the cause of the problems (we don't even have a jenkins user when running this script, so chown fails). But with this change it's fine as I believe whoami does always return "root" when you're running as root (and even when running sudo whoami as any user)

bin/install-elixir.sh Outdated Show resolved Hide resolved
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.

3 participants