-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgit-pages.sh
executable file
·64 lines (45 loc) · 1.19 KB
/
git-pages.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
55
56
57
58
59
60
61
62
63
64
#! /bin/bash
function writeEnvironment() {
cat << ENVIRONMENT
/****************************
* ENVIRONMENT = PRODUCTION *
****************************/
// version
var util_version = "`date`"
// Server URL
var util_server_url = "http://tweetssentiment.herokuapp.com";
ENVIRONMENT
}
echo "****************************************************"
echo "* PUSH CHANGES TO GIT PAGES POINTING TO PRODUCTION *"
echo "****************************************************"
FROM=`pwd`
echo "FROM=$FROM"
FOLDERTO=$GIT_PAGES_FOLDER
#echo "FOLDERTO=$FOLDERTO"
TO="$GIT_PAGES_FOLDER/tweets-sentiment-client-bootstrap"
echo "TO=$TO"
DATE=`date +"%Y.%m.%d-%H:%M"`
TO_OLD=$TO'-OLD-'$DATE
#echo "TO_OLD=$TO_OLD"
mv $TO $TO_OLD && \
cp -r $FROM $FOLDERTO && \
rm -rf $TO'/.git' && \
cp -r $TO_OLD'/.git' $TO && \
cd $TO && \
writeEnvironment > js/util/environment.js && \
more js/util/environment.js && \
node app.js && \
git diff | grep +++
read -p "You want to continue? [y|*N*]: " OPTION
if [ "$OPTION" == "y" ]; then
read -p "Write the commit message: " MESSAGE
git add . && \
git commit -m "$MESSAGE" && \
git push origin gh-pages && \
rm -rf $TO_OLD
else
rm -rf $TO && \
mv $TO_OLD $TO
fi
cd -