aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrubo77 <github@r.z11.de>2018-11-16 22:19:03 +0100
committerrubo77 <github@r.z11.de>2018-11-26 12:39:48 +0100
commit1e7dfbf17268c6a31af11358a9b79b7c143038ea (patch)
treed5a019f3d38bc83bc82547426572a09aeb4ca700
parented4374495d0664a7e8eea9e2674a46015d87d011 (diff)
new lua site check and enhannce output of tests/validate.sh
[skip ci]
-rw-r--r--tests/site_config.lua7
-rwxr-xr-xtests/validate_site.sh22
2 files changed, 22 insertions, 7 deletions
diff --git a/tests/site_config.lua b/tests/site_config.lua
index d7bdc1f..2ac95de 100644
--- a/tests/site_config.lua
+++ b/tests/site_config.lua
@@ -1,9 +1,10 @@
-local config = os.getenv('GLUON_SITEDIR')
+local site = os.getenv('GLUON_SITEDIR') .. '/'
+local config = os.getenv('GLUON_SITE_CONFIG')
local function loader()
coroutine.yield('return ')
- coroutine.yield(io.open(config .. '/site.conf'):read('*a'))
+ coroutine.yield(io.open(site..config):read('*a'))
end
-- setfenv doesn't work with Lua 5.2 anymore, but we're using 5.1
-return setfenv(assert(load(coroutine.wrap(loader), 'site.conf')), {})()
+return setfenv(assert(load(coroutine.wrap(loader), config)), {})()
diff --git a/tests/validate_site.sh b/tests/validate_site.sh
index 508b210..d184217 100755
--- a/tests/validate_site.sh
+++ b/tests/validate_site.sh
@@ -8,20 +8,34 @@ GLUON_PACKAGES_REPO="https://github.com/freifunk-gluon/packages"
GLUON_PACKAGES_BRANCH='master'
P="$(pwd)"
-echo "####### validating $P/site.conf ..."
+echo "####### check if lua5.1 is installed ..."
which lua5.1
if [ "$?" == 1 ]; then
echo lua5.1 not present!
echo install with sudo apt install lua5.1
exit 1
fi
-GLUON_SITEDIR="." lua5.1 tests/site_config.lua
-if [ "$?" == 1 ]; then
- exit 1
+CONFIGS="site.conf"
+if [ -d "domains" ]; then
+ CONFIGS="$CONFIGS "domains/*
fi
+for c in $CONFIGS; do
+ echo "####### validating lua $c ..."
+ GLUON_SITEDIR="." GLUON_SITE_CONFIG="$c" lua5.1 tests/site_config.lua
+ if [ "$?" == 1 ]; then
+ exit 1
+ else
+ echo "OK: $c"
+ fi
+done
+#GLUON_SITEDIR="./" GLUON_SITE_CONFIG="" lua5.1 tests/site_config.lua
+
echo "####### validating $P/make-release.sh ..."
bash -n "$P/make-release.sh"
+if [ "$?" == 0 ]; then
+ echo "OK: $P/make-release.sh"
+fi
echo "####### validating $P/modules ..."
GLUON_SITE_FEEDS="none"