Do not trigger CI Pipeline during branching
Tally revisions and invoke ci-obs-upload accordingly
So, gitlab allows script execution to be clubbed together as a
single invocation. Hence, we invoke tally-revision script which will
return a 1 when the HEAD revision is same to the apertis/tags, thus
avoiding the invocation of ci-obs-upload script
2 cases where it will return a 0 and invoke ci-obs-upload script are:
* When the repository has no apertis/tags, which will be the case when
we are bringing in a new package
* When the revision of any of the apertis/tags do not match with HEAD
Signed-off-by: Ritesh Raj Sarraf <ritesh.sarraf@collabora.com>
The tally-revision
scripts which should be part of apertis-package-source-builder
image
$ cat tally-revision
#!/bin/sh
set -e
HEAD=$(git rev-parse -q --verify HEAD)
TAGS=$(git tag -l apertis/*)
FOUND=1
if [ -z "$TAGS" ]; then
echo "No tags found but we can be a new package"
FOUND=0
else
for tag in $TAGS;
do
check_tag=$(git rev-parse -q --verify $tag)
if [ "$check_tag" != "$HEAD" ]; then
FOUND=0
fi
done
fi
return $FOUND
Edited by Ritesh Raj Sarraf