TESTSERVER_MGMT_PASSWD_FILE=/etc/jenkins/pserver2.ipmi
MAILTO=liveboot-announce@profitbricks.com
+TFTP_TARGET=/srv/tftp/liveboot
+HTTP_TARGET=/var/www/liveboot/
+
#
-# check if we have a LIVEBOOT_ID
+# check if we have a LIVEBOOT_BUILD_NUMBER
#
-if [ "$LIVEBOOT_ID" != "" ] ; then
- echo "Ok, got LIVEBOOT_ID=$LIVEBOOT_ID, which is valid."
+if [ "$LIVEBOOT_BUILD_NUMBER" != "" ] ; then
+ echo "Ok, got LIVEBOOT_BUILD_NUMBER=$LIVEBOOT_BUILD_NUMBER, which is valid."
else
- echo "Fail, no LIVEBOOT_ID set."
+ echo "Fail, no LIVEBOOT_BUILD_NUMBER set."
exit 1
fi
#
# check if there is an image for it
#
-if [ -d /srv/mirror/liveboot/liveboot-????????-${LIVEBOOT_ID}/ ] ; then
- SOURCE_DIR=$(ls -d /srv/mirror/liveboot/liveboot-????????-${LIVEBOOT_ID}/)
+if [ -d /srv/mirror/liveboot/liveboot-????????-${LIVEBOOT_BUILD_NUMBER}/ ] ; then
+ SOURCE_DIR=$(ls -d /srv/mirror/liveboot/liveboot-????????-${LIVEBOOT_BUILD_NUMBER}/)
echo "Ok, found directory $SOURCE_DIR"
else
figlet "Failure:"
- echo "/srv/mirror/liveboot/liveboot-????????-${LIVEBOOT_ID}/ does not exist."
+ echo "/srv/mirror/liveboot/liveboot-????????-${LIVEBOOT_BUILD_NUMBER}/ does not exist."
exit 1
fi
-# FIXME
#
# reconfigure PXE to make $TESTSERVER boot this image
#
-#ssh liveboot@riserver echo Ok
+###
+### needs ~liveboot@riserver:.ssh/authorized_keys configured like this
+### command="/bin/cp ${SSH_ORIGINAL_COMMAND#* }",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,from="192.168.178.17"
+### thanks to http://larstobi.blogspot.de/2011/01/restrict-ssh-access-to-one-command-but.html
+###
+ssh liveboot@riserver cp -v $SOURCE_DIR/vmlinuz $TFTP_TARGET/
+ssh liveboot@riserver cp -v $SOURCE_DIR/initramfs.cpio.gz $TFTP_TARGET/
+echo "Ok, copied vmlinuz and initramfs.cpio.gz from $SOURCE_DIR to riserver:$TFTP_TARGET/"
+ssh liveboot@riserver cp -v $SOURCE_DIR/root.tar.xz $HTTP_TARGET/
+echo "Ok, copied root.tar.xz from $SOURCE_DIR to riserver:$HTTP_TARGET/"
#
# reboot TESTSERVER