add makefile targets

This commit is contained in:
bakito 2022-02-14 18:35:56 +01:00
parent 2703cad2be
commit ec458fd04a
No known key found for this signature in database
GPG key ID: FAF93C1C384DD6B4
2 changed files with 16 additions and 3 deletions

View file

@ -7,8 +7,7 @@ RUN apt-get update && apt-get install -y upx
ARG VERSION=main
ARG BUILD="N/A"
ENV GOPROXY=https://goproxy.io \
GO111MODULE=on \
ENV GO111MODULE=on \
CGO_ENABLED=0 \
GOOS=linux

View file

@ -33,4 +33,18 @@ endif
mockgen:
ifeq (, $(shell which mockgen))
$(shell go install github.com/golang/mock/mockgen@v1.6.0)
endif
endif
start-replica:
podman run --pull always --rm -it -p 9090:80 -p 9091:3000 adguard/adguardhome
check_defined = \
$(strip $(foreach 1,$1, \
$(call __check_defined,$1,$(strip $(value 2)))))
__check_defined = \
$(if $(value $1),, \
$(error Undefined $1$(if $2, ($2))))
build-image:
$(call check_defined, AGH_SYNC_VERSION)
podman build --build-arg VERSION=${AGH_SYNC_VERSION} --build-arg BUILD=$(shell date -u +'%Y-%m-%dT%H:%M:%S.%3NZ') -t ghcr.io/bakito/adguardhome-sync:${AGH_SYNC_VERSION} .