2017-08-16 15:50:02 +00:00
|
|
|
#!/usr/bin/env bash
|
2017-08-31 18:42:19 +00:00
|
|
|
## Test script for Travis CI integration
|
2017-08-16 15:50:02 +00:00
|
|
|
##
|
|
|
|
## Copyright (c) 2012-2014 Sylvain Benner
|
2018-05-19 20:42:12 +00:00
|
|
|
## Copyright (c) 2014-2018 Sylvain Benner & Contributors
|
2017-08-16 15:50:02 +00:00
|
|
|
##
|
|
|
|
## Author: Eugene Yaremenko
|
|
|
|
## URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
##
|
|
|
|
## This file is not part of GNU Emacs.
|
|
|
|
##
|
|
|
|
## License: GPLv3
|
|
|
|
|
2018-05-19 20:42:12 +00:00
|
|
|
echo_headline () {
|
2017-08-16 15:50:02 +00:00
|
|
|
printf '=%.0s' {1..70}
|
2018-05-19 20:42:12 +00:00
|
|
|
printf "\n$1\n"
|
2017-08-16 15:50:02 +00:00
|
|
|
printf '=%.0s' {1..70}
|
2018-05-19 20:42:12 +00:00
|
|
|
echo
|
|
|
|
}
|
|
|
|
|
2018-05-23 01:17:55 +00:00
|
|
|
echo_headline "CHECKING FOR MISPLACED SPACES AND TABS:"
|
|
|
|
git diff --check --color > /tmp/space_test_result
|
|
|
|
if [[ -s /tmp/space_test_result ]]; then
|
|
|
|
echo_headline "PLEASE FIX ISSUES BELOW:"
|
|
|
|
cat /tmp/space_test_result
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
echo "Done."
|
|
|
|
|
2018-05-19 20:42:12 +00:00
|
|
|
echo_headline "FORMATTING DOCUMENTATION:"
|
|
|
|
docker run --rm -v "${TRAVIS_BUILD_DIR}":/tmp/docs/ \
|
|
|
|
jare/spacedoc format /tmp/docs/
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo "Formatting failed."
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
|
|
|
git diff --color HEAD > /tmp/spacefmt_result
|
|
|
|
if [[ -s /tmp/spacefmt_result ]]; then
|
|
|
|
echo_headline "PLEASE APPLY CHANGES BELOW:"
|
|
|
|
cat /tmp/spacefmt_result
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
2018-05-23 01:06:41 +00:00
|
|
|
echo_headline "TESTING DOCUMENTATION WITH SDN EXPORT:"
|
2018-05-19 20:42:12 +00:00
|
|
|
docker run --rm -v "${TRAVIS_BUILD_DIR}":/tmp/docs/ \
|
|
|
|
-v /tmp/sdn-files/:/tmp/export/ \
|
|
|
|
jare/spacedoc export /tmp/docs/
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo "Exporting failed."
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
2018-05-23 01:06:41 +00:00
|
|
|
echo_headline "VALIDATING DOCUMENTATION:"
|
2018-05-19 20:42:12 +00:00
|
|
|
docker run --rm -v /tmp/sdn-files/:/tmp/sdn-files/ \
|
2018-05-23 01:14:58 +00:00
|
|
|
jare/spacedoc validate /tmp/sdn-files/
|
2018-05-19 20:42:12 +00:00
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo "Validation failed."
|
|
|
|
exit 2
|
2017-08-16 15:50:02 +00:00
|
|
|
fi
|
2018-05-19 20:42:12 +00:00
|
|
|
echo "Done."
|