summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeap Admins <sysdev@leap.se>2013-07-08 17:10:18 +0000
committerLeap Admins <sysdev@leap.se>2013-07-08 17:10:18 +0000
commit16db5437fd6f201c7e724678afeefa26251fc092 (patch)
treecbf7e01fbaf1b0d93aaa582936d88222b5b50b97
parentf84dbe8845ee373167fc2ac67e6f9285e8fdaed2 (diff)
use $LEAP_CMD so we can use different leap_cli versions next to each other (#3090)
-rwxr-xr-xleap-platform-test40
1 files changed, 19 insertions, 21 deletions
diff --git a/leap-platform-test b/leap-platform-test
index 195eec5..44c21b2 100755
--- a/leap-platform-test
+++ b/leap-platform-test
@@ -43,7 +43,7 @@ add_nodes() {
;;
esac
- leap node add --local $node $config services:$services
+ $LEAP_CMD node add --local $node $config services:$services
done
}
@@ -51,20 +51,15 @@ add_nodes() {
bootstrap_nodes() {
for vm in $@
do
- leap $OPTS local start $vm
+ $LEAP_CMD $OPTS local start $vm
wait_for_node $vm
- leap $OPTS node init $vm
+ $LEAP_CMD $OPTS node init $vm
# set hostname + do dist-upgrade
- leap $OPTS deploy $vm --tags site_apt::dist_upgrade,site_config::hosts
- leap $OPTS local save $vm
+ $LEAP_CMD $OPTS deploy $vm --tags site_apt::dist_upgrade,site_config::hosts
+ $LEAP_CMD $OPTS local save $vm
done
}
-compile () {
- leap $OPTS clean
- leap $OPTS compile
-}
-
create_provider() {
if [ -e $PROVIDERDIR ]
then
@@ -75,7 +70,7 @@ create_provider() {
mkdir -p $PROVIDERDIR
cd $PROVIDERDIR
- leap $OPTS new --contacts $CONTACTS --domain $DOMAIN --name $PROVIDER --platform=$PLATFORMDIR .
+ $LEAP_CMD $OPTS new --contacts $CONTACTS --domain $DOMAIN --name $PROVIDER --platform=$PLATFORMDIR .
cd $PLATFORMDIR
git checkout $PLATFORM_BRANCH
git submodule sync
@@ -83,10 +78,10 @@ create_provider() {
cd $PROVIDERDIR
# for now, we use the vagrant pubkey until https://leap.se/code/issues/2039 is solved
- leap $OPTS add-user --self --ssh-pub-key=/usr/lib/ruby/gems/1.9.1/gems/leap_cli-0.2.1/vendor/vagrant_ssh_keys/vagrant.pub
- leap $OPTS cert ca && leap cert csr
+ $LEAP_CMD $OPTS add-user --self --ssh-pub-key=/usr/lib/ruby/gems/1.9.1/gems/leap_cli-0.2.1/vendor/vagrant_ssh_keys/vagrant.pub
+ $LEAP_CMD $OPTS cert ca && leap cert csr
- leap $OPTS cert dh
+ $LEAP_CMD $OPTS cert dh
add_nodes $NODES
}
@@ -113,7 +108,7 @@ deploy() {
ERRLOG2="$LOGDIR/deploy-error.log"
echo "Deploying \"$vm\" on `date`"|tee -a $LOG1 $LOG2
- leap $OPTS -v 2 deploy $vm 2>&1 | sed -r "$RMCOLORS" | tee -a $LOG1 $LOG2 | egrep -v "$FILTER_ALL" | tee -a $ERRLOG1 $ERRLOG2 > /dev/null
+ $LEAP_CMD $OPTS -v 2 deploy $vm 2>&1 | sed -r "$RMCOLORS" | tee -a $LOG1 $LOG2 | egrep -v "$FILTER_ALL" | tee -a $ERRLOG1 $ERRLOG2 > /dev/null
if [ -s $ERRLOG1 ]
then
@@ -148,13 +143,12 @@ reset_deploy() {
cd $PROVIDERDIR
log_start
- compile
echo "Starting deploy_nodes for nodes $@ as background tasks on `date`"
for i in $@
do
- leap $OPTS local reset $i
+ $LEAP_CMD $OPTS local reset $i
wait_for_node $i
deploy $i &
done
@@ -191,8 +185,6 @@ update_leap_cli () {
cd /usr/local/src/leap_cli
git fetch
git reset origin/vagrant_1.2 --hard
- /usr/bin/rake build
- sudo /usr/bin/rake install
}
@@ -230,12 +222,12 @@ versions () {
echo "leap_cli:"
echo
echo leap cli: $cli_head
- leap -v 2 list | grep ' = leap command v'
+ $LEAP_CMD -v 2 list | grep ' = leap command v'
echo "$cli_commit"
echo
echo "leap_platform:"
- leap -v 2 list | grep ' = leap platform v'
+ $LEAP_CMD -v 2 list | grep ' = leap platform v'
echo "$platform_commit"
echo
echo
@@ -305,6 +297,12 @@ then
exit 0
fi
+if [ -z $LEAP_CMD ]
+then
+ echo "please provide a path to the leap_cli binary in the config file, using the LEAP_CMD var."
+ exit 1
+fi
+
if $all ; then
# use NODES variable from the config file
nodes=$NODES