From c45de7be362259dee6e10fb7bb7157278f9679f0 Mon Sep 17 00:00:00 2001 From: Guillaume Lecerf Date: Tue, 29 Oct 2024 15:48:48 +0100 Subject: [PATCH] feat: no need to pull cache_from image --- src/scripts/build.sh | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/src/scripts/build.sh b/src/scripts/build.sh index df7c1e0..983d9b4 100644 --- a/src/scripts/build.sh +++ b/src/scripts/build.sh @@ -27,30 +27,12 @@ parse_tags_to_docker_arg() { DOCKER_TAGS_ARG="$(eval echo $docker_arg)" } -pull_images_from_cache() { - local cache - cache="$(eval echo $PARAM_CACHE_FROM)" - - echo "$cache" | sed -n 1'p' | tr ',' '\n' | while read -r image; do - echo "Pulling ${image}"; - docker pull ${image} || true - done -} - if ! parse_tags_to_docker_arg; then echo "Unable to parse provided tags." echo "Check your \"tag\" parameter or refer to the docs and try again: https://circleci.com/developer/orbs/orb/circleci/docker." exit 1 fi -if [ -n "$PARAM_CACHE_FROM" ]; then - if ! pull_images_from_cache; then - echo "Unable to pull images from the cache." - echo "Check your \"cache_from\" parameter or refer to the docs and try again: https://circleci.com/developer/orbs/orb/circleci/docker." - exit 1 - fi -fi - build_args=( "--file=$PARAM_DOCKERFILE_PATH/$PARAM_DOCKERFILE_NAME" ) @@ -62,7 +44,9 @@ if [ -n "$EXTRA_BUILD_ARGS" ]; then fi if [ -n "$PARAM_CACHE_FROM" ]; then - build_args+=("--cache-from=$PARAM_CACHE_FROM") + cache_from=$(eval echo $PARAM_CACHE_FROM) + + build_args+=("--cache-from=$cache_from") fi if [ -n "$PARAM_CACHE_TO" ]; then