X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=docker%2Fos%2FMakefile;h=5e5386b0c1290f8f661372e21be9ff530492fcd3;hb=473b026700468523d993927eb5282c8ae962d3b7;hp=a5b4099bf1a43686b19a122708b2f115afe0c976;hpb=fd66f87da2126736bb80ee3c3ffbde0e37eac15b;p=validation.git diff --git a/docker/os/Makefile b/docker/os/Makefile index a5b4099..5e5386b 100644 --- a/docker/os/Makefile +++ b/docker/os/Makefile @@ -14,10 +14,44 @@ # limitations under the License. # ############################################################################## +export OS_VULS_DB?=/opt/akraino/validation/tests/os/vuls/db.tar.gz + +.PHONY: .init_db_cache +.init_db_cache: + if [ ! -f $(OS_VULS_DB) ]; then \ + sudo mkdir -p $(dir $(OS_VULS_DB)); \ + sudo chown $(shell id -u):$(shell id -g) $(dir $(OS_VULS_DB)); \ + tar czf $(OS_VULS_DB) -T /dev/null; \ + fi + +.PHONY: .build +.build:: + if [ -f $(OS_VULS_DB) ]; then \ + echo DB cache file found, will be used during the build; \ + cp $(OS_VULS_DB) .; \ + else \ + tar czf $(notdir $(OS_VULS_DB)) -T /dev/null; \ + fi + date +%s > $(notdir $(OS_VULS_DB)).timestamp + .PHONY: all -all: .push_image .push_manifest +all: push-image .push_manifest .PHONY: build build: .build +.PHONY: push-image +push-image: .push_image + include ../build.mk + +.PHONY: .build +.build:: + if [ -f $(OS_VULS_DB) ]; then \ + echo DB cache file found, will be updated; \ + docker run -v $(OS_VULS_DB):$(OS_VULS_DB).host \ + --rm --entrypoint cp \ + $(REGISTRY)/$(NAME):$(TAG_PRE)-$(HOST_ARCH)-$(TAG_VER) \ + $(OS_VULS_DB) $(OS_VULS_DB).host; \ + fi + rm -f $(notdir $(OS_VULS_DB))*