compose-website/deploy/deploy.sh

38 lines
867 B
Bash
Raw Normal View History

#!/bin/sh
if [ $# -ge 1 ]; then
SERVER=$1
else
2014-10-17 14:34:28 +00:00
echo "Usage: sh ./deploy/deploy.sh server [folder [branch [user]]]"
exit 1
fi
if [ $# -ge 2 ]; then
2014-10-17 14:34:28 +00:00
FOLDER=$2
else
FOLDER="./data/"
fi
if [ $# -ge 3 ]; then
BRANCH=$2
else
BRANCH="master"
fi
2014-10-17 14:34:28 +00:00
if [ $# -ge 4 ]; then
USER=$3
else
USER="core"
fi
if [ -e ../orchestration/per-server/$SERVER/default-site ]; then
DEFAULTSITE=`cat ../orchestration/per-server/$SERVER/default-site`
else
DEFAULTSITE=$SERVER
fi
2014-10-17 14:34:28 +00:00
echo "Hoster data folder is $FOLDER"
echo "Infrastructure branch is $BRANCH"
echo "Remote user is $USER"
echo "Default site is $DEFAULTSITE"
2014-10-17 14:34:28 +00:00
scp $FOLDER $USER@$SERVER:/data
scp ./deploy/onServer.sh $USER@$SERVER:
ssh $USER@$SERVER sudo mkdir -p /var/lib/coreos-install/
2014-10-17 14:34:28 +00:00
scp cloud-config $USER@$SERVER:/var/lib/coreos-install/user_data
ssh $USER@$SERVER sudo sh ./onServer.sh $BRANCH $DEFAULTSITE