-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
30 lines (22 loc) · 847 Bytes
/
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
.PHONY: all ci docker_build docker_retag docker_login docker_push
VERSION := 3.1.0
PROJECT_NAME ?= amneziavpn/amneziawg-exporter
DOCKER_BUILDKIT ?= 1
DOCKER_REGISTRY ?= docker.io
DOCKER_USER ?= none
DOCKER_PASSWORD ?= none
DOCKER_IMAGE ?= $(PROJECT_NAME)
DOCKER_TAG ?= latest
all: docker_build
ci: DOCKER_TAG=$(VERSION)
ci: docker_build docker_push
docker_build:
docker build . -t $(DOCKER_IMAGE):$(DOCKER_TAG) --build-arg VERSION=$(VERSION)
docker_retag:
docker tag $(DOCKER_IMAGE):$(DOCKER_TAG) $(DOCKER_IMAGE):latest
docker_login:
@echo "docker login -u ******* -p ******** $(DOCKER_REGISTRY)"
@docker login -u $(DOCKER_USER) -p $(DOCKER_PASSWORD) $(DOCKER_REGISTRY)
docker_push: docker_login docker_retag
docker push $(DOCKER_IMAGE):$(DOCKER_TAG)
docker push $(DOCKER_IMAGE):latest