From 20a62ebd073aefe410e04ff0b27d97d1d4971539 Mon Sep 17 00:00:00 2001 From: Jeremy Phelps Date: Tue, 16 Oct 2018 16:26:46 -0500 Subject: [PATCH] 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 --- jenkins-init-scripts/create-jenkins-user.sh | 7 +++++++ releasenotes/notes/fix_path-59e63b4be43c0bb1.yaml | 6 ++++++ 2 files changed, 13 insertions(+) create mode 100644 releasenotes/notes/fix_path-59e63b4be43c0bb1.yaml 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. -- 2.16.6