Skip to content

Commit 9e0f8f0

Browse files
committed
ci: Jenkinsfile aesthetics
1 parent e2f5ea9 commit 9e0f8f0

File tree

1 file changed

+42
-37
lines changed

1 file changed

+42
-37
lines changed

Jenkinsfile

Lines changed: 42 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@ pipeline {
1111
}
1212
stage('Build') {
1313
steps {
14-
// Jenkins sometimes doesn't run Gradle automatically in plain console mode, so make it explicit
15-
sh './gradlew --console=plain clean distZipBundleJres'
14+
sh './gradlew clean distZipBundleJres'
1615
archiveArtifacts 'desktop/build/distributions/DestinationSol.zip'
1716
}
1817
}
1918
stage('Analytics') {
2019
steps {
21-
sh "./gradlew --console=plain check javadoc"
20+
sh "./gradlew check javadoc"
2221
}
2322
}
2423
stage('Record') {
@@ -45,8 +44,9 @@ pipeline {
4544
} else {
4645
println "Not varying the Android path from default " + androidGitPath
4746
}
48-
// Figure out a suitable target branch in the Android repo
47+
// Figure out a suitable target branch in the Android repo, default is the develop branch
4948
def androidBranch = "develop"
49+
// Check to see if Jenkins is building a tag, branch, or other (including PRs)
5050
if (env.TAG_NAME != null && env.TAG_NAME ==~ /v\d+\.\d+\.\d+.*/) {
5151
println "Going to use target Android tag " + env.TAG_NAME
5252
androidBranch = "refs/tags/" + env.TAG_NAME
@@ -59,13 +59,13 @@ pipeline {
5959
checkout scm: [$class: 'GitSCM', branches: [[name: androidBranch]], extensions: [], userRemoteConfigs: [[credentialsId: 'GooeyHub', url: androidGitPath]]]
6060
}
6161
}
62-
sh './gradlew --console=plain :android:assembleDebug'
62+
sh './gradlew :android:assembleDebug'
6363
archiveArtifacts 'android/build/outputs/apk/debug/android-debug.apk'
6464
}
6565
}
6666
stage('Record Android') {
6767
steps {
68-
sh './gradlew --console=plain :android:lint'
68+
sh './gradlew :android:lint'
6969
recordIssues tool: androidLintParser(pattern: 'android/build/reports/lint-results.xml')
7070
}
7171
}
@@ -106,40 +106,45 @@ pipeline {
106106
}
107107
}
108108
}
109-
stage('Publish Alpha To Play Store') {
110-
when {
111-
// Example: v2.1.0-alpha
112-
tag pattern: 'v\\d+\\.\\d+\\.\\d+-alpha$', comparator: "REGEXP"
113-
}
114-
steps {
115-
dir('android') {
116-
sh 'fastlane deployAlpha'
109+
// Leaving this stage inside a parallel as only one can ever be true at once (pipeline visualization aesthetics!)
110+
stage('Target release channel') {
111+
parallel {
112+
stage('Publish Alpha To Play Store') {
113+
when {
114+
// Example: v2.1.0-alpha
115+
tag pattern: 'v\\d+\\.\\d+\\.\\d+-alpha$', comparator: "REGEXP"
116+
}
117+
steps {
118+
dir('android') {
119+
sh 'fastlane deployAlpha'
120+
}
121+
}
117122
}
118-
}
119-
}
120-
stage('Publish Beta To Play Store') {
121-
when {
122-
// Example: v2.1.0-beta
123-
tag pattern: 'v\\d+\\.\\d+\\.\\d+-beta$', comparator: "REGEXP"
124-
}
125-
steps {
126-
dir('android') {
127-
sh 'fastlane deployBeta'
123+
stage('Publish Beta To Play Store') {
124+
when {
125+
// Example: v2.1.0-beta
126+
tag pattern: 'v\\d+\\.\\d+\\.\\d+-beta$', comparator: "REGEXP"
127+
}
128+
steps {
129+
dir('android') {
130+
sh 'fastlane deployBeta'
131+
}
132+
discordSend title: "Beta ${env.GIT_TAG} published to Play Store", result: currentBuild.currentResult, webhookURL: env.WEBHOOK
133+
}
128134
}
129-
discordSend title: "Beta ${env.GIT_TAG} published to Play Store", result: currentBuild.currentResult, webhookURL: env.WEBHOOK
130-
}
131-
}
132-
stage('Publish Release To Play Store') {
133-
when {
134-
// Example: v2.1.0
135-
// This intentionally does not include things like v2.1.0-beta
136-
tag pattern: 'v\\d+\\.\\d+\\.\\d+$', comparator: "REGEXP"
137-
}
138-
steps {
139-
dir('android') {
140-
sh 'fastlane deployProduction'
135+
stage('Publish Live To Play Store') {
136+
when {
137+
// Example: v2.1.0
138+
// This intentionally does not include things like v2.1.0-beta
139+
tag pattern: 'v\\d+\\.\\d+\\.\\d+$', comparator: "REGEXP"
140+
}
141+
steps {
142+
dir('android') {
143+
sh 'fastlane deployProduction'
144+
}
145+
discordSend title: "Release ${env.GIT_TAG} published to Play Store", result: currentBuild.currentResult, webhookURL: env.WEBHOOK
146+
}
141147
}
142-
discordSend title: "Release ${env.GIT_TAG} published to Play Store", result: currentBuild.currentResult, webhookURL: env.WEBHOOK
143148
}
144149
}
145150
}

0 commit comments

Comments
 (0)