jjb: infra: Fix ownership for the cache directory 53/22653/1
authorMarkos Chandras <mchandras@suse.de>
Mon, 3 Oct 2016 13:26:22 +0000 (14:26 +0100)
committerMarkos Chandras <mchandras@suse.de>
Mon, 3 Oct 2016 13:26:22 +0000 (14:26 +0100)
Fixes the following error when the ${HOME}/.cache permissions are bad:

The directory '/home/jenkins/.cache/pip/http' or its parent directory is
not owned by the current user and the cache has been disabled. Please
check the permissions and owner of that directory. If executing pip with
sudo, you may want sudo's -H flag.

Change-Id: I16310817e1f36bd8086e196ef61ec10c09ad7366
Signed-off-by: Markos Chandras <mchandras@suse.de>
jjb/infra/bifrost-verify.sh

index 759b50b..f7920a3 100755 (executable)
@@ -18,6 +18,7 @@ function fix_ownership() {
         echo "Not running as part of Jenkins. Handle the logs manually."
     else
         sudo chown -R jenkins:jenkins $WORKSPACE
+        sudo chown -R jenkins:jenkins ${HOME}/.cache
     fi
 }
 
@@ -30,6 +31,9 @@ fi
 # remove previously cloned repos
 sudo /bin/rm -rf /opt/bifrost /opt/puppet-infracloud /opt/stack /opt/releng
 
+# Fix up permissions
+fix_ownership
+
 # clone all the repos first and checkout the patch afterwards
 sudo git clone https://git.openstack.org/openstack/bifrost /opt/bifrost
 sudo git clone https://git.openstack.org/openstack-infra/puppet-infracloud /opt/puppet-infracloud