summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-01-01 22:52:13 +0100
committerHolger Levsen <holger@layer-acht.org>2015-01-01 22:52:13 +0100
commit74cc97dabfc10262ba0dd22a643ef41e13fd4261 (patch)
treeab367ca8081f9340acc454df0d7bfcd205bff28c
parent823c5afd5576e7aac597178959009f8c2b946d5d (diff)
downloadjenkins.debian.net-74cc97dabfc10262ba0dd22a643ef41e13fd4261.tar.xz
live: use sudo properly
-rwxr-xr-xbin/live-build.sh2
-rwxr-xr-xbin/schroot-create.sh6
-rw-r--r--job-cfg/live.yaml2
3 files changed, 7 insertions, 3 deletions
diff --git a/bin/live-build.sh b/bin/live-build.sh
index 337185e8..e7163eae 100755
--- a/bin/live-build.sh
+++ b/bin/live-build.sh
@@ -24,7 +24,7 @@ case "$2" in
;;
*) ;;
esac
-lb build
+sudo lb build
ls -la *.iso || true
mkdir -p /srv/live-build/results
cp *.iso /srv/live-build/results
diff --git a/bin/schroot-create.sh b/bin/schroot-create.sh
index 0d20be6f..6e2fca46 100755
--- a/bin/schroot-create.sh
+++ b/bin/schroot-create.sh
@@ -60,11 +60,15 @@ bootstrap() {
for d in proc dev dev/pts ; do
sudo mount --bind /$d $CHROOT_TARGET/$d
done
- sudo chroot $CHROOT_TARGET apt-get install -y --no-install-recommends "$@"
+ sudo chroot $CHROOT_TARGET apt-get install -y --no-install-recommends "sudo $@"
# umount in reverse order
for d in dev/pts dev proc ; do
sudo umount -l $CHROOT_TARGET/$d
done
+ # configure sudo inside just like outside
+ echo "jenkins ALL=NOPASSWD: ALL" | sudo tee -a $CHROOT_TARGET/etc/sudoers.d/jenkins >/dev/null
+ sudo chroot $CHROOT_TARGET chown root.root /etc/sudoers.d/jenkins
+ sudo chroot $CHROOT_TARGET chmod 700 /etc/sudoers.d/jenkins
fi
}
diff --git a/job-cfg/live.yaml b/job-cfg/live.yaml
index a88da9f8..05fdf470 100644
--- a/job-cfg/live.yaml
+++ b/job-cfg/live.yaml
@@ -50,5 +50,5 @@
- '{name}_setup_schroot':
my_description: 'Setup schroot for building live images using live-build in a jessie environment.'
my_time: '42 10 1 * *'
- my_shell: '/srv/jenkins/bin/schroot-create.sh live-jessie jessie python live-build'
+ my_shell: '/srv/jenkins/bin/schroot-create.sh live-jessie jessie python sudo live-build'