-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy_openshift
executable file
·56 lines (39 loc) · 1.11 KB
/
deploy_openshift
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
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
if [[ "$1" == "-q" ]] || [[ "$1" == "-Q" ]]; then
QUICK="$1"
MESSAGE=""
else
MESSAGE="$1"
QUICK="$2"
fi
if [[ -z "$MESSAGE" ]]; then
MESSAGE="deployed on `date`"
fi
mkdir -p deploy
cd deploy
# Testa se já tem o diretorio do projeto, se não faz o clone
if [ ! -d fislgames ]; then
echo "[info] clonando o repositorio na openshift"
git clone ssh://[email protected]/~/git/fislgames.git/
fi
# Entra no diretorio do projeto
cd fislgames
echo "[info] sincronizando com o repositorio"
git pull
# Adiciona o projeto do Github
git remote add github -m master [email protected]:exmo/fislGamesSerpro.git
echo "[info] sincronizando com o github"
git pull github master
if [[ "$QUICK" == "-q" ]] || [[ "$QUICK" == "-Q" ]]; then
echo "[info] running: play stage"
~/Marlon/play-2.1.5/play stage
else
echo "[info] running: play clean compile stage"
~/Marlon/play-2.1.5/play clean compile stage
fi
echo "[info] running: git add . -A"
git add . -A
echo "[info] running: git commit -m \"$MESSAGE\""
git commit -m "$MESSAGE"
echo "[info] running: git push origin"
git push origin