diff --git a/plugin.sh b/plugin.sh index 42593d9..75ec6d2 100755 --- a/plugin.sh +++ b/plugin.sh @@ -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:-}