Skip to content

Commit

Permalink
build(script): Add publish script
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveRuble committed Apr 2, 2019
1 parent df0cee1 commit a5c5eff
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
8 changes: 6 additions & 2 deletions bosun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ environments: []
appRefs: {}
apps:
- name: bosun
version: 0.4.9
version: 0.5.1
images: []
scripts:
- name: publish
Expand All @@ -11,4 +11,8 @@ apps:
args: []
flags: {}
literal:
command: [mage, -v, publish]
script: |-
test -z "$(git status --porcelain)" || echo "directory is dirty" && exit 1
git tag $(bosun app version bosun)
git push --tags
goreleaser --rm-dist
4 changes: 4 additions & 0 deletions pkg/bosun/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ func (d *Command) Execute(ctx BosunContext, opts ...CommandOpts) (string, error)

func (d *Command) executeCore(ctx BosunContext, opt CommandOpts) (string, error) {

if d == nil {
return "", errors.New("command was nil")
}

var err error
var value string

Expand Down
2 changes: 1 addition & 1 deletion pkg/bosun/script.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (b *Bosun) ExecuteContext(ctx BosunContext, s *Script, steps ...int) error
if step.Literal != nil {
log.Info("Step is a literal script, not a bosun action.")

_, err := s.Literal.Execute(ctx.WithDir(filepath.Dir(s.FromPath)), CommandOpts{StreamOutput:true})
_, err := step.Literal.Execute(ctx.WithDir(filepath.Dir(s.FromPath)), CommandOpts{StreamOutput:true})
if err != nil {
return err
}
Expand Down

0 comments on commit a5c5eff

Please sign in to comment.