forked from rancher-plugins/rancher-machine-driver-oci
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
50 lines (37 loc) · 863 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
NAME:=docker-machine-driver-oci
# local build, use user and timestamp it
BINARY_NAME ?= ${NAME}
VERSION:=$(shell date +%Y%m%d%H%M%S)
DIST_DIR:=dist
GO ?= go
.PHONY: all
all: build
#
# Go build related tasks
#
.PHONY: go-install
go-install:
GO111MODULE=on $(GO) install .
.PHONY: go-run
go-run: go-install
GO111MODULE=on $(GO) run .
.PHONY: go-fmt
go-fmt:
gofmt -s -e -d $(shell find . -name "*.go" | grep -v /vendor/)
.PHONY: go-vet
go-vet:
echo $(GO) vet $(shell $(GO) list ./... | grep -v /vendor/)
#
# Docker-related tasks
#
.PHONY: binary-build
binary-build:
mkdir -p ${DIST_DIR}
GO111MODULE=on GOOS=linux GOARCH=amd64 go build -o ${DIST_DIR}/${BINARY_NAME}-linux .
GO111MODULE=on GOOS=darwin GOARCH=amd64 go build -o ${DIST_DIR}/${BINARY_NAME}-darwin .
#
# Tests-related tasks
#
.PHONY: unit-test
unit-test: go-install
go test -v ./oke