forked from ketchuphq/ketchup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (49 loc) · 1.34 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
59
60
61
62
# shell is set so new path is picked up
SHELL := /bin/bash
export PATH := $(shell go env GOPATH)/bin:$(PATH)
GO_DIRS := $(shell find . -name "*.go" -exec dirname {} \; | grep -v vendor | grep -v proto | sort -u)
dev:
make -C admin
go build .
osx: admin build-darwin
linux: admin build-linux
admin:
make -C admin production
build-%:
GOOS=$* GOARCH=amd64 go build \
-ldflags="-s -w" \
-gcflags=-trimpath=$$GOPATH \
-asmflags=-trimpath=$$GOPATH \
.
release: goreleaser.yml admin
goreleaser
release-nr: goreleaser.yml admin
goreleaser --skip-publish
goreleaser.yml:
@cat ./goreleaser.yml.tmpl \
| sed -e "s,{GOPATH},$$GOPATH,g" \
> goreleaser.yml
include make/*.mk
prepare: prepare-admin prepare-vendor
prepare-admin:
make -C admin prepare
prepare-vendor:
go get -u github.com/kardianos/govendor
govendor sync
goimports:
@goimports -w -local github.com/ketchuphq/ketchup $(GO_DIRS)
test:
@go test $(GO_DIRS)
integration:
@go test -tags integration $(GO_DIRS)
cover:
@go get -u github.com/go-playground/overalls
overalls -project github.com/ketchuphq/ketchup -- -tags integration
@find . -name 'profile.coverprofile' | xargs rm
circle-cover: cover
@go get -u github.com/mattn/goveralls
@goveralls \
-coverprofile=overalls.coverprofile \
-service=circle-ci \
-repotoken=$$COVERALLS_TOKEN
.PHONY: admin goreleaser.yml