summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeap Admins <sysdev@leap.se>2013-05-07 12:40:48 +0000
committerLeap Admins <sysdev@leap.se>2013-05-07 12:40:48 +0000
commit2b5834967e60241c5b0f41fe22f944cc5f7502ce (patch)
treebc48686f9de08a26f563143d669db40667e08f72
parent375f150f65e0653c4b793b584a231ae19ed20c78 (diff)
improved create_provider
-rwxr-xr-xleap-platform-test43
1 files changed, 27 insertions, 16 deletions
diff --git a/leap-platform-test b/leap-platform-test
index 961b458..6b16fcc 100755
--- a/leap-platform-test
+++ b/leap-platform-test
@@ -62,29 +62,30 @@ compile () {
}
create_provider() {
- if [ -e $ROOTDIR/$PROVIDER ]
+ if [ -e $PROVIDERDIR ]
then
- echo $ROOTDIR/$PROVIDER exists - exiting
+ echo $PROVIDERDIR exists - exiting
exit 1
fi
- mkdir $ROOTDIR/$PROVIDER
- cd $ROOTDIR/$PROVIDER
- leap new .
- cd $ROOTDIR/leap_platform
- git checkout develop
+ mkdir -p $PROVIDERDIR
+ cd $PROVIDERDIR
+
+ leap $OPTS new --contacts $CONTACTS --domain $DOMAIN --name $PROVIDER --platform=$PLATFORMDIR .
+ cd $PLATFORMDIR
+ git checkout $PLATFORM_BRANCH
git submodule update --init
- cd $ROOTDIR/$PROVIDER
+ cd $PROVIDERDIR
# for now, we use the vagrant pubkey until https://leap.se/code/issues/2039 is solved
- leap 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 cert ca && leap cert csr
- leap cert dh
+ 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 $OPTS cert dh
+
+ add_nodes $NODES
}
deploy() {
- LOG="$LOGDIR/deploy-$vm.log"
- ERRLOG="$LOGDIR/deploy-$vm-`date +"%F-%H%M%S"`-error.log"
# remove colors until #1751 is fixed
RMCOLORS='s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g'
@@ -97,6 +98,8 @@ deploy() {
for vm in $@
do
+ LOG="$LOGDIR/deploy-$vm.log"
+ ERRLOG="$LOGDIR/deploy-$vm-`date +"%F-%H%M%S"`-error.log"
echo "Deploying \"$vm\" on `date`"|tee -a $LOG
leap $OPTS -v 2 deploy $vm 2>&1 | sed -r "$RMCOLORS" | tee -a $LOG | egrep -v "$FILTER_ALL" > $ERRLOG
@@ -121,6 +124,7 @@ deploy() {
reset_deploy() {
+ log_start
compile
echo "Starting deploy_nodes for nodes $@ as background tasks on `date`"
@@ -139,6 +143,10 @@ reset_deploy() {
done
}
+log_start() {
+ echo
+ echo "Starting $0 on `date`"
+}
config=""
all=false
@@ -183,8 +191,12 @@ then
exit 1
fi
+# provider specific config
source $config
-cd $ROOTDIR/$PROVIDER
+# common config for all providers
+source /etc/leap/platform-test-common.cfg
+
+[ -e $PROVIDERDIR ] && cd $PROVIDERDIR
if ! $all ; then
nodes=$nodelist
@@ -192,14 +204,13 @@ else
nodes=$NODES
fi
-echo
-echo "Starting $0 on `date`"
case $cmd in
bootstrap) bootstrap_nodes "$nodes";;
create_provider) create_provider;;
deploy) deploy "$nodes";;
reset_deploy) reset_deploy "$nodes";;
+ (*) usage; echo "Please specify a command."; exit 1;;
esac