File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 2
2
3
3
OUTPUT = ecs-task
4
4
OUTDIR = bin
5
- BUILD_CMD = go build -a -tags netgo -installsuffix netgo --ldflags '-extldflags "-static"'
5
+ BUILD_CMD = go build -a -tags netgo -installsuffix netgo -ldflags \
6
+ " \
7
+ -extldflags '-static' \
8
+ -X github.com/h3poteto/ecs-task/cmd.version=$(shell git describe --tag --abbrev=0) \
9
+ -X github.com/h3poteto/ecs-task/cmd.revision=$(shell git rev-list -1 HEAD) \
10
+ -X github.com/h3poteto/ecs-task/cmd.build=$(shell git describe --tags) \
11
+ "
6
12
ARCHITECTURE = amd64 arm64
7
- VERSION = v1.0.0
13
+ VERSION = $( shell git describe --tag --abbrev=0)
8
14
9
15
all : mac linux windows
10
16
Original file line number Diff line number Diff line change @@ -6,12 +6,20 @@ import (
6
6
"github.com/spf13/cobra"
7
7
)
8
8
9
+ var (
10
+ version string
11
+ revision string
12
+ build string
13
+ )
14
+
9
15
func versionCmd () * cobra.Command {
10
16
cmd := & cobra.Command {
11
17
Use : "version" ,
12
18
Short : "Print the version number" ,
13
19
Run : func (cmd * cobra.Command , args []string ) {
14
- fmt .Println ("ecs-task v0.2.7" )
20
+ fmt .Printf ("Version : %s\n " , version )
21
+ fmt .Printf ("Revision: %s\n " , revision )
22
+ fmt .Printf ("Build : %s\n " , build )
15
23
},
16
24
}
17
25
You can’t perform that action at this time.
0 commit comments