Esempio n. 1
0
func ReleasePromote(rw http.ResponseWriter, r *http.Request) {
	log := releasesLogger("promote").Start()

	vars := mux.Vars(r)
	app := vars["app"]
	release := vars["release"]

	rel, err := models.GetRelease(app, release)

	if err != nil {
		helpers.Error(log, err)
		RenderError(rw, err)
		return
	}

	err = rel.Promote()

	if err != nil {
		helpers.Error(log, err)
		RenderError(rw, err)
		return
	}

	log.Success("step=release.promote app=%q", app)

	RenderText(rw, "ok")
}
Esempio n. 2
0
func ReleaseShow(rw http.ResponseWriter, r *http.Request) {
	log := releasesLogger("show").Start()

	vars := mux.Vars(r)
	app := vars["app"]
	release := vars["release"]

	rr, err := models.GetRelease(app, release)

	if err != nil {
		helpers.Error(log, err)
		RenderError(rw, err)
		return
	}

	RenderJson(rw, rr)
}
Esempio n. 3
0
File: apps.go Progetto: oren/kernel
func AppPromote(rw http.ResponseWriter, r *http.Request) {
	vars := mux.Vars(r)
	app := vars["app"]

	release, err := models.GetRelease(app, GetForm(r, "release"))

	if err != nil {
		RenderError(rw, err)
		return
	}

	err = release.Promote()

	if err != nil {
		RenderError(rw, err)
		return
	}

	Redirect(rw, r, fmt.Sprintf("/apps/%s", app))
}