forked from dtargons/allure2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
52 lines (51 loc) · 2.42 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
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 './gradlew build'
}
}
stage('Demo') {
steps {
sh 'allure-commandline/build/install/allure-commandline/bin/allure generate ' +
'allure-generator/test-data/demo --clean -o build/report-demo'
publishHTML([reportName : 'Demo Report', reportDir: 'build/report-demo', reportFiles: 'index.html',
reportTitles: '', allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false])
sh 'allure-commandline/build/install/allure-commandline/bin/allure generate ' +
'allure-generator/test-data/demo2 --clean -o build/report-demo2'
publishHTML([reportName : 'Demo2 Report', reportDir: 'build/report-demo2', reportFiles: 'index.html',
reportTitles: '', allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false])
}
}
stage('Release') {
when { expression { return params.RELEASE } }
steps {
withCredentials([usernamePassword(credentialsId: 'qameta-ci_bintray',
usernameVariable: 'BINTRAY_USER', passwordVariable: 'BINTRAY_API_KEY')]) {
sshagent(['qameta-ci_ssh']) {
sh 'git checkout master && git pull origin master'
sh "./gradlew release -Prelease.useAutomaticVersion=true " +
"-Prelease.releaseVersion=${RELEASE_VERSION} " +
"-Prelease.newVersion=${NEXT_VERSION}-SNAPSHOT"
}
}
}
}
}
post {
always {
allure results: [[path: '**/build/allure-results']]
deleteDir()
}
failure {
slackSend message: "${env.JOB_NAME} - #${env.BUILD_NUMBER} failed (<${env.BUILD_URL}|Open>)",
color: 'danger', teamDomain: 'qameta', channel: 'allure', tokenCredentialId: 'allure-channel'
}
}
}