diff options
| author | Jeff Carr <[email protected]> | 2025-07-07 19:02:32 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-07-07 19:02:32 -0500 |
| commit | e57f48e64994dabbd5c50173044f7d95f899c663 (patch) | |
| tree | f247efce97eb20c61318976c7729cd6107820992 | |
| parent | cba9b430649fb345352c58b7f64aa1d39e673796 (diff) | |
manual git mergev0.0.6
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | doPatchsets.go | 32 | ||||
| -rw-r--r-- | http.go | 14 | ||||
| -rw-r--r-- | main.go | 2 |
4 files changed, 41 insertions, 9 deletions
@@ -50,7 +50,7 @@ prod: build make stop cp forged /usr/bin/forged make start - make log + journalctl -n 10 -xeu forged.service goimports: reset diff --git a/doPatchsets.go b/doPatchsets.go index 2d70440..e696910 100644 --- a/doPatchsets.go +++ b/doPatchsets.go @@ -205,3 +205,35 @@ func lookupRepos(msg []byte) (*gitpb.Repos, error) { } return newpb, nil } +/* save the git.pb files ++ if repo.Namespace == "" { ++ log.Infof("repo: ERROR. no namespace. %s\n", repo.FullPath) ++ continue ++ } ++ ++ repopath := filepath.Join("/home/forge", repo.Namespace) ++ if !shell.IsDir(repopath) { ++ if err := os.MkdirAll(repopath, os.ModePerm); err != nil { ++ log.Warn("mkdir fail", repo.Namespace, err) ++ continue ++ } ++ } ++ ++ filename := filepath.Join(repopath, "git.pb") ++ if !shell.Exists(filename) { ++ data, err := repo.Marshal() ++ if err != nil { ++ log.Info("patchsets.Marshal() to wire failed", err) ++ continue ++ } ++ gitpbf, err := os.OpenFile(filename, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0666) ++ defer gitpbf.Close() ++ if err != nil { ++ log.Info("filename open error:", filename, err) ++ continue ++ } ++ gitpbf.Write(data) ++ } ++ ++ log.Infof("repo path: %s\n", repopath) +*/ @@ -49,14 +49,14 @@ func okHandler(w http.ResponseWriter, r *http.Request) { if err != nil { return } - // marshal the protobuf to xfer over the socket - data, err := found.Marshal() - if err != nil { - log.Info("repos.Marshal() to wire failed", err) - return - } - w.Write(data) + /* + for repo := range repos.IterAll() { + repo.Namespace += "good" + log.Infof("repo:%s,%s\n", repo.Namespace, repo.FullPath) + } + */ + found.SendPB(w) return } @@ -30,7 +30,7 @@ func main() { http.HandleFunc("/", okHandler) // go https() // use caddy instead p := fmt.Sprintf(":%d", argv.Port) - log.Println("HOSTNAME set to:", HOSTNAME) + log.Println(argv.Version(), "HOSTNAME set to:", HOSTNAME) log.Println("Running on port", "http://localhost"+p) log.Println("Running on port", "http://localhost"+p+"/ipv6.png") err := http.ListenAndServe(p, nil) |
