-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (25 loc) · 849 Bytes
/
Makefile
File metadata and controls
35 lines (25 loc) · 849 Bytes
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
SERVICE_NAME = $(notdir $(CURDIR))
LATEST_TAG = vnext
VERSION_TAG = vnext-$(shell git rev-parse --short=7 --verify HEAD)
default: build
define build-docker-image
docker build \
--network=host \
--tag ocfcloud/$(SERVICE_NAME):$(VERSION_TAG) \
--tag ocfcloud/$(SERVICE_NAME):$(LATEST_TAG) \
--target $(1) \
.
endef
build-testcontainer:
$(call build-docker-image,build)
build: build-testcontainer
test: clean build-testcontainer
# sudo echo 'net.ipv4.ip_unprivileged_port_start=0' > /etc/sysctl.d/50-unprivileged-ports.conf
# sysctl --system
docker run \
--network=host \
--mount type=bind,source="$(shell pwd)",target=/shared \
ocfcloud/$(SERVICE_NAME):$(VERSION_TAG) \
go test -v ./... -covermode=atomic -coverprofile=/shared/coverage.txt
clean:
.PHONY: build-testcontainer build-servicecontainer build test push clean