forked from marunjar/anewjkuapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile.groovy
53 lines (51 loc) · 2.75 KB
/
Jenkinsfile.groovy
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
node {
label 'android'
timestamps {
ansiColor('xterm') {
stage('Checkout') {
echo 'Checkout...'
checkout scm
}
stage('Setup') {
properties([buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '2', daysToKeepStr: '', numToKeepStr: '5')), [$class: 'ScannerJobProperty', doNotScan: false], disableConcurrentBuilds()])
step([$class: 'GitHubCommitStatusSetter', errorHandlers: [[$class: 'ChangingBuildStatusErrorHandler', result: 'UNSTABLE']], statusResultSource: [$class: 'ConditionalStatusResultSource', results: [[$class: 'AnyBuildResult', message: "Build #${env.BUILD_NUMBER} in progress...", state: 'PENDING']]]])
withGradle {
sh './gradlew clean'
sh './gradlew cleanBuildCache'
}
}
stage('Build') {
withGradle {
sh './gradlew assembleGoogle'
sh './gradlew bundleGoogle'
sh './gradlew assembleFdroid'
sh './gradlew bundleFdroid'
}
}
stage('Test') {
echo 'Testing...'
}
stage('Analyze') {
try {
withGradle {
sh './gradlew lintGoogleRelease'
sh './gradlew lintFdroidRelease'
}
} finally {
recordIssues blameDisabled: true, forensicsDisabled: true, skipPublishingChecks: true, sourceDirectory: 'app/src', tools: [androidLintParser(pattern: '**/reports/lint-results-*.xml'), errorProne()]
}
}
stage('Deploy') {
archiveArtifacts artifacts: '**/outputs/**/*.apk, **/outputs/**/*.aab', caseSensitive: false, followSymlinks: false
influxDbPublisher customPrefix: 'anewjkuapp', customProjectName: '', jenkinsEnvParameterField: '', jenkinsEnvParameterTag: '', selectedTarget: 'jenkins'
}
stage('Cleanup') {
}
stage('Notify') {
step([$class: 'GitHubCommitStatusSetter', errorHandlers: [[$class: 'ChangingBuildStatusErrorHandler', result: 'UNSTABLE']], statusResultSource: [$class: 'ConditionalStatusResultSource', results: [[$class: 'AnyBuildResult', message: "Build #${env.BUILD_NUMBER} finished!", state: 'SUCCESS']]]])
emailext attachLog: true, body: '''$PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
Check console output at $BUILD_URL to view the results.''', recipientProviders: [buildUser(), requestor()], subject: '$PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!'
}
}
}
}