33readonly THIS_SCRIPT=" $( readlink -f " ${BASH_SOURCE[0]} " ) "
44readonly BOOTSTRAP=" $( dirname " $THIS_SCRIPT " ) /resources/bootstrap.inc.sh"
55readonly BOOTSTRAP_VERSION=v1.0.10
6- [ -f " $BOOTSTRAP " ] && source " $BOOTSTRAP " || source <( curl -fs https://raw.githubusercontent.com/keymanapp/shared-sites/$BOOTSTRAP_VERSION /bootstrap.inc.sh)
6+ if ! [ -f " $BOOTSTRAP " ] || ! source " $BOOTSTRAP " ; then
7+ curl -H " Cache-Control: no-cache" --fail --silent --show-error -w " curl: Finished attempt to download %{url}" " https://raw.githubusercontent.com/keymanapp/shared-sites/$BOOTSTRAP_VERSION /bootstrap.inc.sh" -o " $BOOTSTRAP .tmp" || exit 1
8+ source " $BOOTSTRAP .tmp"
9+ rm -f " $BOOTSTRAP .tmp"
10+ fi
711# # END STANDARD SITE BUILD SCRIPT INCLUDE
812
913readonly API_KEYMAN_DB_CONTAINER_NAME=api-keyman-com-db
@@ -29,6 +33,9 @@ builder_describe \
2933 " stop" \
3034 " test" \
3135 " --rebuild-test-fixtures Rebuild the test fixtures from live data" \
36+ " --no-unit-test" \
37+ " --no-lint" \
38+ " --no-link-check" \
3239 " :db Build the database" \
3340 " :app Build the site"
3441
@@ -42,15 +49,22 @@ function test_docker_container() {
4249 touch rebuild-test-fixtures.txt
4350 fi
4451
45- # Run unit tests
46- docker exec $API_KEYMAN_CONTAINER_DESC sh -c " vendor/bin/phpunit --testdox"
52+ if ! builder_has_option --no-unit-test; then
53+ # Run unit tests
54+ # shellcheck disable=SC2154
55+ docker exec $API_KEYMAN_CONTAINER_DESC sh -c " vendor/bin/phpunit --testdox ${builder_extra_params[*]} "
56+ fi
4757
48- # Lint .php files for obvious errors
49- docker exec $API_KEYMAN_CONTAINER_DESC sh -c " find . -name '*.php' | grep -v '/vendor/' | xargs -n 1 -d '\\ n' php -l"
58+ if ! builder_has_option --no-lint; then
59+ # Lint .php files for obvious errors
60+ docker exec $API_KEYMAN_CONTAINER_DESC sh -c " find . -name '*.php' | grep -v '/vendor/' | xargs -n 1 -d '\\ n' php -l"
61+ fi
5062
51- # Check all internal links
52- # NOTE: link checker runs on host rather than in docker image
53- npx broken-link-checker http://localhost:8058 --ordered --recursive --host-requests 10 -e --filter-level 3
63+ if ! builder_has_option --no-link-check; then
64+ # Check all internal links
65+ # NOTE: link checker runs on host rather than in docker image
66+ npx broken-link-checker http://localhost:8058 --ordered --recursive --host-requests 10 -e --filter-level 3
67+ fi
5468
5569 rm tier.txt
5670}
0 commit comments