This repository has been archived by the owner on Jan 14, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 168
/
Jenkinsfile
44 lines (44 loc) · 1.8 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
pipeline {
agent { label 'java' }
parameters {
booleanParam(name: 'RELEASE', defaultValue: false, description: 'Perform release?')
string(name: 'RELEASE_VERSION', defaultValue: '', description: 'Release version')
string(name: 'NEXT_VERSION', defaultValue: '', description: 'Next version (without SNAPSHOT)')
}
stages {
stage('Build') {
steps {
sh './mvnw -Dmaven.test.failure.ignore=true clean verify'
}
}
stage("Demo") {
steps {
publishHTML([reportName: 'Allure Report', reportDir: 'allure-report-preview/target/allure-report',
reportFiles: 'index.html', reportTitles: '', allowMissing: false,
alwaysLinkToLastBuild: false, keepAll: false])
}
}
stage('Release') {
when { expression { return params.RELEASE } }
steps {
configFileProvider([configFile(fileId: 'sonatype-settings.xml', variable: 'SETTINGS')]) {
sshagent(['qameta-ci_ssh']) {
sh 'git checkout master && git pull origin master'
sh "./mvnw release:prepare release:perform -B -s ${env.SETTINGS} " +
"-DreleaseVersion=${params.RELEASE_VERSION} " +
"-DdevelopmentVersion=${params.NEXT_VERSION}-SNAPSHOT"
}
}
}
}
}
post {
always {
deleteDir()
}
failure {
slackSend message: "${env.JOB_NAME} - #${env.BUILD_NUMBER} failed (<${env.BUILD_URL}|Open>)",
color: 'danger', teamDomain: 'qameta', channel: 'allure', tokenCredentialId: 'allure-channel'
}
}
}