This commit is contained in:
Jeffrey Paul 2022-12-08 20:52:38 +04:00
parent 4c345fc415
commit 0a5c99c9e0

View File

@ -5,12 +5,16 @@ ARCH := $(shell uname -m)
GITREV := $(shell git describe --always --dirty=-dirty) GITREV := $(shell git describe --always --dirty=-dirty)
D := $(HOME)/Documents/_SYSADMIN/docker/sneak/$(APPNAME) D := $(HOME)/Documents/_SYSADMIN/docker/sneak/$(APPNAME)
BRANCH := $(shell git branch --show-current) BRANCH := $(shell git branch --show-current)
RN := sneak/builder RN := sneak/builder
export DOCKER_IMAGE_CACHE_DIR := $(HOME)/Library/Caches/Docker/$(APPNAME)-$(ARCH) export DOCKER_IMAGE_CACHE_DIR := $(HOME)/Library/Caches/Docker/$(APPNAME)-$(ARCH)
.PHONY: default save build
default: save default: save
clean:
rm -v $(D)/*.tzst
build: deps/modcache.tar build: deps/modcache.tar
docker build \ docker build \
-t $(RN):$(GITREV) \ -t $(RN):$(GITREV) \
@ -28,7 +32,8 @@ $(D)/latest.tzst: $(D)/$(GITREV).tzst
rm -f $@ rm -f $@
ln -s $(D)/$(GITREV).tzst $@ ln -s $(D)/$(GITREV).tzst $@
$D/$(GITREV).tzst: $D/$(GITREV).tzst: build
docker image inspect $(RN):$(GITREV)
-mkdir -p "$(D)" -mkdir -p "$(D)"
docker save $(RN):$(GITREV) | pv | zstdmt -19 > $@.tmp docker save $(RN):$(GITREV) | pv | zstdmt -19 > $@.tmp
mv $@.tmp $@ mv $@.tmp $@