-
Notifications
You must be signed in to change notification settings - Fork 145
/
Jenkinsfile
41 lines (41 loc) · 1.5 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
pipeline {
options {
buildDiscarder(logRotator(artifactNumToKeepStr: '5', numToKeepStr: '15'))
}
agent any
stages {
stage('Prepare environment') {
steps {
sh "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
}
}
stage('Build') {
steps {
sh './gradlew clean build'
junit allowEmptyResults: true, testResults: '**/build/test-results/testDebugUnitTest/TEST-*.xml'
jacoco classPattern: '**/build/intermediates/javac/debug,**/build/intermediates/javac/debugUnitTest', exclusionPattern: '**/R.class,**/R$*.class,**/BuildConfig.*,**/*$ViewInjector*.*,**/*$ViewBinder*.*', execPattern: '**/testDebugUnitTest.exec'
}
}
stage("Analyze") {
steps {
withSonarQubeEnv('PSDev') {
sh './gradlew sonarqube'
}
timeout(time: 1, unit: 'HOURS') {
waitForQualityGate abortPipeline: false
}
}
}
stage("Deploy") {
steps {
sh './gradlew publish'
zip dir: 'build/m2repository', glob: '', zipFile: 'build/m2repository.zip', archive: true
}
}
}
post {
always {
archiveArtifacts allowEmptyArchive: true, artifacts: '**/build/reports/,sample/build/outputs/apk/debug/sample-debug.apk', fingerprint: true
}
}
}