forked from princeqjzh/AndroidSamplePipelineJava
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathandroidSampleJava_paral
More file actions
91 lines (82 loc) · 2.94 KB
/
Copy pathandroidSampleJava_paral
File metadata and controls
91 lines (82 loc) · 2.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
pipeline{
agent {
label 'master'
}
stages{
stage('获取源码') {
parallel {
stage('安卓程序源码') {
steps {
sh 'mkdir -p AndroidSampleApp'
dir("AndroidSampleApp"){
git branch:'master', url:'[email protected]:princeqjzh/AndroidSampleApp.git'
}
}
}
stage('自动测试程序源码') {
steps {
sh 'mkdir -p iAppBVT'
dir("iAppBVT"){
git branch:'master', url:'[email protected]:princeqjzh/iAppBVT.git'
}
}
}
}
}
stage('安卓编译打包') {
steps {
sh '''
. ~/.bash_profile
cd AndroidSampleApp
sh gradlew clean assembleDebug
'''
}
}
stage('测试与发布') {
parallel {
stage('发布测试包') {
steps {
archiveArtifacts artifacts: 'AndroidSampleApp/app/build/outputs/apk/debug/app-debug.apk'
}
}
stage('自动化'){
stages{
stage('部署') {
steps {
sh '''
. ~/.bash_profile
cd AndroidSampleApp
apk=app/build/outputs/apk/debug/app-debug.apk
{
#try: 卸载现有的安卓app
adb uninstall com.appsflyer.androidsampleapp
} || {
#catch
echo 'no com.appsflyer.androidsampleapp package'
}
sleep 5
#安装安卓app
adb install $apk
'''
}
}
stage('自动测试') {
steps {
sh '''
. ~/.bash_profile
cd iAppBVT
mvn clean install
'''
}
}
}
}
}
}
}
post {
always {
emailext body: '$DEFAULT_CONTENT', recipientProviders: [[$class: 'RequesterRecipientProvider']], subject: '$DEFAULT_SUBJECT'
}
}
}