Skip to content
Snippets Groups Projects
Commit 869aaf24 authored by Pierre Ozoux's avatar Pierre Ozoux
Browse files

Cleans up

parent 71d6ec77
No related branches found
No related tags found
No related merge requests found
#!/bin/sh
if [ $# -ge 2 ]; then
SERVER=$1
BACKUP_DEST=$2
else
echo "Usage: sh ./deploy/deploy.sh server backup_dest [branch [user]]]"
exit 1
fi
if [ $# -ge 3 ]; then
BRANCH=$3
else
BRANCH="master"
fi
if [ $# -ge 4 ]; then
USER=$4
else
USER="core"
fi
echo "Server to deploy is $SERVER"
echo "Backups will live under $BACKUP_DEST"
echo "IndieHosters repo branch is $BRANCH"
echo "Remote user is $USER"
scp ./deploy/onServer.sh $USER@$SERVER:
ssh $USER@$SERVER sudo mkdir -p /var/lib/coreos-install/
scp cloud-config $USER@$SERVER:/var/lib/coreos-install/user_data
ssh $USER@$SERVER sudo sh ./onServer.sh $BRANCH $SERVER
# overrides BACKUP_DESTINATION from cloud-config
echo $BACKUP_DEST > ./deploy/tmp.txt
scp ./deploy/tmp.txt $USER@$SERVER:/data/BACKUP_DESTINATION
rm ./deploy/tmp.txt
#!/bin/sh
#Usage from deploy/deploy.sh:
#ssh $USER@$SERVER sudo sh ./onServer.sh $BRANCH $SERVER
echo Starting etcd:
/usr/bin/coreos-cloudinit --from-file=/var/lib/coreos-install/user_data
echo Cloning the indiehosters repo into /data/indiehosters:
mkdir -p /data
cd /data
git clone https://github.com/indiehosters/indiehosters.git
cd indiehosters
echo Checking out $1 branch of the IndieHosters indiehosters:
git checkout $1
git pull
echo Running the server setup script:
sh scripts/setup.sh $2
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment