
There is no jenkins, only zuul! With zuulv3 running in production, there is no more need to add jenkins user or scripts to our images. Move chmod of /opt/cache/files from nodepool/elements/jenkins-slave/install.d/20-jenkins-slave to nodepool/elements/zuul-worker/install.d/60-zuul-worker We also leave the jenkins-slave elements for now, in case 3rd party CI use them. Change-Id: Ia9750877fbc1a17ec467ca4ac685afdb9c1627f8 Signed-off-by: Paul Belanger <pabelanger@redhat.com>
52 lines
1.5 KiB
Bash
Executable File
52 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
|
|
set -x
|
|
fi
|
|
set -eu
|
|
set -o pipefail
|
|
|
|
# Add zuul user and group. Note we don't want to rely on
|
|
# "useradd"'s group adding behaviour, because it might differ across
|
|
# distros.
|
|
groupadd zuul
|
|
useradd -m zuul -g zuul -s /bin/bash
|
|
|
|
cat > /etc/sudoers.d/zuul << EOF
|
|
zuul ALL=(ALL) NOPASSWD:ALL
|
|
EOF
|
|
chmod 0440 /etc/sudoers.d/zuul
|
|
|
|
visudo -c || die "Error setting zuul sudo!"
|
|
|
|
# this was copied from outside the chroot by extras.d
|
|
_pub_key=/tmp/in_target.d/zuul-user-ssh-public-key
|
|
if [ ! -f $_pub_key ]; then
|
|
die "Can not find Zuul public key!"
|
|
fi
|
|
|
|
mkdir -p /home/zuul/.ssh
|
|
chmod 700 /home/zuul/.ssh
|
|
cp $_pub_key /home/zuul/.ssh/authorized_keys
|
|
|
|
# cleanup everything to the right owner
|
|
chown -R zuul:zuul /home/zuul
|
|
|
|
# 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/zuul
|
|
#
|
|
# We do this for zuul as relative paths to the current user's homedir
|
|
# are used in places like devstack-gate.
|
|
#
|
|
# 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/zuul/cache
|
|
chown zuul:zuul /home/zuul/cache
|
|
ln -sf /opt/cache/files /home/zuul/cache/files
|
|
# but make sure the cache is readable by everyone
|
|
chmod -R a+rX /opt/cache/files/*
|
|
fi
|