Skip to content

Commit

Permalink
Add Jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
David Zou committed May 20, 2019
1 parent 642f258 commit 27ecedd
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
pipeline {
agent { label 'android-docker' }
options {
timeout(time: 1, unit: 'HOURS')
}

stages {
stage('PR') {
when { changeRequest() }
steps {
gradlew(args: ['prCheck'])
}
}

stage('Build') {
when {
not { changeRequest() }
}
steps {
gradlew(args: ['continuousBuild'], name: 'Skotlinton-QA')
}
}

stage('Deploy') {
agent { label 'master' }
when {
not { changeRequest() }
}
steps {
script {
ota.publishAPK(name: 'Skotlinton-QA')
}
}
}

stage('Metrics') {
when {
not { changeRequest() }
}
steps {
androidLint(pattern: '**/lint-results*.xml')
junit(allowEmptyResults: false, testResults: '**/test-results/*/*.xml')
publishCoverage(adapters: [jacocoAdapter('app/build/reports/jacoco/coverageReportDebugUnitTest/jacoco.xml')], sourceFileResolver: sourceFiles('STORE_LAST_BUILD'))
}
}
}
}

0 comments on commit 27ecedd

Please sign in to comment.