-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
34 lines (30 loc) · 1.11 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
.EXPORT_ALL_VARIABLES:
.DEFAULT_GOAL := default
DOCKER_SCAN_SUGGEST = false
CWD = $(shell pwd)
SRC_DIRS := .
GOCACHE ?= $$(pwd)/.go/cache
BUILD_VERSION=$(shell cat config.json | awk 'BEGIN { FS="\""; RS="," }; { if ($$2 == "version") {print $$4} }')
IMAGE ?= danielapatin/domru:${BUILD_VERSION}
export DOCKER_CLI_EXPERIMENTAL=enabled
.PHONY: build # Build the container image
build:
@docker buildx create --use --name=crossplat --node=crossplat && \
docker buildx build \
--build-arg="BUILD_VERSION=${BUILD_VERSION}" \
--output "type=docker,push=false" \
--tag $(IMAGE) \
--tag danielapatin/domru:latest \
.
.PHONY: publish # Push the image to the remote registry
publish:
@docker buildx create --use --name=crossplat --node=crossplat && \
docker buildx build \
--platform linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 \
--build-arg="BUILD_VERSION=${BUILD_VERSION}" \
--output "type=image,push=true" \
--tag $(IMAGE) \
--tag danielapatin/domru:latest \
.
lint:
@docker run --rm -t -w $(CWD) -v $(CURDIR):$(CWD) -e GOFLAGS=-mod=vendor golangci/golangci-lint:latest golangci-lint run -v