Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qa-deploy-utils
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
qa-deploy-utils
Commits
3b685255
Commit
3b685255
authored
Mar 21, 2017
by
QA-甘 盛聪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add app
parent
a59ee914
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
92 additions
and
0 deletions
+92
-0
XyqbAndroidBuild.sh
qa_shell_script/app/XyqbAndroidBuild.sh
+92
-0
No files found.
qa_shell_script/app/XyqbAndroidBuild.sh
0 → 100644
View file @
3b685255
#!/bin/bash -ilex
source
/etc/profile
project_path
=
/home/quant_group/jenkins/workspace/XyqbAndroidBuild
StroeApk_path
=
${
project_path
}
/apk
BuildGradle_file
=
${
project_path
}
/app/build.gradle
BuildApk_path
=
${
project_path
}
/build/archives
branch_name
=
$1
product_flavors
=
$2
cd
${
project_path
}
function
get_code
()
{
if
[
-z
${
branch_name
}
]
;
then
echo
"分支为空,已切换默认分支master"
git pull
else
echo
"checkout specified branch
${
branch_name
}
"
git checkout
-f
${
branch_name
}
if
[
$?
=
0
]
;
then
echo
"成功切换分支
${
branch_name
}
"
git pull
else
echo
"切换分支
${
branch_name
}
失败,请联系管理员查看"
.
exit
-1
fi
fi
}
function
replace_config
()
{
if
[
-f
${
BuildGradle_file
}
]
;
then
echo
"正在替换配置文件,请稍后......"
sed
-i
"s/apply plugin
\:
'newlens'/
\/\/
apply plugin
\:
'newlens'/g"
${
BuildGradle_file
}
sed
-i
"s/artifact = 'com.tencent.mm:SevenZip:1.1.13'/
\/\/
artifact = 'com.tencent.mm:SevenZip:1.1.13'/g"
${
BuildGradle_file
}
sed
-i
"s/
\/\/
path =
\"\/
usr
\/
local
\/
bin
\/
7za
\"
/path =
\"\/
usr
\/
local
\/
p7zip_9.20.1
\/
bin
\/
7za
\"
/g"
${
BuildGradle_file
}
else
echo
"
${
BuildGradle_file
}
文件不存在,请联系管理人员查看"
exit
-1
fi
}
function
build_android
()
{
if
[[
!
-z
${
SourceMarkes_flavors
}
]]
;
then
echo
"
${
product_flavors
}
"
>
${
project_path
}
/markets.txt
else
echo
"构建所有渠道包"
fi
rm
-rf
${
project_path
}
/apk/
*
cd
${
project_path
}
pwd
echo
"开始使用gradle进行编译该版本的代码"
gradle resguard
if
[
$?
=
0
]
;
then
echo
"成功构建APK包"
.
echo
"开始重命名对应的渠道包"
cd
${
BuildApk_path
}
if
[[
!
-z
${
product_flavors
}
]]
;
then
ApkFile
=
"
`
find
${
BuildApk_path
}
-name
"*
${
product_flavors
}
.apk"
`
"
else
ApkFile
=
"
`
find
${
BuildApk_path
}
-name
"*ceshi.apk"
`
"
fi
echo
"apk名称是:
${
apkfile
}
"
echo
"当前路径
`
pwd
`
"
mv
${
ApkFile
}
${
StroeApk_path
}
/
${
branch_name
}
_
${
product_flavors
}
.apk
else
echo
"构建失败,请联系管理员查看"
.
exit
-1
fi
}
function
upload_apk
()
{
echo
"apk正在上传到蒲公英,请等待......"
cd
${
StroeApk_path
}
echo
"当前上传apk包的路径是
`
pwd
`
"
curl
-F
"file=@
${
branch_name
}
_
${
product_flavors
}
.apk"
-F
"uKey=13d17385c02ea9ea994d0c985d87ff32"
-F
"_api_key=5b09af98d5a8ff43f2f39935fa6bfbc1"
https://qiniu-storage.pgyer.com/apiv1/app/upload
if
[
$?
!=
0
]
;
then
echo
"上传失败,请联系管理员查看"
fi
}
get_code
replace_config
build_android
upload_apk
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment