Rewrite dry-run part
This commit is contained in:
parent
f7228fa8c5
commit
a26d467bf7
1 changed files with 6 additions and 6 deletions
12
plugin.sh
12
plugin.sh
|
@ -109,18 +109,18 @@ if [ -n "${PLUGIN_MIRRORS:-}" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DESTINATIONS=""
|
DESTINATIONS=""
|
||||||
if [ -n "${PLUGIN_TAGS:-}" ]; then
|
if [ "${PLUGIN_DRY_RUN:-}" == "true" ] || [ -z "${PLUGIN_REPO:-}" ]; then
|
||||||
|
DESTINATIONS="--no-push"
|
||||||
|
# Cache is not valid with --no-push
|
||||||
|
CACHE=""
|
||||||
|
elif [ -n "${PLUGIN_TAGS:-}" ]; then
|
||||||
DESTINATIONS=$(echo "${PLUGIN_TAGS}" | tr ',' '\n' | while read tag; do echo "--destination=${REGISTRY}/${PLUGIN_REPO}:${tag} "; done)
|
DESTINATIONS=$(echo "${PLUGIN_TAGS}" | tr ',' '\n' | while read tag; do echo "--destination=${REGISTRY}/${PLUGIN_REPO}:${tag} "; done)
|
||||||
elif [ -f .tags ]; then
|
elif [ -f .tags ]; then
|
||||||
for tag in $(sed -e 's/,\s*/ /g' .tags); do
|
for tag in $(sed -e 's/,\s*/ /g' .tags); do
|
||||||
DESTINATIONS=$(concatenate_strings "${DESTINATIONS}" "--destination=${REGISTRY}/${PLUGIN_REPO}:${tag}")
|
DESTINATIONS=$(concatenate_strings "${DESTINATIONS}" "--destination=${REGISTRY}/${PLUGIN_REPO}:${tag}")
|
||||||
done
|
done
|
||||||
elif [ -n "${PLUGIN_REPO:-}" ] && [ "${PLUGIN_DRY_RUN:-}" != "true" ]; then
|
elif [ -n "${PLUGIN_REPO:-}" ]; then
|
||||||
DESTINATIONS="--destination=${REGISTRY}/${PLUGIN_REPO}:latest"
|
DESTINATIONS="--destination=${REGISTRY}/${PLUGIN_REPO}:latest"
|
||||||
else
|
|
||||||
DESTINATIONS="--no-push"
|
|
||||||
# Cache is not valid with --no-push
|
|
||||||
CACHE=""
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${PLUGIN_IGNORE_VAR_RUN:-}" == "false" ]]; then
|
if [[ "${PLUGIN_IGNORE_VAR_RUN:-}" == "false" ]]; then
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue