jjb: infra: bifrost-verify.sh: Make sure the cache directory exists 43/25143/2
authorMarkos Chandras <mchandras@suse.de>
Tue, 29 Nov 2016 12:34:36 +0000 (12:34 +0000)
committerMarkos Chandras <mchandras@suse.de>
Tue, 29 Nov 2016 17:41:58 +0000 (17:41 +0000)
Fixes the following problem on new slaves:

chown: cannot access '/home/jenkins/.cache': No such file or directory

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

index ded4ed4..9fbb1d0 100755 (executable)
@@ -17,6 +17,9 @@ function fix_ownership() {
     if [ -z "${JOB_URL+x}" ]; then
         echo "Not running as part of Jenkins. Handle the logs manually."
     else
+        # Make sure cache exists
+        [[ ! -d ${HOME}/.cache ]] && mkdir ${HOME}/.cache
+
         sudo chown -R jenkins:jenkins $WORKSPACE
         sudo chown -R jenkins:jenkins ${HOME}/.cache
     fi