-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitpush
executable file
·36 lines (33 loc) · 898 Bytes
/
gitpush
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
#!/bin/bash
NOW=$(date +"%d%m%Y-%T")
BRed='\033[1;31m'
function commitdev {
############
#Repo Development Repos
echo $1
# git add . --all
# git commit -m "Commit for : $1 <$NOW>"
git push -u [email protected]:rhps/backend-rhps.github.io.git --all
git checkout master
git merge $1
git push -u [email protected]:rhps/backend-rhps.github.io.git --all
git checkout $1
}
function commitprod {
############
#Repo Production Repos
cd _site/
git add . --all
git commit -m "Commit for : $1 <$NOW>"
git push -u [email protected]:rhps/rhps.github.io.git --all
}
if [[ $1 == "" ]]; then
echo -e "\033[31mERROR!\033[0m"
echo "Give Commit Comments"
echo -e "\033[37mUsing : ./gitpush \"Git Branch that want to merge\"\033[0m"
else
commitdev "$1"
bundle exec jekyll build site.url
commitprod "$1"
echo -e "\033[37mAll push for Production and Developemt Repository already up-to-date\033[0m"
fi