configurable cache repository and ttl (#36)

This commit is contained in:
foosinn 2020-05-25 10:39:26 +02:00 committed by GitHub
parent 51aa742593
commit ca7005705e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -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:-}