You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "mattbaileyuk (via GitHub)" <gi...@apache.org> on 2024/09/25 10:11:52 UTC

[PR] Allow Elixir install for non-Jenkins users [couchdb-ci]

mattbaileyuk opened a new pull request, #74:
URL: https://github.com/apache/couchdb-ci/pull/74

   In https://github.com/apache/couchdb-ci/pull/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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Allow Elixir install for non-Jenkins users [couchdb-ci]

Posted by "mattbaileyuk (via GitHub)" <gi...@apache.org>.
mattbaileyuk commented on code in PR #74:
URL: https://github.com/apache/couchdb-ci/pull/74#discussion_r1776930404


##########
bin/install-elixir.sh:
##########
@@ -70,5 +70,5 @@ rm elixir.zip
 # it may be called without a preceding configure call, for instance when
 # building packages from a dist tarball. So we ensure it has hex there already.
 echo "===> Installing Hex"
-MIX_HOME=/home/jenkins/.mix /usr/local/bin/mix local.hex --force
-chown -R jenkins:jenkins /home/jenkins
+MIX_HOME=${HOME}.mix /usr/local/bin/mix local.hex --force
+chown -R $(whoami):$(whoami) ${HOME}

Review Comment:
   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)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Allow Elixir install for non-Jenkins users [couchdb-ci]

Posted by "pgj (via GitHub)" <gi...@apache.org>.
pgj commented on code in PR #74:
URL: https://github.com/apache/couchdb-ci/pull/74#discussion_r1776890683


##########
bin/install-elixir.sh:
##########
@@ -70,5 +70,5 @@ rm elixir.zip
 # it may be called without a preceding configure call, for instance when
 # building packages from a dist tarball. So we ensure it has hex there already.
 echo "===> Installing Hex"
-MIX_HOME=/home/jenkins/.mix /usr/local/bin/mix local.hex --force
-chown -R jenkins:jenkins /home/jenkins
+MIX_HOME=${HOME}.mix /usr/local/bin/mix local.hex --force

Review Comment:
   I think there is a slash missing in between `${HOME}` and `.mix`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Allow Elixir install for non-Jenkins users [couchdb-ci]

Posted by "nickva (via GitHub)" <gi...@apache.org>.
nickva commented on code in PR #74:
URL: https://github.com/apache/couchdb-ci/pull/74#discussion_r1775377175


##########
bin/install-elixir.sh:
##########
@@ -70,5 +70,5 @@ rm elixir.zip
 # it may be called without a preceding configure call, for instance when
 # building packages from a dist tarball. So we ensure it has hex there already.
 echo "===> Installing Hex"
-MIX_HOME=/home/jenkins/.mix /usr/local/bin/mix local.hex --force
-chown -R jenkins:jenkins /home/jenkins
+MIX_HOME=${HOME}.mix /usr/local/bin/mix local.hex --force
+chown -R $(whoami):$(whoami) ${HOME}

Review Comment:
   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 https://github.com/apache/couchdb/pull/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`.
   
   
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org