2019-02-01 09:58:07 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
. hooks/common
|
|
|
|
|
2019-10-15 00:53:36 +02:00
|
|
|
run_test() {
|
|
|
|
echo "🐳🐳🐳 Testing '${1}'"
|
|
|
|
VERSION="${1}" docker-compose run netbox ./manage.py test
|
|
|
|
docker-compose down -v
|
|
|
|
echo "🐳🐳🐳 Done testing '${1}'"
|
|
|
|
}
|
|
|
|
|
|
|
|
# test on builds of 'branches'
|
2019-10-15 00:47:19 +02:00
|
|
|
if [ "${BUILD}" == "branches" ] \
|
|
|
|
|| [ "${DEBUG}" == "true" ]; then
|
2019-10-15 00:53:36 +02:00
|
|
|
run_test latest
|
|
|
|
run_test snapshot
|
|
|
|
# test on bulds of 'this' (i.e. pull request)
|
|
|
|
elif [ "${BUILD}" == "this" ]; then
|
|
|
|
run_test latest
|
2019-02-01 09:58:07 +01:00
|
|
|
else
|
2019-10-10 12:42:10 +02:00
|
|
|
echo "🐳🐳🐳 No tests are implemented for build '${BUILD}'."
|
2019-02-01 09:58:07 +01:00
|
|
|
fi
|