forked from learningequality/kolibri-installer-android
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile-upload
More file actions
86 lines (77 loc) · 2.83 KB
/
Jenkinsfile-upload
File metadata and controls
86 lines (77 loc) · 2.83 KB
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
// Jenkins upload pipeline
//
// https://www.jenkins.io/doc/book/pipeline/
//
// Required parameters: RELEASE_NOTES
pipeline {
// Any agent is fine as all the work happens in plugins.
agent any
stages {
stage('Copy AAB') {
steps {
// Wipe the build directory before copying to ensure
// there are no stale files.
sh 'rm -rf app/build'
copyArtifacts(
projectName: 'kolibri-installer-android',
selector: upstream(fallbackToLastSuccessful: true),
filter: 'app/build/outputs/bundle/release/app-release.aab, ' +
'app/build/outputs/version-release.json',
fingerprintArtifacts: true,
)
}
}
stage('Upload') {
steps {
// A bit of pre-processing is needed, so we need to drop
// into scripted pipeline mode.
script {
// Make sure release notes have been provided.
if (!params.RELEASE_NOTES) {
error('RELEASE_NOTES parameter not set')
}
def releaseNotes = readJSON(text: params.RELEASE_NOTES)
androidApkUpload(
googleCredentialsId: 'google-play-account',
filesPattern: 'app/build/outputs/bundle/release/app-release.aab',
trackName: 'internal',
recentChangeList: releaseNotes,
rolloutPercentage: '100',
)
}
}
}
}
post {
always {
script {
def version = readJSON(file: 'app/build/outputs/version-release.json')
buildDescription("${version.versionCode} ${version.versionName} ${version.ekVersion}")
}
}
success {
script {
def version = readJSON(file: 'app/build/outputs/version-release.json')
emailext (
to: 'apps@endlessos.org,$DEFAULT_RECIPIENTS',
replyTo: 'apps@endlessos.org',
subject: "Uploaded org.endlessos.Key " +
"${version.versionCode} to internal testing",
body: """\
Uploaded org.endlessos.Key ${version.versionCode} ${version.versionName} to internal testing.
See Jenkins job \$PROJECT_NAME build \$BUILD_NUMBER for details.
\$BUILD_URL
"""
)
}
}
failure {
emailext (
to: 'apps@endlessos.org,$DEFAULT_RECIPIENTS',
replyTo: 'apps@endlessos.org',
subject: '$DEFAULT_SUBJECT',
body: '$DEFAULT_CONTENT',
)
}
}
}