|
@@ -11,13 +11,20 @@ project_path="${project_root_path}/${project_name}" |
|
@@ -11,13 +11,20 @@ project_path="${project_root_path}/${project_name}" |
11
|
project_bak_path="/home/tiptok/www/bin_bak"
|
11
|
project_bak_path="/home/tiptok/www/bin_bak"
|
12
|
|
12
|
|
13
|
projcet_bak_file="${project_bak_path}/${time}_${project_name}.tar"
|
13
|
projcet_bak_file="${project_bak_path}/${time}_${project_name}.tar"
|
14
|
-project_gzip_file="${deploy_shell_path}/${project_name}.tar"
|
14
|
+
|
|
|
15
|
+## 看压缩文件的格式 tar / zip
|
|
|
16
|
+#project_gzip_file="${deploy_shell_path}/${project_name}.tar"
|
|
|
17
|
+project_gzip_file="${deploy_shell_path}/${project_name}.zip"
|
|
|
18
|
+
|
|
|
19
|
+conpress_type="${project_gzip_file##*.}"
|
15
|
|
20
|
|
16
|
echo "------begin deploy-------"
|
21
|
echo "------begin deploy-------"
|
17
|
echo "ProjectName: ${project_name}"
|
22
|
echo "ProjectName: ${project_name}"
|
18
|
echo "ProjectPath: ${project_path}"
|
23
|
echo "ProjectPath: ${project_path}"
|
19
|
echo "ProjectBakFile : ${projcet_bak_file}"
|
24
|
echo "ProjectBakFile : ${projcet_bak_file}"
|
20
|
echo "ProjectGzipFile : ${project_gzip_file}"
|
25
|
echo "ProjectGzipFile : ${project_gzip_file}"
|
|
|
26
|
+echo "ConpressType : ${conpress_type}"
|
|
|
27
|
+
|
21
|
|
28
|
|
22
|
if [ ! -d ${project_bak_path} ];then
|
29
|
if [ ! -d ${project_bak_path} ];then
|
23
|
mkdir -p ${project_bak_path}
|
30
|
mkdir -p ${project_bak_path}
|
|
@@ -38,8 +45,13 @@ if [ ! -e ${project_path} ];then |
|
@@ -38,8 +45,13 @@ if [ ! -e ${project_path} ];then |
38
|
mkdir -p ${project_path}
|
45
|
mkdir -p ${project_path}
|
39
|
echo "mkdir ${project_path}"
|
46
|
echo "mkdir ${project_path}"
|
40
|
fi
|
47
|
fi
|
|
|
48
|
+
|
41
|
if [ -f ${project_gzip_file} ];then
|
49
|
if [ -f ${project_gzip_file} ];then
|
42
|
- tar -xzf ${project_gzip_file} -C "${project_root_path}/${project_name}"||(echo "tar -x failed"; exit 1)
|
50
|
+ if [ ${conpress_type} == "tar" ];then
|
|
|
51
|
+ tar -xzf ${project_gzip_file} -C "${project_root_path}/${project_name}"||(echo "tar -x failed"; exit 1)
|
|
|
52
|
+ elif [ ${conpress_type} == "zip" ];then
|
|
|
53
|
+ unzip -o ${project_gzip_file} -d "${project_root_path}/${project_name}"||(echo "tar -x failed"; exit 1)
|
|
|
54
|
+ fi
|
43
|
rm -fr ${project_gzip_file}
|
55
|
rm -fr ${project_gzip_file}
|
44
|
else
|
56
|
else
|
45
|
echo "project_gzip_file not exists! please upload zip file ..."
|
57
|
echo "project_gzip_file not exists! please upload zip file ..."
|