Skip to content
Snippets Groups Projects
Verified Commit 756beaf2 authored by Alexander Wellbrock's avatar Alexander Wellbrock
Browse files

shell-tools: fix inaccessible pushImageOrManifest

The function has to be exported and used with bash -c here in order to
work with xargs.

See for more info:
https://stackoverflow.com/questions/11003418/calling-shell-functions-with-xargs
parent 48974403
No related branches found
No related tags found
No related merge requests found
Pipeline #5472 passed
......@@ -73,5 +73,6 @@ if [ "$CONTAINER_IMAGE_NAME" = "invalid" ]; then
printUsage
fi
export -f pushImageOrManifest
# shellcheck disable=SC2086
$CONTAINER_CMD images --format "{{.Repository}}:{{.Tag}}" "$CONTAINER_IMAGE_NAME" | grep "$CONTAINER_IMAGE_NAME" | xargs -L 1 pushImageOrManifest
$CONTAINER_CMD images --format "{{.Repository}}:{{.Tag}}" "$CONTAINER_IMAGE_NAME" | grep "$CONTAINER_IMAGE_NAME" | xargs -L 1 -I {} bash -c 'pushImageOrManifest "$@"' _ {}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment