|
2 | 2 | ## START STANDARD SITE BUILD SCRIPT INCLUDE |
3 | 3 | readonly THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" |
4 | 4 | readonly BOOTSTRAP="$(dirname "$THIS_SCRIPT")/resources/bootstrap.inc.sh" |
5 | | -readonly BOOTSTRAP_VERSION=v1.0.7 |
| 5 | +readonly BOOTSTRAP_VERSION=v1.08 |
6 | 6 | [ -f "$BOOTSTRAP" ] && source "$BOOTSTRAP" || source <(curl -H "Cache-Control: no-cache" -fs https://raw.githubusercontent.com/keymanapp/shared-sites/$BOOTSTRAP_VERSION/bootstrap.inc.sh) |
7 | 7 | ## END STANDARD SITE BUILD SCRIPT INCLUDE |
8 | 8 |
|
@@ -31,21 +31,38 @@ builder_parse "$@" |
31 | 31 | function test_docker_container() { |
32 | 32 | # Note: ci.yml replicates these |
33 | 33 |
|
34 | | - # Run unit tests |
| 34 | + echo "TIER_TEST" > tier.txt |
| 35 | + set +e; |
| 36 | + set +o pipefail; |
| 37 | + |
| 38 | + builder_echo blue "---- PHP unit tests" |
35 | 39 | docker exec $HELP_CONTAINER_DESC sh -c "vendor/bin/phpunit --testdox" |
36 | 40 |
|
37 | 41 | # Lint .php files for obvious errors |
| 42 | + builder_echo blue "---- Lint PHP files" |
38 | 43 | docker exec $HELP_CONTAINER_DESC sh -c "find . -name '*.php' | grep -v '/vendor/' | xargs -n 1 -d '\\n' php -l" |
39 | 44 |
|
40 | 45 | # Check all internal links |
41 | 46 | # NOTE: link checker runs on host rather than in docker image |
42 | | - npx broken-link-checker http://localhost:8055 --ordered --recursive --host-requests 10 -e --filter-level 3 |
| 47 | + builder_echo blue "---- Testing links" |
| 48 | + npx broken-link-checker http://localhost:8055 --recursive --ordered ---host-requests 50 -e --filter-level 3 | tee blc.log |
| 49 | + local BLC_RESULT=${PIPESTATUS[0]} |
| 50 | + echo ---------------------------------------------------------------------- |
| 51 | + echo Link check summary |
| 52 | + echo ---------------------------------------------------------------------- |
| 53 | + cat blc.log | \ |
| 54 | + grep -E "BROKEN|Getting links from" | \ |
| 55 | + grep -B 1 "BROKEN"; |
| 56 | + |
| 57 | + builder_echo blue "Done checking links" |
| 58 | + rm tier.txt |
| 59 | + return "${BLC_RESULT}" |
43 | 60 | } |
44 | 61 |
|
45 | 62 | builder_run_action configure bootstrap_configure |
46 | 63 | builder_run_action clean clean_docker_container $HELP_IMAGE_NAME $HELP_CONTAINER_NAME |
47 | 64 | builder_run_action stop stop_docker_container $HELP_IMAGE_NAME $HELP_CONTAINER_NAME |
48 | | -builder_run_action build build_docker_container $HELP_IMAGE_NAME $HELP_CONTAINER_NAME |
| 65 | +builder_run_action build build_docker_container $HELP_IMAGE_NAME $HELP_CONTAINER_NAME $BUILDER_CONFIGURATION |
49 | 66 | builder_run_action start start_docker_container $HELP_IMAGE_NAME $HELP_CONTAINER_NAME $HELP_CONTAINER_DESC $HOST_HELP_KEYMAN_COM $PORT_HELP_KEYMAN_COM $BUILDER_CONFIGURATION |
50 | 67 |
|
51 | 68 | builder_run_action test test_docker_container |
0 commit comments