diff --git a/nodepool/elements/jenkins-slave/install.d/20-jenkins-slave b/nodepool/elements/jenkins-slave/install.d/20-jenkins-slave index 13f4296bd0..7060936bc7 100755 --- a/nodepool/elements/jenkins-slave/install.d/20-jenkins-slave +++ b/nodepool/elements/jenkins-slave/install.d/20-jenkins-slave @@ -15,9 +15,15 @@ useradd -g jenkins -m jenkins -s /bin/bash # a lot of caching happens in extra-data.d (for "historical" reasons). # We've put the cache stuff into /opt/cache/files, but again, for # "historical" reasons, ensure this is available in /home/jenkins -mkdir -p /home/jenkins/cache -ln -sf /opt/cache/files /home/jenkins/cache/files -chown -R jenkins:jenkins /opt/cache/files +# +# Check if the cache exists as we don't have a strict dependency on the +# devstack-cache element. This allows you to build an image without +# incurring the cost of caching all the things. +if [ -d /opt/cache/files ] ; then + mkdir -p /home/jenkins/cache + ln -sf /opt/cache/files /home/jenkins/cache/files + chown -R jenkins:jenkins /opt/cache/files +fi # this was copied from outside the chroot by extras.d _pub_key=/tmp/in_target.d/jenkins-user-ssh-public-key