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/static-code-analysis/Dockerfile b/static-code-analysis/Dockerfile index a6524d42c39d6bbb06d00fb2c08cc0ea0baf8cce..6424a9a967b991036d409e58d05d2ac88686022b 100644 --- a/static-code-analysis/Dockerfile +++ b/static-code-analysis/Dockerfile @@ -12,7 +12,7 @@ LABEL org.label-schema.build-date=$BUILD_DATE \ org.label-schema.schema-version="1.0" \ maintainer="J.R. Barreras <barreras@unl.edu>" -ENV SONAR_SCANNER_VERSION 3.3.0.1492 +ENV SONAR_SCANNER_VERSION 4.0.0.1744 WORKDIR /opt diff --git a/static-code-analysis/android/Dockerfile b/static-code-analysis/android/Dockerfile index 7ec3ab9376c38e78432e870652708fffa1ede442..3857f6347c71f14dde0d235b831ea3721e183b15 100644 --- a/static-code-analysis/android/Dockerfile +++ b/static-code-analysis/android/Dockerfile @@ -12,7 +12,7 @@ LABEL org.label-schema.build-date=$BUILD_DATE \ org.label-schema.schema-version="1.0" \ maintainer="Alan Nelson <alan.nelson@nebraska.edu>" -ENV SONAR_SCANNER_VERSION 3.2.0.1227 +ENV SONAR_SCANNER_VERSION 4.0.0.1744 ENV SONAR_HOME /opt/sonar-scanner ENV PATH ${PATH}:${SONAR_HOME} diff --git a/t/php-lint/tests.sh b/t/php-lint/tests.sh new file mode 100755 index 0000000000000000000000000000000000000000..08283421813abcaec43229d0b5b83ae5dd8e3684 --- /dev/null +++ b/t/php-lint/tests.sh @@ -0,0 +1,14 @@ +TMP_DIR=`mktemp -d` +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 --rm -v "${TMP_DIR}:/work" its-registry.unl.edu/unl-its/docker-ci/php-lint:latest php-lint -d /work +RET=$? +rm -rf ${TMP_DIR} +if [ $RET -eq 0 ]; then + echo "PASS"; +else + echo "FAIL"; +fi +exit $RES