-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (27 loc) · 736 Bytes
/
Makefile
File metadata and controls
37 lines (27 loc) · 736 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
33
34
35
36
37
.DEFAULT_GOAL := build
VERSION ?= $(shell ./hack/get-version.sh)
GO_IMG ?= golang:alpine3.20@sha256:1b455a3f7786e5765dbeb4f7ab32a36cdc0c3f4ddd35406606df612dc6e3269b
.PHONY: fmt vet build unit-test
DOCKER_CMD = docker run --rm -v $(PWD):/app -w /app ${GO_IMG}
## verify: Format code
fmt:
go fmt ./...
## verify: Verify code
vet: fmt
go vet ./...
## build: Build binary
build: vet
go build
## unit-test: Run unit tests
unit-test:
ifeq ($(USE_DOCKER), 1)
@${DOCKER_CMD} go test -v ./...
else
go test -v ./... ;
endif
## build-image: Build image
build-docker: vet
docker build -t numberly/vault-db-injector:${VERSION} .
## build-image: Push image
push-docker: build-docker
docker push numberly/vault-db-injector:${VERSION}