allow for multiple tags

This commit is contained in:
Myers Carpenter 2019-01-07 19:46:57 -05:00 committed by Nándor István Krácser
parent 4981f60ed9
commit 5b35b92963
1 changed files with 7 additions and 2 deletions

View File

@ -19,7 +19,6 @@ cat > /kaniko/.docker/config.json <<DOCKERJSON
DOCKERJSON
DOCKERFILE=${PLUGIN_DOCKERFILE:-Dockerfile}
DESTINATION=${PLUGIN_REPO}:${PLUGIN_TAGS:-latest}
CONTEXT=${PLUGIN_CONTEXT:-$PWD}
LOG=${PLUGIN_LOG:-info}
case "${PLUGIN_CACHE:-}" in
@ -31,9 +30,15 @@ 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
if [[ -n "${PLUGIN_TAGS:-}" ]]; then
DESTINATIONS=$(echo "${PLUGIN_TAGS}" | tr ',' '\n' | while read tag; do echo "--destination=${PLUGIN_REPO}:${tag} "; done)
else
DESTINATIONS="--destination=${PLUGIN_REPO}:latest"
fi
/kaniko/executor -v ${LOG} \
--context=${CONTEXT} \
--dockerfile=${DOCKERFILE} \
--destination=${DESTINATION} \
--cache=${CACHE} \
${DESTINATIONS} \
${BUILD_ARGS:-}