project-config/nodepool/elements/cache-devstack
Ian Wienand 2e308fc94a Move jenkins cache to /opt/cache
For whatever reason, the source-repositories caching element is
running in the very early extra-data phase of disk-image-builder.
cache-devstack is instructing source-repositories to put the cached
urls into /home/jenkins/cache/files (55-cache-devstack-repos makes up
the list of images to download from devstack; the other two are just
pre-configured URLS).

This causes a problem when trying to add the jenkins user later in
jenkins-slave/install.d/20-jenkins-slave.  Since source repositories
has already created /home/jenkins, useradd won't do it again and does
not copy in any of the skeleton files.

This moves the extra-data phase caching into /opt/cache, which is
probably a more logical place for it anyway.  To maintain the status
quo, after we create the jenkins user, symlink ~jenkins/cache/files to
this new location.

This was probably going wrong with puppet too.  I'm guessing it just
ignored the existing homedir when creating the user.  I have tested
this by building trusty and stopping the build before and after the
useradd calls in 20-jenkins-slave.  "/home" was empty, the useradd
creates the user, group & directory, the symlink is made correctly and
/opt/cache/files appears populated as usual.

Change-Id: Ibca6867f29b257a5110cb5522a5cca3a97fa9377
2017-04-28 16:00:23 +10:00
..
extra-data.d Move jenkins cache to /opt/cache 2017-04-28 16:00:23 +10:00
install.d Don't force python2 for subunit2sql install on workers 2017-04-10 15:47:20 -04:00
README.rst Reorganizes project-config 2014-09-25 11:41:04 -04:00
element-deps Reorganizes project-config 2014-09-25 11:41:04 -04:00
source-repository-pip Move jenkins cache to /opt/cache 2017-04-28 16:00:23 +10:00
source-repository-stackviz Move jenkins cache to /opt/cache 2017-04-28 16:00:23 +10:00

README.rst

Pre-cache all of the things devstack might need