-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdeploy.sh
executable file
·45 lines (35 loc) · 1.13 KB
/
deploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
branch_name=$(git symbolic-ref -q HEAD)
branch_name=${branch_name##refs/heads/}
branch_name=${branch_name:-HEAD}
if [ $branch_name != "master" ]; then
echo "cannot deploy on non master branch"
say "cannot deploy on non master branch"
exit
fi
# Will only work after docker login!
eval $(docker-machine env theaether-hub)
# In case we run this from a different directory
cd $GOPATH/src/github.com/yamamushi/TheAether
docker stop theaether-master-container
yes | docker container prune
yes | docker image prune
docker build -t theaetherbot .
docker tag theaetherbot yamamushi/theaetherbot
docker push yamamushi/theaetherbot
docker run -v /mnt/theaether-hub:/AetherData --name theaether-master-container -d yamamushi/theaetherbot
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) machine=Linux;;
Darwin*) machine=Mac;;
CYGWIN*) machine=Cygwin;;
MINGW*) machine=MinGw;;
*) machine="UNKNOWN:${unameOut}"
esac
echo "deployment completed"
if [ machine != "Mac" ]; then
say deployment completed
exit
fi
# Fallback to the develop branch after deployments
git checkout develop