-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (31 loc) · 1.09 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
VERSION ?= $(shell git describe --tags)
DOCKER_VERSION ?= $(VERSION)
GIT_COMMIT = $(strip $(shell git rev-parse --short HEAD))
DOCKER_PREFIX ?= "ghcr.io/drivenet/cloudprober-ocsp"
DOCKER_IMAGE ?= $(DOCKER_PREFIX)/cloudprober
test:
go test -v -race -covermode=atomic ./...
docker_build: deps protoc Dockerfile
docker buildx build \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg VERSION=$(VERSION) \
--build-arg VCS_REF=$(GIT_COMMIT) \
-t $(DOCKER_IMAGE) .
docker_push:
docker login -u "${DOCKER_USER}" -p "${DOCKER_PASS}" ${DOCKER_REGISTRY}
docker push $(DOCKER_IMAGE):latest
docker_push_tagged:
docker tag $(DOCKER_IMAGE) $(DOCKER_IMAGE):$(DOCKER_VERSION)
docker login -u "${DOCKER_USER}" -p "${DOCKER_PASS}" ${DOCKER_REGISTRY}
docker push $(DOCKER_IMAGE):$(DOCKER_VERSION)
docker_release: docker_build docker_push_tagged docker_push
# Dependencies
deps:
@go mod tidy -v
@go mod vendor
protoc: LIBS:=""
protoc:
find . -type f -name '*.proto' -not -path './vendor/*' \
-exec protoc \
--proto_path=$(GOPATH)/src:./vendor:. \
--go_out=paths=source_relative:. '{}' \;