Skip to content

Commit

Permalink
Merge pull request #1151 from convox/20160826
Browse files Browse the repository at this point in the history
[RELEASE] 20160826
  • Loading branch information
ddollar authored Aug 26, 2016
2 parents a9a896e + 279f592 commit 7c1cb44
Show file tree
Hide file tree
Showing 11 changed files with 1,179 additions and 57 deletions.
7 changes: 7 additions & 0 deletions api/controllers/builds.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ func BuildGet(rw http.ResponseWriter, r *http.Request) *httperr.Error {
return httperr.Server(err)
}

l, err := models.Provider().BuildLogs(app, build)
if err != nil {
return httperr.Server(err)
}

b.Logs = l

return RenderJson(rw, b)
}

Expand Down
12 changes: 11 additions & 1 deletion api/models/cronjob.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package models

import (
"crypto/sha256"
"encoding/base32"
"fmt"
"strings"

Expand Down Expand Up @@ -47,5 +49,13 @@ func (cr *CronJob) ShortName() string {
}

func (cr *CronJob) LongName() string {
return fmt.Sprintf("%s-%s-%s", cr.App.StackName(), cr.Process(), cr.Name)
prefix := fmt.Sprintf("%s-%s-%s", cr.App.StackName(), cr.Process(), cr.Name)
hash := sha256.Sum256([]byte(prefix))
suffix := "-" + base32.StdEncoding.EncodeToString(hash[:])[:7]

// $prefix-$suffix-schedule" needs to be <= 64 characters
if len(prefix) > 55-len(suffix) {
prefix = prefix[:55-len(suffix)]
}
return prefix + suffix
}
2 changes: 1 addition & 1 deletion api/models/fixtures/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ fixture:
go build -o ./fixture fixture.go

%.json: %.yml
env AWS_REGION=test PROVIDER=test RACK=convox-test ./fixture $< > $@
env AWS_REGION=test PROVIDER=test CLUSTER=convox-test RACK=convox-test ./fixture $< > $@
Loading

0 comments on commit 7c1cb44

Please sign in to comment.