-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJenkinsfile
More file actions
38 lines (37 loc) · 965 Bytes
/
Jenkinsfile
File metadata and controls
38 lines (37 loc) · 965 Bytes
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
def VERSION
pipeline {
agent any
environment {
SILLY = ''
}
stages {
stage('Give Permission') {
steps {
script {
sh 'chmod +x gradlew'
}
}
}
stage('Version') {
steps {
script {
if (env.TAG_NAME) {
VERSION = "${TAG_NAME}"
} else if (env.BRANCH_NAME == 'master') {
VERSION = "${BUILD_NUMBER}"
} else {
VERSION = "${BRANCH_NAME}-${BUILD_NUMBER}"
}
}
}
}
stage('Build') {
steps {
script {
sh "./gradlew -Pversion=${VERSION} clean build"
archiveArtifacts artifacts: "build/libs/*.jar", fingerprint: true
}
}
}
}
}