-
Notifications
You must be signed in to change notification settings - Fork 61
/
Makefile
51 lines (40 loc) · 1.15 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
GOOS=$(shell go env GOOS)
GOARCH=$(shell go env GOARCH)
ifeq ($(OS),Windows_NT)
uname_S := Windows
else
uname_S := $(shell uname -s)
endif
# Goreleaser config
ifeq ($(uname_S), Darwin)
goreleaser_config = .goreleaser.yml
else
goreleaser_config = .goreleaser.yml
endif
.PHONY: micro
micro:
./dist/micro_$(GOOS)_$(GOARCH)/bin/micro --profile starter-local server
.PHONY: example
example:
./dist/example_$(GOOS)_$(GOARCH)/bin/example --profile starter-local
.PHONY: release
release:
goreleaser release --config $(goreleaser_config) --skip-validate --skip-publish --rm-dist
.PHONY: snapshot
snapshot:
goreleaser release --config $(goreleaser_config) --skip-publish --snapshot --rm-dist
.PHONY: test
test:
go test -race -cover -v ./cmd/... ./service/... ./profile/... ./pkg/...
.PHONY: lint
lint:
golangci-lint run ./cmd/... ./service/... ./profile/... ./pkg/...
.PHONY: pack_build
pack_build:
pack build micro \
--builder paketobuildpacks/builder:tiny \
--descriptor manifests/buildpacks/project.toml \
--tag registry.cn-hangzhou.aliyuncs.com/hb-chen/micro-starter-micro:latest
.PHONY: run
run:
docker run micro --profile starter-local server