From 756beaf2953849a9eb85ada4dbf4f6064aae3aa0 Mon Sep 17 00:00:00 2001 From: Alexander Wellbrock <a.wellbrock@mailbox.org> Date: Fri, 15 Jan 2021 21:33:39 +0100 Subject: [PATCH] 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 --- resources/shell-tools/bin/push.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/shell-tools/bin/push.sh b/resources/shell-tools/bin/push.sh index 4bdd009..05e2c2a 100755 --- a/resources/shell-tools/bin/push.sh +++ b/resources/shell-tools/bin/push.sh @@ -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 "$@"' _ {} -- GitLab