-
Notifications
You must be signed in to change notification settings - Fork 5
/
Jenkinsfile
34 lines (34 loc) · 1.18 KB
/
Jenkinsfile
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
node('android-34') {
dir(path: '/build') {
stage('Checkout') {
checkout scm
}
stage('Prepare') {
env.BUILD_ID = sh(returnStdout: true, script: 'curl https://jenkins.cled.top/id-gen/cledwynl/mbga').trim()
currentBuild.displayName = "#${env.BUILD_ID}"
}
stage('Build') {
def target = env.BRANCH_IS_PRIMARY ? 'Release' : 'Feature'
withCredentials([
certificate(
credentialsId: 'keystore',
keystoreVariable: 'KEYSTORE',
passwordVariable: 'STORE_PASSWORD',
),
usernamePassword(
credentialsId: 'key-alias',
usernameVariable: 'KEY_ALIAS',
passwordVariable: 'KEY_PASSWORD'
)
]) {
sh "./gradlew assemble${target}"
}
archiveArtifacts(artifacts: 'app/build/outputs/apk/**')
}
stage('Check') {
catchError(buildResult: env.BRANCH_IS_PRIMARY ? 'FAILURE' : 'UNSTABLE', stageResult: 'FAILURE') {
sh './gradlew ktLint'
}
}
}
}