From: Benjamin Drung Date: Mon, 20 Jan 2014 12:15:38 +0000 (+0100) Subject: pxe_install.sh, pxe_riserver_setup.sh: Support deploying a development version. X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=b92a4fe83ebd099574c759dfa8a9510d6387041f;p=profitbricks%2Fjenkins-build-scripts.git pxe_install.sh, pxe_riserver_setup.sh: Support deploying a development version. --- diff --git a/pxe_install.sh b/pxe_install.sh index db66033..4fbc8a0 100755 --- a/pxe_install.sh +++ b/pxe_install.sh @@ -8,19 +8,20 @@ export echo if [ "$3" = "" ] ; then - echo "$0 must be called with exactly three arguments: hostname mac networkdevice" - echo "eg: $0 gw1301 01-00-25-90-2c-03-8a eth1" + echo "$0 must be called with three or four arguments: hostname mac networkdevice [branch]" + echo "eg: $0 gw1301 01-00-25-90-2c-03-8a eth1 master" exit 1 fi TARGET_HOST=$1 TARGET_MAC=$2 TARGET_DEV=$3 +TARGET_BRANCH=$4 -$(dirname $0)/pxe_riserver_setup.sh $TARGET_HOST $TARGET_MAC $TARGET_DEV install ; \ +$(dirname $0)/pxe_riserver_setup.sh $TARGET_HOST $TARGET_MAC $TARGET_DEV "$TARGET_BRANCH" install ; \ ipmitool -H ${TARGET_HOST}-ipmi -f /etc/jenkins/$TARGET_HOST.ipmi -U ADMIN chassis power reset ; \ sleep 90 ; \ -$(dirname $0)/pxe_riserver_setup.sh $TARGET_HOST $TARGET_MAC $TARGET_DEV localboot +$(dirname $0)/pxe_riserver_setup.sh $TARGET_HOST $TARGET_MAC $TARGET_DEV "$TARGET_BRANCH" localboot # doesnt work because ipmitool too frequently segfaults #ipmitool -H ${TARGET_HOST}-ipmi -f /etc/jenkins/$TARGET_HOST.ipmi -U ADMIN -I lanplus sol activate < /dev/zero | tee $TMPOUTPUT & diff --git a/pxe_riserver_setup.sh b/pxe_riserver_setup.sh index 340768e..56d862b 100755 --- a/pxe_riserver_setup.sh +++ b/pxe_riserver_setup.sh @@ -7,9 +7,9 @@ #export echo -if [ "$4" = "" ] || ( [ "$4" != "install" ] && [ "$4" != "sysinfo" ] && [ "$4" != "localboot" ] ) ; then - echo "$0 must be called with exactly four arguments: hostname mac networkdevice action" - echo "eg: $0 gw1301 01-00-25-90-2c-03-8a eth1 install" +if [ "$5" = "" ] || ( [ "$5" != "install" ] && [ "$5" != "sysinfo" ] && [ "$5" != "localboot" ] ) ; then + echo "$0 must be called with exactly five arguments: hostname mac networkdevice branch action" + echo "eg: $0 gw1301 01-00-25-90-2c-03-8a eth1 master install" echo "action must be either 'install', 'sysinfo' or 'localboot'" exit 1 fi @@ -17,7 +17,8 @@ fi TARGET_HOST=$1 TARGET_MAC=$2 TARGET_DEV=$3 -TARGET_ACTION=$4 +TARGET_BRANCH=$4 +TARGET_ACTION=$5 echo "Re-configuring PXE on riserver:" echo @@ -47,7 +48,7 @@ APPEND initrd=fai/initrd.img root=/dev/nfs nfsroot=/srv/fai/nfsroot boot=live li LABEL install MENU LABEL install KERNEL fai/vmlinuz-install -APPEND initrd=fai/initrd.img root=/dev/nfs nfsroot=/srv/fai/nfsroot boot=live live-netdev=$TARGET_DEV FAI_ACTION=install FAI_FLAGS=verbose,createvt,reboot hostname=$TARGET_HOST +APPEND initrd=fai/initrd.img root=/dev/nfs nfsroot=/srv/fai/nfsroot boot=live live-netdev=$TARGET_DEV FAI_ACTION=install FAI_FLAGS=verbose,createvt,reboot hostname=$TARGET_HOST BRANCH=$TARGET_BRANCH EOF cat $TMPFILE