diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f14d4653ec9309e85fa16ca316052116c257beb0..f9dd67138a230d04d42845c9ebd59f8e0e300c3b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,13 +27,21 @@ Make All Images: script: - make -test: +Test Sonar Scanner: stage: test tags: - dockerd script: - docker run --rm its-registry.unl.edu/unl-its/docker-ci/static-code-analysis sonar-scanner -v +Test PHP Lint: + stage: test + tags: + - linux, dockerd + script: + - t/php-lint/tests.sh + + Push to Container Registry: after_script: - rm -f /var/lib/gitlab-runner/.docker/config.json diff --git a/t/php-lint/tests.sh b/t/php-lint/tests.sh index 5c1da2efb1ae15642506732b03add054c5970b16..d3cb8bee149f3421919e51cb140bec362c5030d2 100755 --- a/t/php-lint/tests.sh +++ b/t/php-lint/tests.sh @@ -3,6 +3,12 @@ chmod 777 ${TMP_DIR} touch "${TMP_DIR}/dumb php file with spaces.php" touch "${TMP_DIR}/ddumb_php_file_without_spaces.php" touch "${TMP_DIR}/$(printf '\u03c0').php" -docker run -it --rm -v "${TMP_DIR}:/work" its-registry.unl.edu/unl-its/docker-ci/php-lint:latest php-lint -d /work -echo $? - +docker run -it --rm -v "${TMP_DIR}:/work" its-registry.unl.edu/unl-its/docker-ci/php-lint:latest php-lint -d /work > /dev/null 2>&1 +RET=$? +rm -rf ${TMP_DIR} +if [ $RET -eq 0 ]; then + echo "PASS"; +else + echo "FAIL"; +fi +exit $RES