forked from cloudfoundry/bosh-alicloud-cpi-release
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (36 loc) · 1.25 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
BINDIR := $(CURDIR)/bin
MAINDIR := bosh-alicloud-cpi
MAINFILE := $(CURDIR)/src/$(MAINDIR)/main/main.go
EXECUTABLE := $(BINDIR)/alicloud_cpi
GOFMT_FILES?=$$(find ./src/bosh-alicloud-cpi -name '*.go' | grep -v vendor)
GOPATH := $(CURDIR)
COMMIT = $(shell git rev-parse --short HEAD)
GO_OPTION ?=
ifeq ($(VERBOSE), 1)
GO_OPTIONS += -v
endif
# TODO add local link invocation
BUILD_OPTIONS = -a -ldflags "-X main.GitCommit=\"$(COMMIT)\""
all: clean fmt build
clean:
rm -f ${EXECUTABLE}
rm -f bin/bosh-alicloud-cpi.tgz
fmt:
gofmt -w $(GOFMT_FILES)
goimports -w $(GOFMT_FILES)
build:
mkdir -p $(BINDIR)
go build $(GO_OPTIONS) $(BUILD_OPTIONS) -o ${EXECUTABLE} $(MAINFILE)
testdeps:
go install bosh-alicloud-cpi/vendor/github.com/onsi/ginkgo/ginkgo
test: testdeps
ginkgo -r -skipPackage integration src/bosh-alicloud-cpi
integration: testdeps
ginkgo -r src/bosh-alicloud-cpi/integration
testintci: testdeps
ginkgo src/bosh-alicloud-cpi/integration -slowSpecThreshold=500 -progress -nodes=3 -randomizeAllSpecs -randomizeSuites $(GINKGO_ARGS) -v
create-release: build
bosh create-release --force --tarball=bin/bosh-alicloud-cpi.tgz
# upload-release: create-release
# scp bin/bosh-alicloud-cpi.tgz root@${CPI_UPLOAD_HOST}:/root
# rm -f bin/bosh-alicloud-cpi.tgz