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
698137ef
Commit
698137ef
authored
Mar 14, 2017
by
QA-甘 盛聪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aa
parent
1f37916d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
37 deletions
+49
-37
XyqbAndroidBuild.sh
qa_shell_script/app/XyqbAndroidBuild.sh
+49
-37
No files found.
qa_shell_script/app/XyqbAndroidBuild.sh
View file @
698137ef
...
@@ -12,10 +12,12 @@ product_flavors=$2
...
@@ -12,10 +12,12 @@ product_flavors=$2
cd
${
project_path
}
cd
${
project_path
}
if
[
-z
${
branch_name
}
]
;
then
function
get_code
()
{
if
[
-z
${
branch_name
}
]
;
then
echo
"checkout default branch master"
echo
"checkout default branch master"
git pull
git pull
else
else
echo
"checkout specified branch
${
branch_name
}
"
echo
"checkout specified branch
${
branch_name
}
"
which git
which git
git checkout
${
branch_name
}
git checkout
${
branch_name
}
...
@@ -26,29 +28,39 @@ else
...
@@ -26,29 +28,39 @@ else
echo
"Fail to checkout branch
${
branch_name
}
"
.
echo
"Fail to checkout branch
${
branch_name
}
"
.
exit
-1
exit
-1
fi
fi
fi
fi
}
echo
"拷贝可使用的gradle文件"
cp
-r
${
source_gradlefile
}
${
target_file
}
if
[[
-z
${
product_flavors
}
]]
;
then
function
build_android
()
{
echo
"拷贝可使用的gradle文件"
cp
-r
${
source_gradlefile
}
${
target_file
}
if
[[
-z
${
product_flavors
}
]]
;
then
echo
"
${
product_flavors
}
"
>
${
project_path
}
/markets.txt
echo
"
${
product_flavors
}
"
>
${
project_path
}
/markets.txt
fi
fi
rm
-rf
${
project_path
}
/apk/
rm
-rf
${
project_path
}
/apk/
echo
"开始使用gradle进行编译该版本的代码"
gradle clean resguard
--stacktrace
--debug
echo
"开始使用gradle进行编译该版本的代码"
if
[
$?
=
0
]
;
then
echo
"gradle build is ok"
.
gradle clean resguard
--stacktrace
--debug
echo
"开始重命名对应的渠道包"
apkfile
=
`
find
${
buildapk_path
}
-name
"*
${
product_flavors
}
.apk"
`
echo
"重命名apk包名"
cp
-r
${
apkfile
}
${
project_path
}
/apk/
${
branch_name
}
_
${
product_flavors
}
.apk
else
echo
"Fail to checkout branch
${
branch_name
}
"
.
exit
-1
fi
}
apkfile
=
`
find /home/quant_group/jenkins/workspace/XyqbAndroidBuild/build/archives
-name
"*
${
product_flavors
}
.apk"
`
function
upload_apk
()
{
echo
"正在将apk上传到蒲公英,请等待......"
curl
-F
"file=@/home/quant_group/jenkins/workspace/XyqbAndroidBuild/apk/
${
branch_name
}
_
${
product_flavors
}
.apk"
-F
"uKey=13d17385c02ea9ea994d0c985d87ff32"
-F
"_api_key=5b09af98d5a8ff43f2f39935fa6bfbc1"
https://static.pgyer.com/app/qrcode/lJrv
}
cp
${
apkfile
}
/home/quant_group/jenkins/workspace/XyqbAndroidBuild/apk/
${
branch_name
}
_
${
product_flavors
}
.apk
get_code
echo
"正在将apk上传到蒲公英,请等待......"
build_android
curl
-F
"file=@/home/quant_group/jenkins/workspace/XyqbAndroidBuild/apk/
${
branch_name
}
_
${
product_flavors
}
.apk"
-F
"uKey=13d17385c02ea9ea994d0c985d87ff32"
-F
"_api_key=5b09af98d5a8ff43f2f39935fa6bfbc1"
https://static.pgyer.com/app/qrcode/lJrv
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