diff --git a/drone/build_logs.go b/drone/build_logs.go index 0ed821b6..2c14243e 100644 --- a/drone/build_logs.go +++ b/drone/build_logs.go @@ -34,7 +34,7 @@ func buildLogs(c *cli.Context) error { buildArg := c.Args().Get(1) var number int - if buildArg == "last" { + if buildArg == "" { // Fetch the build number from the last build build, err := client.BuildLast(owner, name, "") if err != nil { @@ -44,7 +44,7 @@ func buildLogs(c *cli.Context) error { } else { number, err = strconv.Atoi(buildArg) if err != nil { - return err + return fmt.Errorf("Error: Invalid number or missing job number. eg 100") } } @@ -72,7 +72,7 @@ func buildLogs(c *cli.Context) error { if err = dec.Decode(&line); err != nil { return err } - fmt.Printf("%s\n", line.Out) + fmt.Printf("%s", line.Out) } _, err = dec.Token() diff --git a/server/hook.go b/server/hook.go index 5e8d35d3..15a407a8 100644 --- a/server/hook.go +++ b/server/hook.go @@ -422,6 +422,10 @@ func (b *builder) Build() ([]*buildItem, error) { environ[k] = v } + for k, v := range axis { + environ[k] = v + } + secrets := map[string]string{} for _, sec := range b.Secs { if !sec.MatchEvent(b.Curr.Event) { @@ -439,9 +443,11 @@ func (b *builder) Build() ([]*buildItem, error) { } y := b.Yaml - if s, err := envsubst.Eval(y, sub); err != nil { - y = s + s, err := envsubst.Eval(y, sub) + if err != nil { + return nil, err } + y = s parsed, err := yaml.ParseString(y) if err != nil {