more http options

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-11-04 13:24:46 -06:00
parent 9f7d034339
commit d3cc4d6a15
2 changed files with 97 additions and 17 deletions

View File

@ -3,18 +3,16 @@ VERSION = $(shell git describe --tags)
all: build all: build
./guireleaser --help ./guireleaser --help
single: build # single: build
./guireleaser go.wit.com/apps/go-clone --increment --release --reason "testing guireleaser" --dry-run # ./guireleaser go.wit.com/apps/go-clone --increment --release --reason "testing guireleaser" --dry-run
# dump:
# ./guireleaser go.wit.com/apps/go-clone --increment --release --reason "testing guireleaser" --dry-run --dump-versions
# single-really-do-it: build
# ./guireleaser go.wit.com/apps/go-clone --increment --release --reason "testing guireleaser"
dump: # stderr: build
./guireleaser go.wit.com/apps/go-clone --increment --release --reason "testing guireleaser" --dry-run --dump-versions # echo "writing to /tmp/guireleaser.stderr"
# ./guireleaser >/tmp/guireleaser.stderr 2>&1
single-really-do-it: build
./guireleaser go.wit.com/apps/go-clone --increment --release --reason "testing guireleaser"
stderr: build
echo "writing to /tmp/guireleaser.stderr"
./guireleaser >/tmp/guireleaser.stderr 2>&1
goimports: goimports:
goimports -w *.go goimports -w *.go
@ -51,8 +49,20 @@ curl-setBranchesToMasterB:
curl-findNext: curl-findNext:
curl --silent http://localhost:9419/findNext curl --silent http://localhost:9419/findNext
curl-showNext:
curl --silent http://localhost:9419/showNext
curl-setTargetVersion:
curl --silent http://localhost:9419/setTargetVersion?version=v0.22.5
curl-IncrementMinorVersion:
curl --silent http://localhost:9419/IncrementMinorVersion?repo=go.wit.com/toolkit/debian
curl-IncrementRevisonVersion:
curl --silent http://localhost:9419/IncrementRevisonVersion?repo=go.wit.com/toolkit/debian
# report on the release # report on the release
curl-list-release: curl-release-list:
curl --silent http://localhost:9419/releaselist?readonly=true curl --silent http://localhost:9419/releaselist?readonly=true
#curl-doSingleRepo: #curl-doSingleRepo:
@ -63,5 +73,5 @@ curl-list-changed:
curl --silent http://localhost:9419/list?perfect=false curl --silent http://localhost:9419/list?perfect=false
# include repos that you probably can't git push commits # include repos that you probably can't git push commits
curl-list-include-readonly: curl-everything-list:
curl --silent http://localhost:9419/list?readonly=true curl --silent http://localhost:9419/list?readonly=true

78
http.go
View File

@ -64,10 +64,80 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
} else { } else {
msg(w, "findNext() did not find a repo. You might be finished?") msg(w, "findNext() did not find a repo. You might be finished?")
} }
msg(w, "repo: " + me.release.repo.String()) msg(w, "repo: "+me.release.repo.String())
msg(w, "name: " + me.release.version.String()) msg(w, "name: "+me.release.version.String())
msg(w, "notes: " + me.release.notes.String()) msg(w, "notes: "+me.release.notes.String())
msg(w, "status: " + me.release.status.String()) msg(w, "status: "+me.release.status.String())
msg(w, me.current.StandardHeader())
msg(w, me.current.StandardReleaseHeader())
return
}
if route == "/setCurrentRepo" {
repoName := r.URL.Query().Get("repo")
version := r.URL.Query().Get("version")
comment := r.URL.Query().Get("comment")
msg(w, "repo: "+repoName)
msg(w, "version: "+version)
msg(w, "comment: "+comment)
repo := me.repos.View.FindRepoByName(repoName)
if repo == nil {
msg(w, "FindRepoByName() returned nil")
return
}
setCurrentRepo(repo, "HTTP", "doRelease() ?")
}
if route == "/IncrementRevisonVersion" {
repo := r.URL.Query().Get("repo")
version := r.URL.Query().Get("version")
comment := r.URL.Query().Get("comment")
msg(w, "repo: "+repo)
msg(w, "version: "+version)
me.current.Status.IncrementRevisionVersion(comment)
return
}
if route == "/IncrementMinorVersion" {
repo := r.URL.Query().Get("repo")
version := r.URL.Query().Get("version")
msg(w, "repo: "+repo)
msg(w, "version: "+version)
me.current.Status.IncrementMinorVersion("trying minor")
return
}
if route == "/setTargetVersion" {
version := r.URL.Query().Get("version")
repo := r.URL.Query().Get("repo")
msg(w, "repo: "+repo)
msg(w, "version: "+version)
me.current.Status.SetTargetVersion(version)
return
}
if route == "/showNext" {
msg(w, "repo: "+me.release.repo.String())
msg(w, "name: "+me.release.version.String())
msg(w, "notes: "+me.release.notes.String())
msg(w, "status: "+me.release.status.String())
if checkValidGoSum(me.current) {
msg(w, "checkValidGoSum() == true")
} else {
msg(w, "checkValidGoSum() == false")
}
msg(w, me.current.StandardHeader())
msg(w, me.current.StandardReleaseHeader())
return return
} }