Skip to content

Commit

Permalink
Merge pull request #575 from convox/release-20160425
Browse files Browse the repository at this point in the history
Release 20160425
  • Loading branch information
Noah Zoschke committed Apr 25, 2016
2 parents 8a671d2 + fa880fa commit ee7f1b9
Show file tree
Hide file tree
Showing 132 changed files with 12,488 additions and 1,740 deletions.
194 changes: 112 additions & 82 deletions Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions api/controllers/builds.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,16 @@ func BuildUpdate(rw http.ResponseWriter, r *http.Request) *httperr.Error {
return httperr.Server(err)
}

if b.Status == "failed" {
provider.EventSend(&structs.Event{
Action: "build:create",
Data: map[string]string{
"app": b.App,
"id": b.Id,
},
}, fmt.Errorf(b.Reason))
}

return RenderJson(rw, b)
}

Expand Down
61 changes: 61 additions & 0 deletions api/controllers/certificates.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package controllers

import (
"net/http"
"sort"
"strings"

"github.com/convox/rack/api/httperr"
"github.com/convox/rack/api/provider"
"github.com/gorilla/mux"
)

func CertificateCreate(rw http.ResponseWriter, r *http.Request) *httperr.Error {
pub := r.FormValue("public")
key := r.FormValue("private")
chain := r.FormValue("chain")

cert, err := provider.CertificateCreate(pub, key, chain)

if err != nil {
return httperr.Server(err)
}

return RenderJson(rw, cert)
}

func CertificateDelete(rw http.ResponseWriter, r *http.Request) *httperr.Error {
id := mux.Vars(r)["id"]

err := provider.CertificateDelete(id)

if err != nil {
return httperr.Server(err)
}

return RenderSuccess(rw)
}

func CertificateGenerate(rw http.ResponseWriter, r *http.Request) *httperr.Error {
domains := strings.Split(r.FormValue("domains"), ",")

cert, err := provider.CertificateGenerate(domains)

if err != nil {
return httperr.Server(err)
}

return RenderJson(rw, cert)
}

func CertificateList(rw http.ResponseWriter, r *http.Request) *httperr.Error {
certs, err := provider.CertificateList()

if err != nil {
return httperr.Server(err)
}

sort.Sort(certs)

return RenderJson(rw, certs)
}
Loading

0 comments on commit ee7f1b9

Please sign in to comment.