-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
40 lines (37 loc) · 1.63 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
pipeline {
agent any
stages {
stage('Prune local only tags') {
steps {
bat 'git fetch --prune origin "+refs/tags/*:refs/tags/*"'
}
}
stage('Build') {
steps {
}
}
}
post {
always {
step([$class: 'CoberturaPublisher', autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: 'built/coverage.cobertura.xml', failUnhealthy: false, failUnstable: false, maxNumberOfBuilds: 0, onlyStable: false, sourceEncoding: 'ASCII', zoomCoverageChart: false])
step([$class: 'MSTestPublisher', testResultsFile: '**/testresults*.xml', failOnError: false, keepLongStdio: true])
}
success {
script {
def tag = powershell (returnStdout: true, script: '$semVer = (git-flow-version --branch ${env.GIT_BRANCH} | ConvertFrom-Json).SemVer; git tag $semVer;git push --verbose origin $semVer;$semVer')
echo "Tag: ${tag}"
if (tag?.trim()) {
slackSend (color: '#008000', message: "Built OK: ${env.JOB_NAME} <${env.BUILD_URL}|#${env.BUILD_NUMBER}> `${tag.trim()}`")
} else {
slackSend (color: '#008000', message: "Built OK: ${env.JOB_NAME} <${env.BUILD_URL}|#${env.BUILD_NUMBER}>")
}
}
}
// unstable {}
failure {
slackSend (color: '#800000', message: """Build Failed: ${env.JOB_NAME} <${env.BUILD_URL}|#${env.BUILD_NUMBER}>
Commit SHA: ${env.GIT_COMMIT}""")
}
// changed {}
}
}