forked from jenkinsci/kubernetes-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile-release
28 lines (26 loc) · 1013 Bytes
/
Jenkinsfile-release
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
def label = "maven-${UUID.randomUUID().toString()}"
def mvnOpts = '-DskipTests -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -Darguments="-DskipTests -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"'
podTemplate(label: label, containers: [
containerTemplate(name: 'maven', image: 'maven:alpine', ttyEnabled: true, command: 'cat')
], volumes: [
persistentVolumeClaim(mountPath: '/root/.m2/repository', claimName: 'maven-repo', readOnly: false)
]) {
node(label) {
stage('Checkout') {
checkout scm
}
stage('Release prepare') {
container('maven') {
sh "mvn -B ${mvnOpts} release:clean release:prepare -DreleaseVersion=${releaseVersion} -DdevelopmentVersion=${developmentVersion}"
}
}
stage('Release perform') {
container('maven') {
sh """
apk update && apk add git
mvn -B ${mvnOpts} release:perform
"""
}
}
}
}