works okay again after 'go get' deprecation
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
5b80e9bd2e
commit
04e5b38887
10
Makefile
10
Makefile
|
@ -49,10 +49,10 @@ redomod:
|
|||
curl-help:
|
||||
curl --silent http://localhost:9419/help
|
||||
|
||||
curl-list:
|
||||
curl-list-changed:
|
||||
curl --silent http://localhost:9419/list?perfect=false
|
||||
|
||||
curl-list-readonly:
|
||||
curl-list-include-readonly:
|
||||
curl --silent http://localhost:9419/list?readonly=true
|
||||
|
||||
curl-gitpull-everypackage:
|
||||
|
@ -64,6 +64,12 @@ curl-gitpull-helloworld:
|
|||
curl-gitpull-basicworld:
|
||||
curl --silent http://localhost:9419/gitpull?repo=go.wit.com/apps/basicworld
|
||||
|
||||
curl-release-helloworld:
|
||||
curl --silent http://localhost:9419/release?repo=go.wit.com/apps/helloworld
|
||||
|
||||
curl-release-gowit:
|
||||
curl --silent http://localhost:9419/release?repo=go.wit.com/lib/gui/gowit
|
||||
|
||||
curl-file-for-go.wit.com:
|
||||
curl --silent http://localhost:9419/goweblist?readonly=true
|
||||
curl --silent http://localhost:9419/goweblist?readonly=true |sort > ~/go.wit.com.versions
|
||||
|
|
5
http.go
5
http.go
|
@ -52,6 +52,11 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
if route == "/release" {
|
||||
simpleRelease(w, r)
|
||||
return
|
||||
}
|
||||
|
||||
if route == "/gitpull" {
|
||||
repoName := r.URL.Query().Get("repo")
|
||||
if repoName != "" {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
)
|
||||
|
@ -17,19 +18,39 @@ import (
|
|||
func simpleRelease(w http.ResponseWriter, r *http.Request) {
|
||||
repoName := r.URL.Query().Get("repo")
|
||||
if repoName == "" {
|
||||
msg(w, "url did not have repo variable")
|
||||
return
|
||||
}
|
||||
// git pull (or go-clone of it doesn't exist)
|
||||
repo := me.repos.View.FindRepoByName(repoName)
|
||||
if repo == nil {
|
||||
msg(w, "repo unknown: " + repoName)
|
||||
return
|
||||
}
|
||||
header := repo.StandardHeader()
|
||||
if repo.CheckDirty() {
|
||||
msg(w, header+"skip dirty repo")
|
||||
continue
|
||||
return
|
||||
}
|
||||
if repo.State() == "PERFECT" {
|
||||
msg(w, header+"already released")
|
||||
return
|
||||
}
|
||||
|
||||
curName := repo.Status.GetCurrentBranchName()
|
||||
mName := repo.Status.GetMasterBranchName()
|
||||
if curName != mName {
|
||||
// s := log.Sprintf("\trepo is not working from main branch", curName, "!=", mName)
|
||||
s := fmt.Sprint("repo is not working from main branch ", curName, " != ", mName)
|
||||
msg(w, s)
|
||||
return
|
||||
}
|
||||
cmd := []string{"git", "pull", "-v"}
|
||||
msg(w, header+strings.Join(cmd, " "))
|
||||
if repo.Status.MergeUserToDevel() {
|
||||
msg(w, "THINGS SEEM OK MergeUserToDevel() returned true.")
|
||||
} else {
|
||||
msg(w, "THINGS FAILED MergeUserToDevel() returned false")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue