btrfs-progs: ci: fix parameter parsing in image running scripts

There's an unconditional 'shift' in the scripts that will lead to an
error "cannot shift" and this would fail inside CI. We want an implicit
run on current HEAD so shift only when there are more parameters.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2023-04-12 18:24:10 +02:00
parent 9d3217b215
commit cb0bf52edc
6 changed files with 18 additions and 6 deletions

View file

@ -16,7 +16,9 @@ fi
CIIMAGEDIR=ci/images/ci-centos-7-x86_64
BRANCH=${1:-HEAD}
shift
if [ "$#" -ge 1 ]; then
shift
fi
HASH=$(git log -1 --format='%h %s' "$BRANCH")
echo "CI: Generate archive from $BRANCH ($HASH)"

View file

@ -16,7 +16,9 @@ fi
CIIMAGEDIR=ci/images/ci-centos-8-x86_64
BRANCH=${1:-HEAD}
shift
if [ "$#" -ge 1 ]; then
shift
fi
HASH=$(git log -1 --format='%h %s' "$BRANCH")
echo "CI: Generate archive from $BRANCH ($HASH)"

View file

@ -16,7 +16,9 @@ fi
CIIMAGEDIR=ci/images/ci-openSUSE-Leap-15.3-x86_64
BRANCH=${1:-HEAD}
shift
if [ "$#" -ge 1 ]; then
shift
fi
HASH=$(git log -1 --format='%h %s' "$BRANCH")
echo "CI: Generate archive from $BRANCH ($HASH)"

View file

@ -16,7 +16,9 @@ fi
CIIMAGEDIR=ci/images/ci-openSUSE-Leap-15.4-x86_64
BRANCH=${1:-HEAD}
shift
if [ "$#" -ge 1 ]; then
shift
fi
HASH=$(git log -1 --format='%h %s' "$BRANCH")
echo "CI: Generate archive from $BRANCH ($HASH)"

View file

@ -16,7 +16,9 @@ fi
CIIMAGEDIR=ci/images/ci-musl-x86_64
BRANCH=${1:-HEAD}
shift
if [ "$#" -ge 1 ]; then
shift
fi
HASH=$(git log -1 --format='%h %s' "$BRANCH")
echo "CI: Generate archive from $BRANCH ($HASH)"

View file

@ -16,7 +16,9 @@ fi
CIIMAGEDIR=ci/images/ci-openSUSE-tumbleweed-x86_64
BRANCH=${1:-HEAD}
shift
if [ "$#" -ge 1 ]; then
shift
fi
HASH=$(git log -1 --format='%h %s' "$BRANCH")
echo "CI: Generate archive from $BRANCH ($HASH)"