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
0c39b2a9
Commit
0c39b2a9
authored
May 17, 2017
by
root
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add new shell
parent
8d955c0f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
6 deletions
+35
-6
XyqbAndroidBuild.sh
qa_shell_script/app/XyqbAndroidBuild.sh
+9
-6
remote_excute_new.sh
qa_shell_script/remote_excute_new.sh
+26
-0
No files found.
qa_shell_script/app/XyqbAndroidBuild.sh
View file @
0c39b2a9
#!/bin/bash -ilex
source
/etc/profile
source
~/.bash_profile
project_path
=
/home/quant_group/jenkins/workspace/XyqbAndroidBuild
StroeApk_path
=
${
project_path
}
/apk
BuildGradle_file
=
${
project_path
}
/app/build.gradle
...
...
@@ -7,7 +8,7 @@ BuildApk_path=${project_path}/build/archives
SourceMarkes_flavors
=
/home/qa-deploy-utils/qa_shell_script/app/markets.txt
branch_name
=
$1
product_flavors
=
$2
build_time
=
$3
cd
${
project_path
}
function
get_code
()
...
...
@@ -51,7 +52,7 @@ function build_android()
echo
"构建所有渠道包"
fi
rm
-rf
${
BuildApk_path
}
/
*
rm
-rf
${
project_path
}
/apk/
*
#
rm -rf ${project_path}/apk/*
cd
${
project_path
}
pwd
echo
"开始使用gradle进行编译该版本的代码"
...
...
@@ -65,10 +66,11 @@ function build_android()
#else
# ApkFile="`find ${BuildApk_path} -name "*ceshi.apk"`"
#fi
ApkFile
=
"
`
find
${
BuildApk_path
}
-name
"*
${
product_flavors
}
.apk"
`
"
ApkFile
=
`
find
${
BuildApk_path
}
-name
"*
${
product_flavors
}
*.apk"
`
echo
"apk名称是:
${
ApkFile
}
"
echo
"当前路径
`
pwd
`
"
cp
-r
${
ApkFile
}
${
StroeApk_path
}
/
${
branch_name
}
_
${
product_flavors
}
.apk
#mv ${ApkFile} ${StroeApk_path}/${branch_name}_${product_flavors}.apk
mv
${
ApkFile
}
${
branch_name
}
_
${
product_flavors
}
_
${
build_time
}
.apk
else
echo
"构建失败,请联系管理员查看"
.
exit
-1
...
...
@@ -78,9 +80,10 @@ function build_android()
function
upload_apk
()
{
echo
"apk正在上传到蒲公英,请等待......"
cd
${
StroeApk_path
}
#
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
#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=13d17385c02ea9ea994d0c985d87ff32"
-F
"_api_key=5b09af98d5a8ff43f2f39935fa6bfbc1"
https://qiniu-storage.pgyer.com/apiv1/app/upload
if
[
$?
!=
0
]
;
then
echo
"上传失败,请联系管理员查看"
fi
...
...
qa_shell_script/remote_excute_new.sh
0 → 100755
View file @
0c39b2a9
#!/bin/bash
ip_last
=
$1
project_name
=
$2
branch_name
=
$3
project_type
=
$4
public_ip
=
$5
set timeout
1200
ip
=
192.168.4.
$ip_last
echo
"参数为:
#init_shell_script:
${
init_shell_script
}
ip :
${
ip
}
project_name :
${
project_name
}
branch_name :
${
branch_name
}
project_type :
${
project_type
}
public_ip :
${
public_ip
}
"
sshpass
-p
'!QAZ2wsx'
ssh root@
${
ip
}
ifconfig
if
[
-n
"
$project_name
"
]
&&
[
-n
"
$branch_name
"
]
;
then
sshpass
-p
'!QAZ2wsx'
ssh root@
${
ip
}
"cd /home/qa-deploy-utils/qa_shell_script"
sshpass
-p
'!QAZ2wsx'
ssh root@
${
ip
}
"sh /home/qa-deploy-utils/qa_shell_script/deploy_project_by_name.sh
$project_name
$branch_name
$public_ip
"
else
sshpass
-p
'!QAZ2wsx'
ssh root@
${
ip
}
"cd /home/qa-deploy-utils/qa_shell_script"
sshpass
-p
'!QAZ2wsx'
ssh root@
${
ip
}
"sh /home/qa-deploy-utils/qa_shell_script/deploy_project_by_type.sh
$project_type
$branch_name
$public_ip
"
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