summaryrefslogtreecommitdiff
path: root/tests/example-provider
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2017-05-23 13:23:43 +0200
committervarac <varacanero@zeromail.org>2017-05-23 13:23:43 +0200
commitd2dc27738a26b824f42da3fdea527be072867678 (patch)
tree4b711bc9924ff555535112d1711cbdd7d6a55fa3 /tests/example-provider
parent10164a2651cb9ca07442e8382b7e238c8a8939c1 (diff)
[vagrant] Move $OPTS to vagrant config
Diffstat (limited to 'tests/example-provider')
-rwxr-xr-xtests/example-provider/vagrant/configure-leap.sh21
-rw-r--r--tests/example-provider/vagrant/vagrant.config2
2 files changed, 13 insertions, 10 deletions
diff --git a/tests/example-provider/vagrant/configure-leap.sh b/tests/example-provider/vagrant/configure-leap.sh
index a8c0ff20..2ea2f178 100755
--- a/tests/example-provider/vagrant/configure-leap.sh
+++ b/tests/example-provider/vagrant/configure-leap.sh
@@ -1,5 +1,8 @@
#!/bin/sh
+# Exit on failure
+set -e
+
# shellcheck disable=SC1091
. /vagrant/vagrant/vagrant.config
@@ -14,7 +17,7 @@ mkdir -p "$PROVIDERDIR"
chown "${USER}:${USER}" "${PROVIDERDIR}"
cd "$PROVIDERDIR" || exit
-$LEAP "$OPTS" new --contacts "${contacts:?}" --domain "${provider_domain:?}" --name "${provider_name:?}" --platform="$PLATFORMDIR" .
+$LEAP new --contacts "${contacts:?}" --domain "${provider_domain:?}" --name "${provider_name:?}" --platform="$PLATFORMDIR" .
printf '\n@log = "./deploy.log"' >> Leapfile
if [ ! -e "/home/${USER}/.ssh/id_rsa" ]; then
@@ -27,15 +30,15 @@ $SUDO mkdir -p "${PROVIDERDIR}/files/nodes/${NODE}"
sh -c "cat /etc/ssh/ssh_host_rsa_key.pub | cut -d' ' -f1,2 >> $PROVIDERDIR/files/nodes/$NODE/${NODE}_ssh.pub"
chown "${USER}:${USER}" "${PROVIDERDIR}/files/nodes/${NODE}/${NODE}_ssh.pub"
-$LEAP "$OPTS" add-user --self
-$LEAP "$OPTS" cert ca
-$LEAP "$OPTS" cert csr
-$LEAP "$OPTS" node add "$NODE" ip_address:"$(facter ipaddress)" couch.mode:plain services:"${services:?}" tags:production
+$LEAP add-user --self
+$LEAP cert ca
+$LEAP cert csr
+$LEAP node add "$NODE" ip_address:"$(facter ipaddress)" couch.mode:plain services:"${services:?}" tags:production
echo '{ "webapp": { "admins": ["testadmin"] } }' > services/webapp.json
-$LEAP "$OPTS" compile
+$LEAP compile
-$LEAP "$OPTS" node init "$NODE"
+$LEAP node init "$NODE"
if [ $? -eq 1 ]; then
echo 'node init failed'
exit 1
@@ -46,7 +49,7 @@ fi
# workaround is to install rake as gem
gem install rake
-$LEAP "$OPTS" -v 2 deploy
+$LEAP -v 2 deploy
# Vagrant: leap_mx fails to start on jessie
# https://leap.se/code/issues/7755
@@ -62,7 +65,7 @@ echo '==============================================='
echo 'testing the platform'
echo '==============================================='
-$LEAP "$OPTS" -v 2 test --continue
+$LEAP -v 2 test --continue
echo '==============================================='
echo 'setting node to demo-mode'
diff --git a/tests/example-provider/vagrant/vagrant.config b/tests/example-provider/vagrant/vagrant.config
index ff5dd38f..07222c3f 100644
--- a/tests/example-provider/vagrant/vagrant.config
+++ b/tests/example-provider/vagrant/vagrant.config
@@ -18,4 +18,4 @@ NODE='node1'
SUDO="sudo -u ${USER}"
PROVIDERDIR="/home/${USER}/leap/configuration"
PLATFORMDIR="/srv/leap_platform"
-LEAP="$SUDO /usr/local/bin/leap"
+LEAP="$SUDO /usr/local/bin/leap $OPTS"