From 5666ec4b513053aa7b1ab02ac00dbff66983e71c Mon Sep 17 00:00:00 2001 From: liruichen Date: Thu, 7 Sep 2023 19:04:09 +0800 Subject: [PATCH] Revert "feat: add commit HASH to extra v2" This reverts commit cb8592a5670db115889bbcea0f5e296d8d072517. --- pkg/build/agent.tpl | 2 +- pkg/build/build.go | 1 - pkg/build/goenv.go | 7 ------- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/pkg/build/agent.tpl b/pkg/build/agent.tpl index 6421df3..cd10605 100644 --- a/pkg/build/agent.tpl +++ b/pkg/build/agent.tpl @@ -115,7 +115,7 @@ func register (host string) { time.Sleep(waitDelay) continue } - register_extra = os.Getenv("ECHO_APP_ID") + {{.CommitID}} + // 注册,直接将元信息放在 ws 地址中 v := url.Values{} v.Set("hostname", ps.hostname) diff --git a/pkg/build/build.go b/pkg/build/build.go index e0795e2..683a00f 100644 --- a/pkg/build/build.go +++ b/pkg/build/build.go @@ -50,7 +50,6 @@ type Build struct { Pkgs map[string]*Package GlobalCoverVarImportPath string GlobalCoverVarImportPathDir string - CommitID string } // NewBuild creates a Build struct diff --git a/pkg/build/goenv.go b/pkg/build/goenv.go index c723086..5368654 100644 --- a/pkg/build/goenv.go +++ b/pkg/build/goenv.go @@ -64,13 +64,6 @@ func (b *Build) readProjectMetaInfo() { // get GlobalCoverVarImportPath b.GlobalCoverVarImportPath = path.Join(b.ImportPath, TmpFolderName(b.CurModProjectDir)) log.Donef("project meta information parsed") - cmd := exec.Command("git", "describe", "--abbrev=8", "--always") - output, err := cmd.Output() - if err != nil { - log.Errorf("git describe Error:", err) - } else { - b.CommitID = string(output) - } } // displayProjectMetaInfo prints basic infomation of this project to stdout