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
c0d9a791
Commit
c0d9a791
authored
Oct 10, 2017
by
QA—索 文涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modified: qa_shell_script/app/XyqbAndroidBuild.sh
parent
2a92390a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
14 deletions
+31
-14
XyqbAndroidBuild.sh
qa_shell_script/app/XyqbAndroidBuild.sh
+31
-14
No files found.
qa_shell_script/app/XyqbAndroidBuild.sh
View file @
c0d9a791
...
...
@@ -8,30 +8,33 @@ Constant_file=${project_path}/app/src/main/java/com/financial/quantgroup/constan
BuildApk_path
=
${
project_path
}
/build/archives
downloadApk_path
=
/home/quant_group/jenkins/download_apk
SourceMarkes_flavors
=
/home/qa-deploy-utils/qa_shell_script/app/markets.txt
branch_name
=
$1
#${GIT_BRANCH} ${PRODUCT_FLAVORS} ${BUILD_TIME} ${APP_SERVER} ${APP_TYPE} ${APP_VERSION} ${NEED_UPLOAD}
git_branch
=
$1
product_flavors
=
$2
build_time
=
$3
test_server
=
$4
apk_name
=
$5
need_upload
=
$6
apk_type
=
$5
apk_version
=
$6
need_upload
=
$7
cd
${
project_path
}
function
get_code
()
{
git checkout ./
git fetch
-p
if
[
-z
${
branch_name
}
]
;
then
if
[
-z
${
git_branch
}
]
;
then
echo
"分支为空,已切换默认分支master"
git pull
else
echo
"checkout specified branch
${
branch_name
}
"
git checkout
-f
${
branch_name
}
echo
"checkout specified branch
${
git_branch
}
"
git checkout
-f
${
git_branch
}
if
[
$?
=
0
]
;
then
echo
"成功切换分支
${
branch_name
}
"
echo
"成功切换分支
${
git_branch
}
"
git pull
else
echo
"切换分支
${
branch_name
}
失败,请联系管理员查看"
.
echo
"切换分支
${
git_branch
}
失败,请联系管理员查看"
.
exit
-1
fi
fi
...
...
@@ -81,15 +84,29 @@ function build_android()
ApkFile
=
`
find
${
BuildApk_path
}
-name
"*
${
product_flavors
}
*.apk"
`
echo
"apk名称是:
${
ApkFile
}
"
echo
"当前路径
`
pwd
`
"
#mv ${ApkFile} ${StroeApk_path}/${
branch_name
}_${product_flavors}.apk
mv
${
ApkFile
}
${
branch_name
}
_
${
product_flavors
}
_
${
build_time
}
.apk
cp
-R
${
branch_name
}
_
${
product_flavors
}
_
${
build_time
}
.apk
${
downloadApk_path
}
/
${
apk_name
}
.apk
#mv ${ApkFile} ${StroeApk_path}/${
git_branch
}_${product_flavors}.apk
mv
${
ApkFile
}
${
git_branch
}
_
${
product_flavors
}
_
${
build_time
}
.apk
cp
-R
${
git_branch
}
_
${
product_flavors
}
_
${
build_time
}
.apk
${
downloadApk_path
}
/
${
apk_type
}
_
${
apk_version
}
.apk
else
echo
"构建失败,请联系管理员查看"
.
exit
-1
fi
}
function
upload_toLocalAppStore
()
{
echo
"apk正在本地appstore,请等待......"
#cd ${StroeApk_path}
echo
"当前上传apk包的路径是
`
pwd
`
"
#curl -F "file=@${git_branch}_${product_flavors}_${build_time}.apk" -F "type=${apk_type}" -F "version=${apk_version}" https://qiniu-storage.pgyer.com/apiv1/app/upload
curl
-F
"file=@
${
git_branch
}
_
${
product_flavors
}
_
${
build_time
}
.apk"
-F
"type=
${
apk_type
}
"
-F
"version=
${
apk_version
}
"
http://192.168.28.141:8080/android/upload
if
[
$?
!=
0
]
;
then
echo
"上传失败,请联系管理员查看"
fi
}
function
upload_apk
()
{
...
...
@@ -97,8 +114,8 @@ function upload_apk()
echo
"apk正在上传到蒲公英,请等待......"
#cd ${StroeApk_path}
echo
"当前上传apk包的路径是
`
pwd
`
"
#curl -F "file=@${
branch_name
}_${product_flavors}_${build_time}.apk" -F "uKey=13d17385c02ea9ea994d0c985d87ff32" -F "_api_key=5b09af98d5a8ff43f2f39935fa6bfbc1" https://qiniu-storage.pgyer.com/apiv1/app/upload
curl
-F
"file=@
${
branch_name
}
_
${
product_flavors
}
_
${
build_time
}
.apk"
-F
"uKey=41968e9da5a634b7b33dc8ff41e31c4e"
-F
"_api_key=8c303b6f70e8abbda50d1503568f1864"
https://qiniu-storage.pgyer.com/apiv1/app/upload
#curl -F "file=@${
git_branch
}_${product_flavors}_${build_time}.apk" -F "uKey=13d17385c02ea9ea994d0c985d87ff32" -F "_api_key=5b09af98d5a8ff43f2f39935fa6bfbc1" https://qiniu-storage.pgyer.com/apiv1/app/upload
curl
-F
"file=@
${
git_branch
}
_
${
product_flavors
}
_
${
build_time
}
.apk"
-F
"uKey=41968e9da5a634b7b33dc8ff41e31c4e"
-F
"_api_key=8c303b6f70e8abbda50d1503568f1864"
https://qiniu-storage.pgyer.com/apiv1/app/upload
if
[
$?
!=
0
]
;
then
echo
"上传失败,请联系管理员查看"
fi
...
...
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