1 ##############################################################################
2 # Copyright (c) 2019 AT&T, ENEA AB, Nokia and others #
4 # Licensed under the Apache License, Version 2.0 (the "License"); #
5 # you maynot use this file except in compliance with the License. #
7 # You may obtain a copy of the License at #
8 # http://www.apache.org/licenses/LICENSE-2.0 #
10 # Unless required by applicable law or agreed to in writing, software #
11 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT #
12 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
13 # See the License for the specific language governing permissions and #
14 # limitations under the License. #
15 ##############################################################################
17 export OS_VULS_DB?=/opt/akraino/validation/tests/os/vuls/db.tar.gz
19 .PHONY: .init_db_cache
21 if [ ! -f $(OS_VULS_DB) ]; then \
22 sudo mkdir -p $(dir $(OS_VULS_DB)); \
23 sudo chown $(shell id -u):$(shell id -g) $(dir $(OS_VULS_DB)); \
24 tar czf $(OS_VULS_DB) -T /dev/null; \
29 if [ -f $(OS_VULS_DB) ]; then \
30 echo DB cache file found, will be used during the build; \
33 tar czf $(notdir $(OS_VULS_DB)) -T /dev/null; \
35 date +%s > $(notdir $(OS_VULS_DB)).timestamp
38 all: push-image .push_manifest
44 push-image: .push_image
50 if [ -f $(OS_VULS_DB) ]; then \
51 echo DB cache file found, will be updated; \
52 docker run -v $(OS_VULS_DB):$(OS_VULS_DB).host \
53 --rm --entrypoint cp \
54 $(REGISTRY)/$(NAME):$(TAG_PRE)-$(HOST_ARCH)-$(TAG_VER) \
55 $(OS_VULS_DB) $(OS_VULS_DB).host; \
57 rm -f $(notdir $(OS_VULS_DB))*