From: Jeremy Phelps Date: Tue, 16 Oct 2018 21:26:46 +0000 (-0500) Subject: Set PATH in Ubuntu 18.04 VM's X-Git-Tag: v0.25.3^0 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=20a62ebd073aefe410e04ff0b27d97d1d4971539;p=releng%2Fglobal-jjb.git Set PATH in Ubuntu 18.04 VM's This is a workaround for a bash 3.4 bug that does not set ~/.local/bin in PATH. Change-Id: I69a94442bf7b760712bf72cdbc207451b73cd408 Issue-ID: RELENG-1320 Signed-off-by: Jeremy Phelps --- diff --git a/jenkins-init-scripts/create-jenkins-user.sh b/jenkins-init-scripts/create-jenkins-user.sh index 40ac25f3..00052442 100755 --- a/jenkins-init-scripts/create-jenkins-user.sh +++ b/jenkins-init-scripts/create-jenkins-user.sh @@ -10,6 +10,13 @@ ############################################################################## OS=$(facter operatingsystem | tr '[:upper:]' '[:lower:]') +OS_RELEASE=$(facter lsbdistrelease | tr '[:upper:]' '[:lower:]') + +if [[ "$OS_RELEASE" == "18.04" ]] && [[ "$OS" == 'ubuntu' ]] +then + echo 'PATH=$HOME/.local/bin:$PATH +export PATH' >> /etc/profile +fi useradd -m -s /bin/bash jenkins diff --git a/releasenotes/notes/fix_path-59e63b4be43c0bb1.yaml b/releasenotes/notes/fix_path-59e63b4be43c0bb1.yaml new file mode 100644 index 00000000..f4967d7d --- /dev/null +++ b/releasenotes/notes/fix_path-59e63b4be43c0bb1.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + On Ubuntu 18.04 set PATH to include $HOME/.local/bin. + This is needed for pip install --user to work, and is missing + in Ubuntu versions past 16.04.