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

View File

@ -42,6 +42,14 @@ if [[ "${PLUGIN_CACHE:-}" == "true" ]]; then
CACHE="--cache=true" CACHE="--cache=true"
fi 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 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) BUILD_ARGS=$(echo "${PLUGIN_BUILD_ARGS}" | tr ',' '\n' | while read build_arg; do echo "--build-arg=${build_arg}"; done)
fi fi
@ -94,6 +102,8 @@ fi
${EXTRA_OPTS} \ ${EXTRA_OPTS} \
${DESTINATIONS} \ ${DESTINATIONS} \
${CACHE:-} \ ${CACHE:-} \
${CACHE_TTL:-} \
${CACHE_REPO:-} \
${TARGET:-} \ ${TARGET:-} \
${BUILD_ARGS:-} \ ${BUILD_ARGS:-} \
${BUILD_ARGS_FROM_ENV:-} ${BUILD_ARGS_FROM_ENV:-}