forked from tchen0123/supergiant
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (32 loc) · 1.45 KB
/
Makefile
File metadata and controls
43 lines (32 loc) · 1.45 KB
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
DOCKER_IMAGE_NAME := supergiant/control
DOCKER_IMAGE_TAG := $(shell git describe --tags --always | tr -d v || echo 'latest')
VERSION := $(shell git describe --always --long --dirty)
.PHONY: build test push release
fmt: gofmt goimports
gofmt:
@FLAGS="-w" build/gofmt.sh
goimports:
@FLAGS="-w -local github.com/supergiant/control" build/goimports.sh
lint:
# TODO: enable the test directory when e2e tests will be updated
build/gometalinter.sh
get-tools:
go get -u github.com/kardianos/govendor
go get -u github.com/alecthomas/gometalinter
gometalinter --install
build-image:
docker build -t $(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG) .
docker build -t $(DOCKER_IMAGE_NAME):latest .
test:
go test ./pkg/...
build:
go get -u github.com/hpcloud/tail/...
GOOS=linux CGO_ENABLED=0 GOARCH=amd64 go build -o dist/controlplane-linux -a -installsuffix cgo -ldflags='-extldflags "-static" -w -s -X main.version=${VERSION}' ./cmd/controlplane
GOOS=darwin CGO_ENABLED=0 GOARCH=amd64 go build -o dist/controlplane-osx -a -installsuffix cgo -ldflags='-extldflags "-static" -w -s -X main.version=${VERSION}' ./cmd/controlplane
GOOS=windows CGO_ENABLED=0 GOARCH=amd64 go build -o dist/controlplane-windows -a -installsuffix cgo -ldflags='-extldflags "-static" -w -s -X main.version=${VERSION}' ./cmd/controlplane
push:
docker push $(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)
release: build push
build-ui:
npm install --prefix ./cmd/ui/assets
npm run build --prefix ./cmd/ui/assets