Skip to content

Commit 3aed363

Browse files
committed
Add glide initial file
1 parent bdc6fe7 commit 3aed363

File tree

12 files changed

+232
-18
lines changed

12 files changed

+232
-18
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.be-*
2+
vendor

README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,58 @@ Following are the steps used to release a project.
8484
The release state is defined by another regexp detected in the release note. `simple-relmgt` will detect it. If not found, by default, it will set `released` except if we change the default use case.
8585
additionally, `simple-relmgt` will push some artifacts to the github release.
8686

87+
## Jenkinsfile
88+
89+
On `Jenkinsfile` side, there is 2 run context option: Download it from github and run it, or run it from docker.
90+
91+
The following example is based on the download use case.
92+
93+
```Jenkinsfile
94+
pipeline {
95+
agent any
96+
environment {
97+
env.RELEASE_STATUS = sh(
98+
script: 'simple-relmgt check',
99+
returnStatus: true
100+
)
101+
}
102+
/* optional */
103+
stages {
104+
stage('Release PR status') {
105+
when {
106+
changeRequest target: 'master'
107+
}
108+
steps {
109+
sh('simple-relmgt status')
110+
}
111+
}
112+
stage('tag it') {
113+
when {
114+
branch 'master'
115+
environment name: 'RELEASE_STATUS', value: '0'
116+
}
117+
steps {
118+
sh('simple-relmgt tag-it') // git tag, push it and create a draft github release
119+
}
120+
}
121+
stage ('...'){}
122+
stage ('release it') {
123+
when {
124+
branch 'master'
125+
environment name: 'RELEASE_STATUS', value: '0'
126+
}
127+
steps {
128+
sh('simple-relmgt release-it') // release the draft github release
129+
}
130+
stage ('Any post release tasks...'){}
131+
132+
}
133+
}
134+
}
135+
```
136+
137+
138+
87139
## Possible futur
88140

89141
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/).

cmds/checkcmd/check-cmd.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package checkcmd
2+
3+
import "github.com/alecthomas/kingpin"
4+
5+
// CheckCmd control the check command
6+
type CheckCmd struct {
7+
}
8+
9+
// Action execute the `check` command
10+
func (c *CheckCmd) Action([]string) {
11+
12+
}
13+
14+
// Init initialize the check cli commands
15+
func (c *CheckCmd) Init(app *kingpin.Application) {
16+
if c == nil || app == nil {
17+
return
18+
}
19+
20+
}

cmds/draft-it/draft-it.go

Lines changed: 0 additions & 6 deletions
This file was deleted.

cmds/draftcmd/draft-cmd.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package draftcmd
2+
3+
import "github.com/alecthomas/kingpin"
4+
5+
// DraftCmd control the draft-it command
6+
type DraftCmd struct {
7+
}
8+
9+
// Action execute the `check` command
10+
func (c *DraftCmd) Action([]string) {
11+
12+
}
13+
14+
// Init initialize the check cli commands
15+
func (c *DraftCmd) Init(app *kingpin.Application) {
16+
if c == nil || app == nil {
17+
return
18+
}
19+
20+
}

cmds/releasecmd/release-cmd.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package releasecmd
2+
3+
import "github.com/alecthomas/kingpin"
4+
5+
// ReleaseCmd control the release-it command
6+
type ReleaseCmd struct {
7+
}
8+
9+
// Action execute the `check` command
10+
func (c *ReleaseCmd) Action([]string) {
11+
12+
}
13+
14+
// Init initialize the check cli commands
15+
func (c *ReleaseCmd) Init(app *kingpin.Application) {
16+
if c == nil || app == nil {
17+
return
18+
}
19+
20+
}

cmds/statecmd/state-cmd.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package statecmd
2+
3+
import "github.com/alecthomas/kingpin"
4+
5+
// StateCmd control the status command
6+
type StateCmd struct {
7+
}
8+
9+
// Action execute the `check` command
10+
func (c *StateCmd) Action([]string) {
11+
12+
}
13+
14+
// Init initialize the check cli commands
15+
func (c *StateCmd) Init(app *kingpin.Application) {
16+
if c == nil || app == nil {
17+
return
18+
}
19+
20+
}

cmds/tagcmd/tag-cmd.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package tagcmd
2+
3+
import "github.com/alecthomas/kingpin"
4+
5+
// TagCmd control the tag-it command
6+
type TagCmd struct {
7+
}
8+
9+
// Action execute the `check` command
10+
func (c *TagCmd) Action([]string) {
11+
12+
}
13+
14+
// Init initialize the check cli commands
15+
func (c *TagCmd) Init(app *kingpin.Application) {
16+
if c == nil || app == nil {
17+
return
18+
}
19+
20+
}

glide.lock

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

glide.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package: simple-relmgt
2+
import:
3+
- package: github.com/alecthomas/kingpin
4+
version: ^2.2.6
5+
- package: github.com/forj-oss/forjj-modules
6+
subpackages:
7+
- trace

0 commit comments

Comments
 (0)