-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy
executable file
·40 lines (33 loc) · 961 Bytes
/
deploy
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
clear
echo "Deploying"
if [ "`git rev-parse --symbolic-full-name --abbrev-ref HEAD`" != "master" ]
then
echo "You're not on master!"
else
echo "Branch check successful"
echo "Running gulp"
gulp deploy
cd /home/sam/Mess_About_Code/MatrixCLive
echo "Found live repo"
echo "Clearing old code"
rm *
rm -r dist/*
rm -r dependencies/*
rm -r img/*
cp ../MatrixC/*html .
cp -r ../MatrixC/img/* ./img
cp -r ../MatrixC/dist/* ./dist
rsync -av --exclude='*js' ../MatrixC/dependencies/ dependencies
echo "Current Directory Structure:"
ls *
read -p "Are you sure? " -n 1 -r
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
echo ""
VERSION="`cat ../MatrixC/package.json | grep "version" | rev| cut -f1 -d":"|rev | grep -oP '"\K[^"\047]+(?=["\047])'`"
git add *
git commit -m "Deployment version $VERSION: On `date +"%d-%m-%Y - %T"`"
git push -u origin master
fi