-
Notifications
You must be signed in to change notification settings - Fork 16
/
Jenkinsfile
55 lines (51 loc) · 1 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
pipeline {
agent any
tools {
jdk 'OpenJDK 17'
}
triggers {
pollSCM('H * * * *')
}
options {
buildDiscarder(logRotator(numToKeepStr: '15', artifactNumToKeepStr: '15'))
}
parameters {
booleanParam(name: 'RELEASE', defaultValue: false, description: 'Make a new release')
}
stages {
stage('Checkout') {
when {
environment name: 'RELEASE', value: 'true'
}
steps {
checkout scm
sh "git checkout master"
sh "git pull --rebase"
}
}
stage('Build') {
steps {
sh './gradlew clean build'
}
}
stage('Release') {
when {
environment name: 'RELEASE', value: 'true'
}
steps {
sh './gradlew release -Prelease.useAutomaticVersion=true'
sh './gradlew closeRepository'
}
}
stage('Publish to Maven Central') {
steps {
sh './gradlew publish'
}
}
}
post {
always {
junit '**/build/test-results/test/*.xml'
}
}
}