forked from drycc/pkg
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (26 loc) · 1.01 KB
/
Makefile
File metadata and controls
36 lines (26 loc) · 1.01 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
# Short name: Short name, following [a-zA-Z_], used all over the place.
# Some uses for short name:
# - Container image name
# - Kubernetes service, rc, pod, secret, volume names
REPO_PATH := github.com/drycc/pkg
DEV_ENV_IMAGE := ${DEV_REGISTRY}/drycc/go-dev
DEV_ENV_WORK_DIR := /opt/drycc/go/src/${REPO_PATH}
# Enable vendor/ directory support.
export GO15VENDOREXPERIMENT=1
# SemVer with build information is defined in the SemVer 2 spec, but Container
# doesn't allow +, so we use -.
VERSION := 0.0.1-$(shell date "+%Y%m%d%H%M%S")
# Common flags passed into Go's linker.
LDFLAGS := "-s -X main.version=${VERSION}"
PKG_DIRS := ./...
DEV_ENV_CMD := podman run --rm -v ${CURDIR}:${DEV_ENV_WORK_DIR} -w ${DEV_ENV_WORK_DIR} ${DEV_ENV_IMAGE}
bootstrap:
${DEV_ENV_CMD} go mod vendor
all: build test
build:
${DEV_ENV_CMD} go build ${PKG_DIRS}
test: build test-style
${DEV_ENV_CMD} go test -race -cover -coverprofile=coverage.txt -covermode=atomic ${PKG_DIRS}
test-style: bootstrap
${DEV_ENV_CMD} lint
.PHONY: all build test