From a2df948adca354891667f8f3025edd2605e725e9 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Thu, 8 Nov 2012 17:05:14 +0100 Subject: [PATCH] cp files to the right place --- liveboot_testdeploy.sh | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/liveboot_testdeploy.sh b/liveboot_testdeploy.sh index bb4b5e6..a96e51e 100755 --- a/liveboot_testdeploy.sh +++ b/liveboot_testdeploy.sh @@ -13,33 +13,44 @@ TESTSERVER_MGMT_IP=192.168.178.49 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 -- 2.39.5