repos.FindByName()
This commit is contained in:
parent
1735ae5826
commit
d9b91402cf
3
Makefile
3
Makefile
|
@ -71,6 +71,9 @@ curl-setCurrent-go-wit-com-gui:
|
||||||
curl-setTargetVersion-virtigo-v0.1.1:
|
curl-setTargetVersion-virtigo-v0.1.1:
|
||||||
curl --silent http://localhost:9419/setTargetVersion?version=v0.1.1
|
curl --silent http://localhost:9419/setTargetVersion?version=v0.1.1
|
||||||
|
|
||||||
|
curl-setTargetVersion-go-clone-v0.6:
|
||||||
|
curl --silent "http://localhost:9419/setTargetVersion?repo=go-clone&version=v0.6"
|
||||||
|
|
||||||
curl-incrementAllTargetVersions:
|
curl-incrementAllTargetVersions:
|
||||||
curl --silent http://localhost:9419/setAllTargetVersions
|
curl --silent http://localhost:9419/setAllTargetVersions
|
||||||
|
|
||||||
|
|
16
http.go
16
http.go
|
@ -92,7 +92,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
log.Info("version: " + version)
|
log.Info("version: " + version)
|
||||||
log.Info("comment: " + comment)
|
log.Info("comment: " + comment)
|
||||||
|
|
||||||
repo := me.repos.View.FindRepoByName(repoName)
|
repo := me.repos.View.FindByName(repoName)
|
||||||
if repo == nil {
|
if repo == nil {
|
||||||
log.Info("FindRepoByName() returned nil")
|
log.Info("FindRepoByName() returned nil")
|
||||||
return
|
return
|
||||||
|
@ -120,11 +120,23 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
case "/setTargetVersion":
|
case "/setTargetVersion":
|
||||||
log.Info("repo: " + repoName)
|
log.Info("repo: " + repoName)
|
||||||
log.Info("version: " + version)
|
log.Info("version: " + version)
|
||||||
|
if repoName != "" {
|
||||||
|
repo := me.repos.View.FindByName(repoName)
|
||||||
|
if repo == nil {
|
||||||
|
log.Info("could not find repo", repoName)
|
||||||
|
} else {
|
||||||
|
log.Info("setting target version", version)
|
||||||
|
repo.Status.SetTargetVersion(version)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if me.current == nil {
|
if me.current == nil {
|
||||||
log.Info("me.current == nil")
|
log.Info("me.current == nil")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
me.current.Status.SetTargetVersion(version)
|
me.current.Status.SetTargetVersion(version)
|
||||||
|
return
|
||||||
case "/setAllTargetVersions":
|
case "/setAllTargetVersions":
|
||||||
log.Info("version: " + version)
|
log.Info("version: " + version)
|
||||||
|
|
||||||
|
@ -141,7 +153,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case "/whitelist":
|
case "/whitelist":
|
||||||
repo := me.repos.View.FindRepoByName(repoName)
|
repo := me.repos.View.FindByName(repoName)
|
||||||
if repo == nil {
|
if repo == nil {
|
||||||
log.Info("FindRepoByName() returned nil")
|
log.Info("FindRepoByName() returned nil")
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue