mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 18:20:27 +00:00
Merge pull request #89 from tomwilkie/build
Embed the git commit id in a go file and print it on startup.
This commit is contained in:
3
Makefile
3
Makefile
@@ -11,6 +11,7 @@ SCOPE_IMAGE=$(DOCKERHUB_USER)/scope
|
||||
SCOPE_EXPORT=scope.tar
|
||||
SCOPE_UI_BUILD_EXPORT=scope_ui_build.tar
|
||||
SCOPE_UI_BUILD_IMAGE=$(DOCKERHUB_USER)/scope-ui-build
|
||||
GIT_REVISION=$(shell git rev-parse HEAD)
|
||||
|
||||
all: $(SCOPE_EXPORT)
|
||||
|
||||
@@ -25,7 +26,7 @@ $(PROBE_EXE): probe/*.go report/*.go xfer/*.go
|
||||
|
||||
$(APP_EXE) $(PROBE_EXE):
|
||||
go get -tags netgo ./$(@D)
|
||||
go build -ldflags "-extldflags \"-static\"" -tags netgo -o $@ ./$(@D)
|
||||
go build -ldflags "-extldflags \"-static\" -X main.version $(GIT_REVISION)" -tags netgo -o $@ ./$(@D)
|
||||
|
||||
static: client/dist/scripts/bundle.js
|
||||
esc -o app/static.go -prefix client/dist client/dist
|
||||
|
||||
@@ -18,6 +18,9 @@ import (
|
||||
"github.com/weaveworks/scope/xfer"
|
||||
)
|
||||
|
||||
// Set during buildtime.
|
||||
var version = "unknown"
|
||||
|
||||
func main() {
|
||||
var (
|
||||
defaultProbes = []string{fmt.Sprintf("localhost:%d", xfer.ProbePort), fmt.Sprintf("scope.weave.local:%d", xfer.ProbePort)}
|
||||
@@ -63,7 +66,7 @@ func main() {
|
||||
defer os.Remove(*pidfile)
|
||||
}
|
||||
|
||||
log.Printf("starting")
|
||||
log.Printf("app starting, version %s", version)
|
||||
|
||||
// Collector deals with the probes, and generates merged reports.
|
||||
xfer.MaxBackoff = 10 * time.Second
|
||||
|
||||
@@ -18,6 +18,9 @@ import (
|
||||
"github.com/weaveworks/scope/xfer"
|
||||
)
|
||||
|
||||
// Set during buildtime.
|
||||
var version = "unknown"
|
||||
|
||||
func main() {
|
||||
var (
|
||||
httpListen = flag.String("http.listen", "", "listen address for HTTP profiling and instrumentation server")
|
||||
@@ -39,6 +42,8 @@ func main() {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
log.Printf("probe starting, version %s", version)
|
||||
|
||||
procspy.SetProcRoot(*procRoot)
|
||||
|
||||
if *httpListen != "" {
|
||||
|
||||
Reference in New Issue
Block a user