-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpre_env.sh
57 lines (50 loc) · 1.24 KB
/
pre_env.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
#!/bin/bash
# build taobao env
# 2014/12/12 ichengwu
if [ -z "$1" ];then
echo -e "[ERROR] no svn url\n"
echo -e "Usage:\n sudo -u admin -H $0 URL\n"
exit 1
fi
# evn
echo -e "[Prepare] env ...\n"
echo "export HOME=/home/admin" >> ~/.bash_profile
# maven
echo -e "[Prepare] maven ..."
mkdir ~/.m2 2>&1
echo -e '
<settings xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<activeProfiles>
<activeProfile>scmdaily</activeProfile>
</activeProfiles>
</settings>
' > ~/.m2/settings.xml
# app
echo -e "[Prepare] app ..."
cd /home/admin/work
rm -rf * 2>&1
svn co $1
app=`ls`
echo -e "[Prepare] appp_name:$app"
cd "$app"
touch antx.properties
echo -e "[Prepare] appp_name:$app all evn done!"
while true;
do
echo -e "[Build] need set app properties?[y/n]:"
read var
if [ "$var" = "y" ];then
cd /home/admin/work/$app
echo -e "[Build] you can run : sudo -u admin -H /home/admin/build.sh for build"
exit 0
fi
if [ "$var" = "n" ];then
echo -e "[Build] start..."
sh /home/admin/build.sh
echo -e "[Build] done..."
exit 0
fi
done