summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2013-02-13 16:36:33 +0100
committervarac <varacanero@zeromail.org>2013-02-13 16:36:33 +0100
commitff785c2540cea0cbd82d64b8b657c8fde3aacca6 (patch)
tree96265bc27f4741f1532e96d2a5f712da81b0ba3b
basic bootstrap scipts
-rwxr-xr-xleap-bootstrap-all.sh10
-rwxr-xr-xleap-bootstrap-node.sh30
-rwxr-xr-xleap-bootstrap-provider.sh11
-rw-r--r--platform-test.cfg.example10
4 files changed, 61 insertions, 0 deletions
diff --git a/leap-bootstrap-all.sh b/leap-bootstrap-all.sh
new file mode 100755
index 0000000..b0d2659
--- /dev/null
+++ b/leap-bootstrap-all.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+. /etc/leap/platform-test.cfg
+
+
+for i in $SERVICES
+do
+ $PLATFORM_TEST_BIN/leap-bootstrap-node.sh $i
+done
+
diff --git a/leap-bootstrap-node.sh b/leap-bootstrap-node.sh
new file mode 100755
index 0000000..b304d51
--- /dev/null
+++ b/leap-bootstrap-node.sh
@@ -0,0 +1,30 @@
+#!/bin/sh -x
+
+. /etc/leap/platform-test.cfg
+
+PROVIDERDIR=$ROOTDIR/$PROVIDER
+
+cd $PROVIDERDIR
+
+vm=$1
+
+if [ -z $vm ]
+then
+ echo "provide service name"
+ exit 1
+fi
+
+case $SERVICES in
+ *"$vm"*) ;;
+
+ *)
+ echo "provide service name"
+ exit 1 ;;
+esac
+
+leap $OPTS local start $vm
+leap $OPTS node init $vm
+#ssh -o "UserKnownHostsFile=$KNOWNHOSTS" $PROVIDER-$vm "/usr/bin/apt-get -q -y -o 'DPkg::Options::=--force-confold' dist-upgrade"
+ssh -o "StrictHostKeyChecking=no" root@$PROVIDER-$vm "/usr/bin/apt-get -q -y -o 'DPkg::Options::=--force-confold' dist-upgrade"
+leap $OPTS local save $vm
+
diff --git a/leap-bootstrap-provider.sh b/leap-bootstrap-provider.sh
new file mode 100755
index 0000000..c2fb3b9
--- /dev/null
+++ b/leap-bootstrap-provider.sh
@@ -0,0 +1,11 @@
+#!/bin/sh -x
+
+. /etc/leap/platform-test.cfg
+
+cd $ROOTDIR/$PROVIDER
+
+for i in $SERVICES
+do
+ leap node add --local $i services:$i
+done
+
diff --git a/platform-test.cfg.example b/platform-test.cfg.example
new file mode 100644
index 0000000..14fbd0b
--- /dev/null
+++ b/platform-test.cfg.example
@@ -0,0 +1,10 @@
+PROVIDER='example'
+ROOTDIR='~/leap_platform_testing'
+SERVICES='ca couchdb monitor openvpn tor webapp'
+
+# options for leap_cli
+OPTS='--yes'
+
+# where is the script repo checkout ?
+PLATFORM_TEST_BIN="$ROOTDIR/platform_test"
+