Skip to content

Commit c8b5159

Browse files
committed
Use the tool built to check release status
1 parent c887404 commit c8b5159

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

Jenkinsfile

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,33 @@ pipeline {
3333
go test simple-relmgt simple-relmgt/cmds/draftcmd simple-relmgt/cmds/checkcmd simple-relmgt/cmds/releasecmd simple-relmgt/cmds/statecmd simple-relmgt/cmds/tagcmd''')
3434
}
3535
}
36+
/* stage('Release PR status') {
37+
when {
38+
changeRequest target: 'master'
39+
}
40+
steps {
41+
sh('./simple-relmgt status')
42+
}
43+
}
44+
/* stage('tag it') {
45+
when {
46+
branch 'master'
47+
environment name: 'RELEASE_STATUS', value: '0'
48+
}
49+
steps {
50+
sh('simple-relmgt tag-it') // git tag, push it and create a draft github release
51+
}
52+
}*/
53+
3654
stage('Deploy') {
3755
when { branch 'master' }
3856
steps {
57+
script {
58+
env.RELEASE_STATUS = sh(script: 'simple-relmgt check', returnStatus: true)
59+
}
3960
withCredentials([
40-
usernamePassword(credentialsId: 'github-jenkins-cred', usernameVariable: 'GITHUB_USER', passwordVariable: 'GITHUB_TOKEN')]) {
61+
usernamePassword(credentialsId: 'github-jenkins-cred', usernameVariable: 'GITHUB_USER', passwordVariable: 'GITHUB_TOKEN')
62+
]) {
4163
sh('''#!/bin/bash -e
4264
source ./build-env.sh
4365
publish.sh latest''')

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,6 @@ pipeline {
134134
}
135135
```
136136

137-
138-
139137
## Possible futur
140138

141139
For now, we thought this simple automated release process, will be good in most cases. But we may need to enhance it with [github deployment API](https://developer.github.com/v3/repos/deployments/).

0 commit comments

Comments
 (0)