-
Notifications
You must be signed in to change notification settings - Fork 4
/
Jenkinsfile.groovy
88 lines (86 loc) · 3.23 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
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
pipeline {
agent {
label 'android'
}
options {
skipDefaultCheckout()
timestamps()
ansiColor('xterm')
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '2', daysToKeepStr: '', numToKeepStr: '5'))
disableConcurrentBuilds()
}
tools {
jdk 'android-temurin-jdk-17.0.10'
}
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage('Setup') {
steps {
sh 'java -XshowSettings:vm -version'
step([$class: 'GitHubSetCommitStatusBuilder'])
withGradle {
sh './gradlew --version'
sh './gradlew clean --no-build-cache --no-configuration-cache'
}
}
}
stage('Build') {
steps {
withGradle {
sh './gradlew assembleGoogle --stacktrace --no-build-cache --no-configuration-cache'
sh './gradlew bundleGoogle --stacktrace --no-build-cache --no-configuration-cache'
sh './gradlew assembleFdroid --stacktrace --no-build-cache --no-configuration-cache'
sh './gradlew bundleFdroid --stacktrace --no-build-cache --no-configuration-cache'
}
}
}
stage('Test') {
steps {
echo 'Testing...'
}
}
stage('Analyze') {
steps {
withGradle {
sh './gradlew lintGoogleRelease --no-build-cache --no-configuration-cache'
sh './gradlew lintFdroidRelease --no-build-cache --no-configuration-cache'
}
}
}
stage('Deploy') {
when {
expression {
currentBuild.result == null || currentBuild.result == 'SUCCESS'
}
}
steps {
archiveArtifacts artifacts: '**/outputs/**/*.apk, **/outputs/**/*.aab', caseSensitive: false, followSymlinks: false
}
}
}
post {
success {
recordIssues skipBlames: true, skipPublishingChecks: true, sourceDirectories: [[path: 'app/src']], tools: [androidLintParser(pattern: '**/reports/lint-results-*.xml')]
influxDbPublisher customPrefix: 'anewjkuapp', customProjectName: '', jenkinsEnvParameterField: '', jenkinsEnvParameterTag: '', selectedTarget: 'jenkins'
}
always {
step([$class: 'GitHubCommitStatusSetter'])
findBuildScans()
}
cleanup {
mail to: '[email protected]',
subject: "${currentBuild.fullProjectName} » ${BRANCH_NAME} - Build ${currentBuild.displayName} - ${currentBuild.currentResult}",
body: "for details see ${currentBuild.absoluteUrl}"
emailext to: '[email protected]',
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!',
attachLog: true
}
}
}