File tree Expand file tree Collapse file tree 2 files changed +8
-17
lines changed
Expand file tree Collapse file tree 2 files changed +8
-17
lines changed Original file line number Diff line number Diff line change 11ver =0.2.0
2- bindir =bin
3- container_cli =docker
2+ bin_dir =bin
43cmd_dir =./cmd/tpl/
4+ container_cli =docker
55
66ldflags =-X 'main.version=$(ver ) ' -X 'main.commit=$(shell git rev-parse HEAD) '
77
88binaries : bindir dynmaic static
99
1010dynmaic :
11- go build -ldflags=" $( ldflags) " -a -o tpl-$(ver ) -amd64 $(cmd_dir )
12- tar -czf tpl-amd64.tar.gz tpl-$(ver ) -amd64
13- mv tpl-amd64.tar.gz bin/
14- rm tpl-$(ver ) -amd64
11+ go build -ldflags=" $( ldflags) " -a -o $(bin_dir ) /tpl-linux-amd64 $(cmd_dir )
1512
1613static :
17- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags=" $( ldflags) " -a -o tpl-$(ver ) -amd64-static $(cmd_dir )
18- tar -czf tpl-amd64-static.tar.gz tpl-$(ver ) -amd64-static
19- mv tpl-amd64-static.tar.gz bin/
20- rm tpl-$(ver ) -amd64-static
14+ CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags=" $( ldflags) " -a -o $(bin_dir ) /tpl-linux-amd64-static $(cmd_dir )
2115
2216bindir :
23- rm -rf $(bindir )
24- mkdir -p $(bindir )
17+ rm -rf $(bin_dir )
18+ mkdir -p $(bin_dir )
2519
2620image :
2721 $(container_cli ) build --file assets/container/Dockerfile --build-arg ldflags=" $( ldflags) " -t bluebrown/tpl -t bluebrown/tpl:$(ver ) .
3125 $(container_cli ) push bluebrown/tpl:$(ver )
3226
3327install : binaries
34- tar -xzf bin/tpl-amd64.tar.gz
35- sudo mv tpl-$(ver ) -amd64 /usr/local/bin/tpl
28+ sudo mv $(bin_dir ) /tpl-linux-amd64 /usr/local/$(bin_dir ) /tpl
3629
3730
3831.PHONY : binaries dynamic static bindir image push install
Original file line number Diff line number Diff line change @@ -78,9 +78,7 @@ Next to the builtin functions, sSprig functions](http://masterminds.github.io/sp
7878Download the binary from the [ release page] ( https://github.com/bluebrown/go-template-cli/releases ) . For example
7979
8080``` bash
81- curl -fsSLO https://github.com/bluebrown/go-template-cli/releases/download/v0.1.1/tpl-amd64-static.tar.gz
82- tar -xzf tpl-amd64-static.tar.gz
83- mv tpl-0.1.1-amd64-static /usr/local/bin/tpl
81+ curl -fsSL https://github.com/bluebrown/go-template-cli/releases/latest/download/tpl-linux-amd64 > tpl
8482```
8583
8684### Go
You can’t perform that action at this time.
0 commit comments