-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
61 lines (58 loc) · 1.09 KB
/
Jenkinsfile
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
pipeline {
agent any
tools {
jdk 'jdk8'
gradle 'Gradle5'
}
stages {
stage('Initialize') {
steps {
runGradle("--version")
}
}
stage('Compile') {
steps {
runGradle("compileDebugSources")
}
}
stage('Unit test') {
steps {
//Compile and run unit tests
runGradle("testDebugUnitTest testDebugUnitTest")
//Analyse the test results
junit '**/TEST-*.xml'
}
}
stage('Build APK') {
steps {
//Finish building and packaging the APK
runGradle("assembleDebug")
//Archive the APK
//archiveArtifacts '**/*.apk'
}
}
stage('Static analysis') {
steps {
//Run Lint and analyse the results
runGradle("lintDebug")
}
}
stage('Copy Apk') {
steps {
//Copy generated apk into a folder of the web server for easy access
fileOperations([
fileCopyOperation(
flattenFiles: true,
includes: "**/*.apk",
targetLocation: "/var/www/html/apk/${env.BRANCH_NAME}"
)
])
}
}
}
}
def runGradle(command) {
dir("MBP2Go") {
sh "gradle --no-daemon ${command}"
}
}