-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweb.sh
More file actions
executable file
·76 lines (68 loc) · 1.47 KB
/
web.sh
File metadata and controls
executable file
·76 lines (68 loc) · 1.47 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
composerDownload(){
if [ -f "composer.json" ]
then
echo Start composer download
if [ -f "composer.phar" ]
then
echo "composer.phar has been exist."
else
curl -sS https://getcomposer.org/installer | php
echo Composer download success
fi
else
echo The project does not contain composer.json, so you dont need download composer.phar
fi
}
composerInstall(){
if [ -f "composer.json" ]
then
# rm -r -f vendor
# rm -r -f composer.lock
composer install
else
echo The project does not contain composer.json, so you dont need do composer.phar install
fi
}
composerUpdate(){
if [ -f "composer.json" ]
then
# rm -r -f vendor
# rm -r -f composer.lock
composer update
else
echo The project does not contain composer.json, so you dont need do composer.phar install
fi
}
calcBranch(){
case $1 in
sandbox)
echo sandbox
;;
production)
echo production
;;
*)
echo sandbox
;;
esac
}
pull_web_source(){
echo
echo do git pull $1
echo
git reset --hard
git pull
BRANCH=`calcBranch $1`
exists=`git show-ref refs/heads/$BRANCH`
if [ -n "$exists" ]; then
echo $BRANCH branch exists!
else
git checkout -b $BRANCH origin/$BRANCH
fi
git checkout $BRANCH
git pull
echo
echo git pull web success
echo
}