beer/staging_tests.sh
kleph 86848b504f
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
[UI] Add favicon
2020-04-08 03:49:37 +02:00

24 lines
666 B
Bash

if [ ${BRANCH} == 'master' ]; then
TEST_URL='http://beer.k3s.kleph.eu'
else
TEST_URL='http://staging.beer.k3s.kleph.eu'
fi
echo "testing URL: ${TEST_URL}"
CURL_OPTS='-s'
# default
curl ${CURL_OPTS} ${TEST_URL} | grep -q 'setHours( 17, 0);'
[ $? -ne 0 ] && echo "Failed with default" && exit 1
# set 1 parameter
hours=18
curl ${CURL_OPTS} ${TEST_URL}/${hours} | grep -q "setHours( ${hours}, 0);"
[ $? -ne 0 ] && echo "Failed with 1 parameter set" && exit 1
# set 2 parameters
minutes=30
curl ${CURL_OPTS} ${TEST_URL}/${hours}/${minutes} | grep -q "setHours( ${hours}, ${minutes});"
[ $? -ne 0 ] && echo "Failed with 2 parameters set" && exit 1
echo "OK"
exit 0