2017-01-14 16:34:22 +02:00
|
|
|
package git
|
|
|
|
|
|
|
|
import "github.com/goreleaser/releaser/context"
|
|
|
|
|
|
|
|
// Pipe for brew deployment
|
|
|
|
type Pipe struct{}
|
|
|
|
|
2017-01-14 20:41:32 +02:00
|
|
|
// Description of the pipe
|
2017-01-14 19:14:35 +02:00
|
|
|
func (Pipe) Description() string {
|
|
|
|
return "Gathering Git data..."
|
2017-01-14 16:34:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Run the pipe
|
2017-01-14 18:06:57 +02:00
|
|
|
func (Pipe) Run(ctx *context.Context) (err error) {
|
2017-01-14 16:34:22 +02:00
|
|
|
tag, err := currentTag()
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
previous, err := previousTag(tag)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
log, err := log(previous, tag)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2017-01-14 18:06:57 +02:00
|
|
|
ctx.Git = &context.GitInfo{
|
|
|
|
CurrentTag: tag,
|
|
|
|
PreviousTag: previous,
|
|
|
|
Diff: log,
|
|
|
|
}
|
2017-01-14 16:34:22 +02:00
|
|
|
return
|
|
|
|
}
|