-
Notifications
You must be signed in to change notification settings - Fork 21
/
Makefile
29 lines (23 loc) · 948 Bytes
/
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
GOFILES = $(shell find . -type f -name '*.go' -not -path "./.git/*")
LDFLAGS = '-s -w -extldflags "-static" -X github.com/gimlet-io/gimlet-cli/pkg/version.Version='${VERSION}
format:
@gofmt -w ${GOFILES}
.PHONY: test
test:
go test -timeout 60s $(shell go list ./...)
test-ui:
(cd web; npm ci; npm run test)
.PHONY: build
build:
CGO_ENABLED=0 go build -ldflags $(LDFLAGS) -o build/capacitor github.com/gimlet-io/capacitor/cmd/capacitor
.PHONY: dist
dist:
mkdir -p bin
GOOS=linux GOARCH=amd64 go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/linux/amd64/capacitor github.com/gimlet-io/capacitor/cmd/capacitor
GOOS=linux GOARCH=arm64 go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/linux/arm64/capacitor github.com/gimlet-io/capacitor/cmd/capacitor
.PHONY: build-ui
build-ui:
(cd web; npm ci; npm run build)
rm -rf cmd/capacitor/web/build
mkdir -p cmd/capacitor/web/build
@cp -r web/build/* cmd/capacitor/web/build