diff --git a/.travis.yml b/.travis.yml index ac25da379..d2b0dbeec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,8 @@ matrix: # Run behat first as it takes the most time (don't need to specify php version here as we don't really care about version on host) - php: 5.6 env: BEFORE="./bin/travis/prepare_behat.sh" TEST_CMD="./bin/travis/runbehat.sh" AFTER_SUCCESS='echo "After success"' RUN_INSTALL=1 COMPOSE_FILE="doc/docker-compose/base-prod.yml:doc/docker-compose/selenium.yml" SYMFONY_ENV=behat SYMFONY_DEBUG=0 + - php: 5.6 + env: BEFORE="./bin/travis/prepare_behat.sh" TEST_CMD="./bin/travis/runcheckstrings.sh" AFTER_SUCCESS='echo "After success"' RUN_INSTALL=1 COMPOSE_FILE="$HOME/build/ezplatform/doc/docker-compose/base-dev.yml" SYMFONY_ENV=dev SYMFONY_DEBUG=1 - env: BEFORE="./bin/travis/setupnode.sh" TEST_CMD="./bin/travis/runnode.sh" AFTER_SUCCESS="./bin/travis/generate_apidoc.sh" - php: 7.0 env: BEFORE="./bin/travis/setupphpunit.sh" TEST_CMD="./vendor/bin/phpunit -c phpunit.xml" AFTER_SUCCESS='echo "After success"' diff --git a/bin/travis/checkstrings.sh b/bin/travis/checkstrings.sh new file mode 100755 index 000000000..cd685de9d --- /dev/null +++ b/bin/travis/checkstrings.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env sh + +OUTPUT=$(./bin/updatestrings.sh --dry-run) + +echo "> Output from updatestrings.sh" +echo $OUTPUT + +echo "> Strings check result" + +ADDED_MESSAGES=$(echo "$OUTPUT" | awk '/Added Messages/ { print $3 }') +DELETED_MESSAGES=$(echo "$OUTPUT" | awk '/Deleted Messages/ { print $3 }') + +RETURN=0 + +if test "$ADDED_MESSAGES" != "0"; then + echo "$ADDED_MESSAGES strings are added"; + RETURN=1 +fi + +if test "$DELETED_MESSAGES" != "0"; then + echo "$DELETED_MESSAGES strings are deleted"; + RETURN=1 +fi + +if test "$RETURN" != 0; then + echo "Failure: strings need to be regenerated" +fi + +exit $RETURN; diff --git a/bin/travis/runcheckstrings.sh b/bin/travis/runcheckstrings.sh new file mode 100755 index 000000000..c562bf62b --- /dev/null +++ b/bin/travis/runcheckstrings.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env sh + +set -x + +cd "$HOME/build/ezplatform" +ls -l +$(docker-compose exec --user www-data app sh -c "cd vendor/ezsystems/platform-ui-bundle; ./bin/travis/checkstrings.sh") + +exit $? diff --git a/bin/updatestrings.sh b/bin/updatestrings.sh new file mode 100755 index 000000000..b9d19b9a7 --- /dev/null +++ b/bin/updatestrings.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env sh +../../../app/console translation:extract en -v \ + --dir=. \ + --exclude-dir=vendor --exclude-dir=Tests --exclude-dir=Features --exclude-dir=node_modules --exclude-dir=Resources/public/vendors \ + --output-dir=./Resources/translations \ + "$@"