This repository has been archived by the owner on Jul 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathMakefile
58 lines (48 loc) · 1.9 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
55
56
57
58
.PHONY: docker docs
VERSION ?= 2.0.10
build:
go build -buildvcs=false -trimpath -ldflags="-s -w -X 'github.com/craftcms/nitro/command/version.Version=${VERSION}'" -o nitro ./cmd/nitro
build-macos:
GOOS=darwin go build -buildvcs=false -trimpath -ldflags="-s -w -X 'github.com/craftcms/nitro/command/version.Version=${VERSION}'" -o nitro ./cmd/nitro
build-macos-arm:
GOOS=darwin GOARCH=arm64 go build -buildvcs=false -trimpath -ldflags="-s -w -X 'github.com/craftcms/nitro/command/version.Version=${VERSION}'" -o nitro ./cmd/nitro
build-api:
go build -buildvcs=false -trimpath -ldflags="-s -w -X 'github.com/craftcms/nitro/command/version.Version=${VERSION}'" -o nitrod ./cmd/nitrod
build-win:
GOOS="windows" go build -buildvcs=false -trimpath -ldflags="-s -w -X 'github.com/craftcms/nitro/command/version.Version=${VERSION}'" -o nitro.exe ./cmd/nitro
build-linux:
GOOS=linux go build -buildvcs=false -trimpath -ldflags="-s -w -X 'github.com/craftcms/nitro/command/version.Version=${VERSION}'" -o nitro ./cmd/nitro
build-linux-arm:
GOOS=linux GOARCH=arm64 go build -buildvcs=false -trimpath -ldflags="-s -w -X 'github.com/craftcms/nitro/command/version.Version=${VERSION}'" -o nitro ./cmd/nitro
mod:
go mod tidy && go mod verify
proxy:
docker build --build-arg NITRO_VERSION=${VERSION} -t craftcms/nitro-proxy:${VERSION} .
docs:
go run cmd/docs/main.go
local: build
mv nitro /usr/local/bin/nitro
local-win: build-win
mv nitro.exe "${HOME}"/Nitro/nitro.exe
local-linux: build
sudo mv nitro /usr/local/bin/nitro
local-prod: build upx
mv nitro /usr/local/bin/nitro
dev: rm docker init
rm:
docker container rm -f nitro-v2
init:
nitro init
test:
go test -v ./...
coverage:
go test -v ./... -coverprofile profile.out
go tool cover -html=profile.out
vet:
go vet ./...
releaser:
goreleaser --skip-publish --rm-dist --skip-validate
win-home:
mkdir "${HOME}"/Nitro
proto:
protoc protob/nitrod.proto --go_out=plugins=grpc:.