change how to handle the cache setting

This commit is contained in:
Myers Carpenter 2019-01-08 14:26:52 -05:00 committed by Nándor István Krácser
parent c89db83a59
commit 0eb7c2716d

View File

@ -21,10 +21,10 @@ DOCKERJSON
DOCKERFILE=${PLUGIN_DOCKERFILE:-Dockerfile}
CONTEXT=${PLUGIN_CONTEXT:-$PWD}
LOG=${PLUGIN_LOG:-info}
case "${PLUGIN_CACHE:-}" in
true) CACHE="true" ;;
*) CACHE="false" ;;
esac
if [[ "${PLUGIN_CACHE:-}" == "true" ]]; then
CACHE="--cache=true"
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)
@ -39,6 +39,6 @@ fi
/kaniko/executor -v ${LOG} \
--context=${CONTEXT} \
--dockerfile=${DOCKERFILE} \
--cache=${CACHE} \
${DESTINATIONS} \
${CACHE:-} \
${BUILD_ARGS:-}