From ca7005705ec15ab1ae262bf3fe16b8b853c9cad1 Mon Sep 17 00:00:00 2001 From: foosinn Date: Mon, 25 May 2020 10:39:26 +0200 Subject: [PATCH] configurable cache repository and ttl (#36) --- plugin.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugin.sh b/plugin.sh index c547417..31e8cd3 100755 --- a/plugin.sh +++ b/plugin.sh @@ -42,6 +42,14 @@ if [[ "${PLUGIN_CACHE:-}" == "true" ]]; then CACHE="--cache=true" fi +if [ -n "${PLUGIN_CACHE_REPO:-}" ]; then + CACHE_REPO="--cache-repo=${REGISTRY}/${PLUGIN_CACHE_REPO}" +fi + +if [ -n "${PLUGIN_CACHE_TTL:-}" ]; then + CACHE_TTL="--cache-ttl=${PLUGIN_CACHE_TTL}" +fi + if [ -n "${PLUGIN_BUILD_ARGS:-}" ]; then BUILD_ARGS=$(echo "${PLUGIN_BUILD_ARGS}" | tr ',' '\n' | while read build_arg; do echo "--build-arg=${build_arg}"; done) fi @@ -94,6 +102,8 @@ fi ${EXTRA_OPTS} \ ${DESTINATIONS} \ ${CACHE:-} \ + ${CACHE_TTL:-} \ + ${CACHE_REPO:-} \ ${TARGET:-} \ ${BUILD_ARGS:-} \ ${BUILD_ARGS_FROM_ENV:-}