forked from chef/automate
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
39 lines (26 loc) · 1.02 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
include ../../Makefile.common_go
PACKAGE_PATH = github.com/chef/automate/components/session-service
BINS = ${PACKAGE_PATH}/cmd/session-service
VERSION = $$(git describe --always)
GO_LDFLAGS = --ldflags "-X ${PACKAGE_PATH}/version.Version=${VERSION}"
packages:=${PACKAGE_PATH}/...
all: lint build test
static: lint
unit: build test
${BINS}: bin
@echo "GO $@"
@cd bin; go build ${GO_LDFLAGS} $@
bin:
mkdir -p bin
build: ${BINS}
test:
@go test -v -count=1 $(packages) -cover
# this command lists all the changes since master, and looks for modifications
# to the migration files -- if there's any of (M)odify, (R)ename, or (D)elete,
# it will trigger an error
migrations-append-only-check:
@git diff --name-status master... | awk '/[RMD][0-9]*\tcomponents\/session-service\/migration\/sql\//{ print "modified/deleted/renamed: " $$2; ec=1 } END{ exit ec }'
# Regenerate all *.pb.go files
proto:
cd ../../ && hab studio run 'source .studiorc; compile_go_protobuf_component session-service'
.PHONY: all fmt test vet static unit