From e4c682f43dfb68d07fdc4bbae06cb8b5d728e7e3 Mon Sep 17 00:00:00 2001 From: Felix Bartels <1257835+fbartels@users.noreply.github.com> Date: Fri, 14 Aug 2020 10:40:59 +0200 Subject: [PATCH] Skip downloading of packages if folder already exists (#432) * Skip downloading of packages if folder already exists The base image is using onbuild instructions to reduce code duplication (in regards to fetching Kopano packages). Sadly the unbuild instructions are not only executed on the directly following container image, but in every image that is using the images from this project as a base. Fixes https://github.com/zokradonh/kopano-docker/issues/430 --- base/create-kopano-repo.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/base/create-kopano-repo.sh b/base/create-kopano-repo.sh index 09729fb..5ded39f 100755 --- a/base/create-kopano-repo.sh +++ b/base/create-kopano-repo.sh @@ -35,6 +35,11 @@ function dl_and_package_community { channel=${3:-community} branch=${4:-""} + if [ -d "$component" ]; then + echo "Packages have been downloaded in a previous stage. Skipping..." + return + fi + # query community server by h5ai API filename=$(h5ai_query "$component" "$distribution" "$channel" "$branch") filename2=$(basename "$filename")