summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Runner <gitlab-runner@greyhound.leap.se>2016-07-14 18:14:48 +0000
committerGitLab Runner <gitlab-runner@greyhound.leap.se>2016-07-14 18:14:48 +0000
commit51a6c6037b66eaa33515a8ad62aa6e495e8bda74 (patch)
tree818b4e3b4a54c728c20691be6f09e246bb7993ad
parentd1fbbbc49412c89933e13bf06f757c746cda07ba (diff)
improved init_deploy
-rwxr-xr-xleap-platform-test74
1 files changed, 33 insertions, 41 deletions
diff --git a/leap-platform-test b/leap-platform-test
index 44086ce..4a2e278 100755
--- a/leap-platform-test
+++ b/leap-platform-test
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -x
#
@@ -71,24 +71,27 @@ destroy_vms() {
bootstrap_nodes() {
- for vm in "$@"
- do
- $LEAP_CMD $OPTS local start "$vm"
- wait_for_node "$vm"
- $LEAP_CMD $OPTS node init "$vm"
- # set hostname + do dist-upgrade
- # deploying these classes have too much dependencies,
- # this is done now by the "~/vagrant/bootstrap_only.sh" provisioner
- #$LEAP_CMD $OPTS deploy "$vm" --tags site_apt::dist_upgrade,site_config::hosts,site_squid_deb_proxy::client
+ $LEAP_CMD $OPTS local start
+ for vm in $(echo $nodes)
+ do
+ wait_for_node $vm
+ $LEAP_CMD $OPTS node init $vm
- # make sure machines are rebooted in order to be able to load kernel modules after a kernel update
- # https://leap.se/code/issues/6494
- cd "${PROVIDERDIR}/test"
- vagrant reload $vm
+ # set hostname + do dist-upgrade
+ # deploying these classes have too much dependencies,
+ # this is done now by the "~/vagrant/bootstrap_only.sh" provisioner
+ #$LEAP_CMD $OPTS deploy "$vm" --tags site_apt::dist_upgrade,site_config::hosts,site_squid_deb_proxy::client
- $LEAP_CMD $OPTS local save "$vm"
- done
+ done
+
+ # make sure machines are rebooted in order to be able to load kernel modules after a kernel update
+ # https://leap.se/code/issues/6494
+ cd "${PROVIDERDIR}/test"
+ vagrant reload
+ cd ..
+
+ #$LEAP_CMD $OPTS local save
}
cleanup () {
@@ -267,43 +270,28 @@ init_deploy() {
# accepts that the limited tagged deploy that happens in bootstrap_nodes()
# is ok. The following steps happen:
#
- #. make sure the platform and leap cli are up-to-date
- #. reset the nodes to their saved state (saved is after bootstrap_nodes has
- # been run)
- #. run bootstrap_nodes (this will: start vm, run init, run a limited tag
- # deploy, then reset the node)
+ #. run bootstrap_nodes (this will: start vm, run init, provision)
#. deploy the nodes
#. send email
- local nodes="$*"
- update_leap_cli
-
cd "$PROVIDERDIR"
log_start
echo "Starting init_deploy for nodes $* as background tasks on $( date )"
- for i in $nodes
- do
- $LEAP_CMD $OPTS local start "$i"
- $LEAP_CMD $OPTS local reset "$i"
- wait_for_node "$i"
- bootstrap_nodes "$i"
-
- # run cutom provisioning script, i.e. specified in ~/.leaprc
- cd test
- vagrant provision "$i"
- cd ..
+ $LEAP_CMD $OPTS local start
+ #$LEAP_CMD $OPTS local reset
+ wait_for_nodes
+ bootstrap_nodes
- deploy "$i" &
- done
+ # run cutom provisioning script, i.e. specified in ~/.leaprc
+ cd test
+ vagrant provision
+ cd ..
- # needed in a detached screen session, otherwise it would terminate before deploy jobs
- # have finished
- echo "Waiting until last deploy process has finished..."
- wait
+ deploy
if [ -e "$FAILURE_LOCKFILE" ]
then
@@ -628,6 +616,10 @@ echo "@platform_directory_path = \"${ROOTDIR}\"" > ${PROVIDERDIR}/Leapfile
echo "leap_platform is at: ${ROOTDIR}"
echo "provider config is at: ${PROVIDERDIR}"
+$LEAP_CMD env pin $TAG
+
+nodes=$($LEAP_CMD list --print= | sed "s/ //g")
+
case $cmd in
add_nodes) add_nodes "$nodes";;
bootstrap) bootstrap_nodes "$nodes";;