-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
54 lines (49 loc) · 1.29 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
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
#Uncomment for debugging this script
set -x
clear
if [ $# -eq 0 ]
then
echo 'Usage: ./deploy.sh [clean|git|deploy|all] <commit message>'
exit 1;
fi
case "$1" in
'clean')
echo 'Cleaning all the temp files'
find ./ -name '*~' -exec rm '{}' \; -print
;;
'git')
if [ $# -eq 1 ]
then
echo 'Please provide commit message'
echo 'Usage: ./deploy.sh <clean|git|deploy|all> <commit message>'
exit 1;
else
git add --all
git commit -m "$2"
# git push origin master
fi
;;
'deploy')
git push heroku master
;;
'all')
echo 'Cleaning all the temp files'
find ./ -name '*~' -exec rm '{}' \; -print
if [ $# -eq 1 ]
then
echo 'Please provide commit message'
echo 'Usage: ./deploy.sh <clean|git|deploy|all> <commit message>'
exit 1;
else
git add --all
git commit -m "$2"
fi
git push heroku master
;;
*)
echo 'I couldnt understand your request'
echo 'Usage: ./deploy.sh [clean|git|deploy|all] <commit message>'
exit 1;
;;
esac