aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorrubo77 <github@r.z11.de>2017-07-24 09:19:14 +0200
committerrubo77 <github@r.z11.de>2017-07-24 09:19:14 +0200
commit1fab7b57024a5f160cc3c4ef8b43f91a9b09c531 (patch)
treece4d43321f5aadc820e4d82b2620cc137b38f313 /tests
parent8b2576583335361a61e304f54daaa6536b9d71bc (diff)
travis: validierung failt jetzt, wenn ein branch oder commit nicht existiert
Diffstat (limited to 'tests')
-rwxr-xr-xtests/validate_site.sh25
1 files changed, 15 insertions, 10 deletions
diff --git a/tests/validate_site.sh b/tests/validate_site.sh
index 566132c..d7334df 100755
--- a/tests/validate_site.sh
+++ b/tests/validate_site.sh
@@ -1,15 +1,16 @@
#!/bin/bash
# validate_site.sh checks if the site.conf is valid json
-
-GLUON_SITEDIR="." lua5.1 tests/site_config.lua
+GLUON_BRANCH='v2017.1.1'
P=$(pwd)
+echo "####### validating $P/site.conf ..."
+GLUON_SITEDIR="." lua5.1 tests/site_config.lua
-echo "validating $P/make-release.sh ..."
+echo "####### validating $P/make-release.sh ..."
bash -n $P/make-release.sh
-echo "validating $P/modules ..."
+echo "####### validating $P/modules ..."
source $P/modules
testpath=/tmp/site-validate
rm -Rf $testpath
@@ -35,20 +36,24 @@ for feed in $GLUON_SITE_FEEDS; do
echo "branch $branch_var missing"
exit 1
fi
- git clone $(echo $repo) $feed
+ git clone -b "$branch" --single-branch "$repo" $feed
+ if [ "$?" != "0" ]; then exit 1; fi
cd $feed
- git checkout $(echo $branch)
- git checkout $(echo $commit)
+ git checkout "$commit"
+ if [ "$?" != "0" ]; then exit 1; fi
cd -
done
cd $testpath
-git clone https://github.com/freifunk-gluon/gluon
+git init gluon
cd gluon
-git checkout v2017.1.1
+git remote add origin https://github.com/freifunk-gluon/gluon
+git config core.sparsecheckout true
+echo "package/*" >> .git/info/sparse-checkout
+git pull --depth=1 origin $GLUON_BRANCH
cp -a package/ $testpath/packages
cd $testpath/packages/package
-echo "validating GLUON_SITE_PACKAGES from $P/site.mk ..."
+echo "####### validating GLUON_SITE_PACKAGES from $P/site.mk ..."
# ignore standard packages:
sed '/GLUON_RELEASE/,$d' $P/site.mk | egrep -v '(#|G|iwinfo|iptables|haveged)'> $testpath/site.mk.sh
sed -i 's/\s\\$//g;/^$/d' $testpath/site.mk.sh