gitlab-ci: set up for srclibs lint

This commit is contained in:
Hans-Christoph Steiner 2020-05-27 18:44:20 +02:00
parent b9e9a077d7
commit e7c78b5ad1

View file

@ -21,12 +21,19 @@ lint:
- if [ "$CI_PROJECT_NAMESPACE" != "fdroid" ]; then
git fetch https://gitlab.com/fdroid/fdroiddata;
test -d build || mkdir build;
set -x;
for f in `git diff --name-only --diff-filter=d FETCH_HEAD...HEAD`; do
appid=`echo $f | sed -n -e 's,^metadata/\([^/][^/]*\)\.yml,\1,p'`;
export CHANGED="$CHANGED $appid";
grep -q "^Repo *Type\W *git$" $f && tail -1 $f | grep -qv '^NoSourceSince' && git -C build clone `sed -n "s,^Repo *:,,p" $f` $appid;
if [ -n "$appid" ]; then
export CHANGED="$CHANGED $appid";
testcmd="git -C build clone `sed -En 's,^Repo\W +(https?://),\1u:p@,p' $f`";
else
continue;
fi;
grep -q '^RepoType\W *git$' $f && tail -1 $f | grep -qv '^NoSourceSince:' && $testcmd;
done;
./tools/audit-gradle.py $CHANGED;
set +x;
fi
- export EXITVALUE=0
- fdroid lint -f $CHANGED || {