File tree Expand file tree Collapse file tree 5 files changed +13
-8
lines changed Expand file tree Collapse file tree 5 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ builds:
28
28
- arm64
29
29
ldflags :
30
30
- -s -w
31
+ - -X github.com/megaease/easeprobe/global.Ver={{ .Tag }}
31
32
- -X github.com/megaease/easeprobe/pkg/version.RELEASE={{ .Tag }}
32
33
- -X github.com/megaease/easeprobe/pkg/version.COMMIT={{.Commit}}
33
34
- -X github.com/megaease/easeprobe/pkg/version.REPO=megaease/easeprobe
Original file line number Diff line number Diff line change @@ -9,7 +9,10 @@ MKFILE_DIR := $(dir $(MKFILE_PATH))
9
9
RELEASE_DIR := ${MKFILE_DIR}/build/bin
10
10
11
11
# Version
12
- RELEASE? =v0.1.0
12
+ RELEASE_VER := $(shell git describe --tag --abbrev=0)
13
+
14
+ # Go MOD
15
+ GO_MOD := $(shell go list -m)
13
16
14
17
# Git Related
15
18
GIT_REPO_INFO =$(shell cd ${MKFILE_DIR} && git config --get remote.origin.url)
@@ -27,7 +30,7 @@ all: ${TARGET}
27
30
${TARGET} : ${SOURCE}
28
31
mkdir -p ${RELEASE_DIR}
29
32
go mod tidy
30
- CGO_ENABLED=0 go build -a -ldflags ' -s -w -extldflags " -static" ' -o ${TARGET} github.com/megaease/easeprobe /cmd/easeprobe
33
+ CGO_ENABLED=0 go build -a -ldflags " -s -w -extldflags -static -X ${GO_MOD} /global.Ver= ${RELEASE_VER} " -o ${TARGET} ${GO_MOD} /cmd/easeprobe
31
34
32
35
build : all
33
36
Original file line number Diff line number Diff line change @@ -37,16 +37,19 @@ const (
37
37
Org = "MegaEase"
38
38
// DefaultProg is the program name
39
39
DefaultProg = "EaseProbe"
40
+ // DefaultIconURL is the default icon which used in Slack or Discord
41
+ DefaultIconURL = "https://megaease.com/favicon.png"
42
+ )
43
+
44
+ var (
40
45
// Ver is the program version
46
+ // It will be set by the build script
47
+ // go build -ldflags "-X github.com/megaease/easegress/pkg/global.Ver=1.0.0"
41
48
Ver = "v1.7.0"
42
-
43
49
//OrgProg combine organization and program
44
50
OrgProg = Org + " " + DefaultProg
45
51
//OrgProgVer combine organization and program and version
46
52
OrgProgVer = Org + " " + DefaultProg + "/" + Ver
47
-
48
- // DefaultIconURL is the default icon which used in Slack or Discord
49
- DefaultIconURL = "https://megaease.com/favicon.png"
50
53
)
51
54
52
55
const (
Original file line number Diff line number Diff line change @@ -162,7 +162,6 @@ func ToSlack(r probe.Result) string {
162
162
163
163
json := `
164
164
{
165
- "channel": "Alert",
166
165
"text": "%s",
167
166
"blocks": [
168
167
{
Original file line number Diff line number Diff line change @@ -277,7 +277,6 @@ func SLASlackSection(r *probe.Result) string {
277
277
func SLASlack (probers []probe.Prober ) string {
278
278
summary := SLASummary (probers )
279
279
json := `{
280
- "channel": "Report",
281
280
"text": "Overall SLA Report - ` + summary + ` ",
282
281
"blocks": [
283
282
{
You can’t perform that action at this time.
0 commit comments