Skip to content
Snippets Groups Projects
Commit 63159dda authored by Raul Barreras's avatar Raul Barreras
Browse files

Merge branch 'master' into '6-add-automated-secrets-detection'

Sync  6-add-automated-secrets-detection with master

See merge request !28
parents 381c5d6a 1aa0aaee
No related branches found
No related tags found
3 merge requests!34develop to master,!28Sync 6-add-automated-secrets-detection with master,!16Resolve "Add Automated Secrets Detection"
...@@ -27,7 +27,7 @@ Make All Images: ...@@ -27,7 +27,7 @@ Make All Images:
script: script:
- make - make
test: Test Sonar Scanner:
stage: test stage: test
tags: tags:
- dockerd - dockerd
...@@ -35,6 +35,14 @@ test: ...@@ -35,6 +35,14 @@ test:
- docker run --rm its-registry.unl.edu/unl-its/docker-ci/static-code-analysis sonar-scanner -v - docker run --rm its-registry.unl.edu/unl-its/docker-ci/static-code-analysis sonar-scanner -v
- docker run --rm -v "${PWD}:/work" -w /work its-registry.unl.edu/unl-its/docker-ci/detect-secrets -s - docker run --rm -v "${PWD}:/work" -w /work its-registry.unl.edu/unl-its/docker-ci/detect-secrets -s
Test PHP Lint:
stage: test
tags:
- linux, dockerd
script:
- t/php-lint/tests.sh
Push to Container Registry: Push to Container Registry:
after_script: after_script:
- rm -f /var/lib/gitlab-runner/.docker/config.json - rm -f /var/lib/gitlab-runner/.docker/config.json
......
...@@ -51,8 +51,8 @@ for dir in "${LINT_DIRS[@]}"; do ...@@ -51,8 +51,8 @@ for dir in "${LINT_DIRS[@]}"; do
echo "Scanning directory ${dir} for extension ${ext}" echo "Scanning directory ${dir} for extension ${ext}"
# Scan current dir and ext and lint them # Scan current dir and ext and lint them
for f in $(find "${dir}" -type f -name "*${ext}"); do find "${dir}" -type f -name "*${ext}" -print0 | while IFS= read -r -d '' f; do
OUTPUT=$(php -l $f 2>&1) OUTPUT=$(php -l "$f" 2>&1)
rc=$? rc=$?
if [[ $rc != 0 ]]; then # Non-zero exit code, print error and exit if [[ $rc != 0 ]]; then # Non-zero exit code, print error and exit
......
...@@ -12,9 +12,10 @@ LABEL org.label-schema.build-date=$BUILD_DATE \ ...@@ -12,9 +12,10 @@ LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.schema-version="1.0" \ org.label-schema.schema-version="1.0" \
maintainer="Alan Nelson <alan.nelson@nebraska.edu>" maintainer="Alan Nelson <alan.nelson@nebraska.edu>"
RUN apk add --no-cache bash nodejs nodejs-npm $PHPIZE_DEPS \ RUN apk add --no-cache bash nodejs nodejs-npm libmcrypt-dev $PHPIZE_DEPS \
&& pecl install xdebug \ && pecl install xdebug redis \
&& docker-php-ext-enable xdebug \ && docker-php-ext-enable xdebug redis \
&& docker-php-ext-install mcrypt \
&& apk del --no-cache $PHPIZE_DEPS && apk del --no-cache $PHPIZE_DEPS
RUN curl -o /usr/local/bin/composer https://getcomposer.org/composer.phar \ RUN curl -o /usr/local/bin/composer https://getcomposer.org/composer.phar \
&& chmod 755 /usr/local/bin/composer && chmod 755 /usr/local/bin/composer
......
...@@ -13,8 +13,8 @@ LABEL org.label-schema.build-date=$BUILD_DATE \ ...@@ -13,8 +13,8 @@ LABEL org.label-schema.build-date=$BUILD_DATE \
maintainer="Alan Nelson <alan.nelson@nebraska.edu>" maintainer="Alan Nelson <alan.nelson@nebraska.edu>"
RUN apk add --no-cache bash nodejs nodejs-npm $PHPIZE_DEPS \ RUN apk add --no-cache bash nodejs nodejs-npm $PHPIZE_DEPS \
&& pecl install xdebug \ && pecl install xdebug redis \
&& docker-php-ext-enable xdebug \ && docker-php-ext-enable xdebug redis \
&& apk del --no-cache $PHPIZE_DEPS && apk del --no-cache $PHPIZE_DEPS
RUN curl -o /usr/local/bin/composer https://getcomposer.org/composer.phar \ RUN curl -o /usr/local/bin/composer https://getcomposer.org/composer.phar \
&& chmod 755 /usr/local/bin/composer && chmod 755 /usr/local/bin/composer
......
...@@ -12,7 +12,7 @@ LABEL org.label-schema.build-date=$BUILD_DATE \ ...@@ -12,7 +12,7 @@ LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.schema-version="1.0" \ org.label-schema.schema-version="1.0" \
maintainer="J.R. Barreras <barreras@unl.edu>" 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 WORKDIR /opt
......
...@@ -12,7 +12,7 @@ LABEL org.label-schema.build-date=$BUILD_DATE \ ...@@ -12,7 +12,7 @@ LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.schema-version="1.0" \ org.label-schema.schema-version="1.0" \
maintainer="Alan Nelson <alan.nelson@nebraska.edu>" 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 SONAR_HOME /opt/sonar-scanner
ENV PATH ${PATH}:${SONAR_HOME} ENV PATH ${PATH}:${SONAR_HOME}
......
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment