-
Notifications
You must be signed in to change notification settings - Fork 64
/
makefile
54 lines (40 loc) · 1 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
GO111MODULE=on
.PHONY: build
build: bindata markdown-blog
.PHONY: docker-push
docker-push: package-all
docker buildx build --platform linux/arm64,linux/amd64 -t willgao/markdown-blog:latest . --push
.PHONY: docker-build
docker-build: package-all
docker build -t willgao/markdown-blog:dev -f ./Dockerfile.Develop .
.PHONY: bindata
bindata:
go install github.com/go-bindata/go-bindata/v3/go-bindata@latest
go generate ./...
.PHONY: markdown-blog
markdown-blog:
go build $(RACE) -o bin/markdown-blog ./
.PHONY: build-race
build-race: enable-race build
.PHONY: run
run: build
./bin/markdown-blog web --config ./config/config.yml
.PHONY: run-race
run-race: enable-race run
.PHONY: test
test:
go test $(RACE) ./...
.PHONY: test-race
test-race: enable-race test
.PHONY: enable-race
enable-race:
$(eval RACE = -race)
.PHONY: package
package: build
bash ./package.sh
.PHONY: package-all
package-all: build
bash ./package.sh -p 'linux darwin windows' -a 'amd64 arm64'
.PHONY: clean
clean:
rm bin/markdown-bolg