diff --git a/Makefile b/Makefile index 2f8805e7220a5f14295edb8056fe2dfdefcdccb2..451efce4861d475a5e1c2fbf7c5fd5bbe53d6bf8 100644 --- a/Makefile +++ b/Makefile @@ -15,16 +15,16 @@ all: \ # PHP Images #################### php-lint_5.6: - docker build -t unl-its/php-lint:5.6 php-lint/5.6 + docker build -t unl-its/php-lint:5.6 -f php-lint/5.6/Dockerfile php-lint php-lint_7.0: - docker build -t unl-its/php-lint:7.0 php-lint/7.0 + docker build -t unl-its/php-lint:7.0 -f php-lint/7.0/Dockerfile php-lint php-lint_7.1: - docker build -t unl-its/php-lint:7.1 php-lint/7.1 + docker build -t unl-its/php-lint:7.1 -f php-lint/7.1/Dockerfile php-lint php-lint_7.2: - docker build -t unl-its/php-lint:7.2 php-lint/7.2 + docker build -t unl-its/php-lint:7.2 -f php-lint/7.2/Dockerfile php-lint php-lint_latest: php-lint_7.2 docker tag unl-its/php-lint:7.2 unl-its/php-lint:latest diff --git a/php-lint/7.0/docker-entrypoint b/php-lint/7.0/docker-entrypoint deleted file mode 100644 index 131b834a0cec520bad3f490a0b746409685ad973..0000000000000000000000000000000000000000 --- a/php-lint/7.0/docker-entrypoint +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -set -e - -if [ "${1#-}" != "$1" ]; then - set -- php-lint "$@" -fi - -exec "$@" diff --git a/php-lint/7.0/php-lint b/php-lint/7.0/php-lint deleted file mode 100644 index afb52f2337d64b0c7e1b97b4daf665909e744329..0000000000000000000000000000000000000000 --- a/php-lint/7.0/php-lint +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash - -# Read CLI options -LINT_DIRS=() -LINT_EXTS=() -QUIET=false -while [[ $# -gt 0 ]]; do - case $1 in - -e|--ext) - LINT_EXTS+=("$2") - shift - shift - ;; - -d|--dir) - LINT_DIRS+=("$2") - shift - shift - ;; - -q|--quiet) - QUIET=true - shift - ;; - -h|--help) - printf 'Usage: %s <options>\n' "$0" - printf '\t%s\n' "-e,--ext: Required argument: extensions to lint" - printf '\t%s\n' "-d,--dir: Required argument: directories to lint" - printf '\t%s\n' "-q,--quiet: Optional argument: Quiet mode, only print errors" - printf '\t%s\n' "-h,--help: Prints this help message" - exit 0 - ;; - *) - echo "Unrecognized option ${1}" - shift - ;; - esac -done - -# If no dirs were provided, use CWD -if [[ -z "$LINT_DIRS" ]]; then - LINT_DIRS=($(pwd)) -fi - -# If no extenions were provided, use reasonable defaults -if [[ -z "$LINT_EXTS" ]]; then - LINT_EXTS=(".php" ".phtml") -fi - -# Run PHP Lint on all provided files and directories -for dir in "${LINT_DIRS[@]}"; do - for ext in "${LINT_EXTS[@]}"; do - echo "Scanning directory ${dir} for extension ${ext}" - - # Scan current dir and ext and lint them - for f in $(find "${dir}" -type f -name "*${ext}"); do - OUTPUT=$(php -l $f 2>&1) - rc=$? - - if [[ $rc != 0 ]]; then # Non-zero exit code, print error and exit - >&2 echo "$OUTPUT" - exit $rc - elif [[ $rc == 0 ]] && [[ $QUIET == false ]]; then # all ok - echo "$OUTPUT" - fi - done - done -done diff --git a/php-lint/7.1/docker-entrypoint b/php-lint/7.1/docker-entrypoint deleted file mode 100644 index 131b834a0cec520bad3f490a0b746409685ad973..0000000000000000000000000000000000000000 --- a/php-lint/7.1/docker-entrypoint +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -set -e - -if [ "${1#-}" != "$1" ]; then - set -- php-lint "$@" -fi - -exec "$@" diff --git a/php-lint/7.1/php-lint b/php-lint/7.1/php-lint deleted file mode 100644 index afb52f2337d64b0c7e1b97b4daf665909e744329..0000000000000000000000000000000000000000 --- a/php-lint/7.1/php-lint +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash - -# Read CLI options -LINT_DIRS=() -LINT_EXTS=() -QUIET=false -while [[ $# -gt 0 ]]; do - case $1 in - -e|--ext) - LINT_EXTS+=("$2") - shift - shift - ;; - -d|--dir) - LINT_DIRS+=("$2") - shift - shift - ;; - -q|--quiet) - QUIET=true - shift - ;; - -h|--help) - printf 'Usage: %s <options>\n' "$0" - printf '\t%s\n' "-e,--ext: Required argument: extensions to lint" - printf '\t%s\n' "-d,--dir: Required argument: directories to lint" - printf '\t%s\n' "-q,--quiet: Optional argument: Quiet mode, only print errors" - printf '\t%s\n' "-h,--help: Prints this help message" - exit 0 - ;; - *) - echo "Unrecognized option ${1}" - shift - ;; - esac -done - -# If no dirs were provided, use CWD -if [[ -z "$LINT_DIRS" ]]; then - LINT_DIRS=($(pwd)) -fi - -# If no extenions were provided, use reasonable defaults -if [[ -z "$LINT_EXTS" ]]; then - LINT_EXTS=(".php" ".phtml") -fi - -# Run PHP Lint on all provided files and directories -for dir in "${LINT_DIRS[@]}"; do - for ext in "${LINT_EXTS[@]}"; do - echo "Scanning directory ${dir} for extension ${ext}" - - # Scan current dir and ext and lint them - for f in $(find "${dir}" -type f -name "*${ext}"); do - OUTPUT=$(php -l $f 2>&1) - rc=$? - - if [[ $rc != 0 ]]; then # Non-zero exit code, print error and exit - >&2 echo "$OUTPUT" - exit $rc - elif [[ $rc == 0 ]] && [[ $QUIET == false ]]; then # all ok - echo "$OUTPUT" - fi - done - done -done diff --git a/php-lint/7.2/docker-entrypoint b/php-lint/7.2/docker-entrypoint deleted file mode 100644 index 131b834a0cec520bad3f490a0b746409685ad973..0000000000000000000000000000000000000000 --- a/php-lint/7.2/docker-entrypoint +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -set -e - -if [ "${1#-}" != "$1" ]; then - set -- php-lint "$@" -fi - -exec "$@" diff --git a/php-lint/7.2/php-lint b/php-lint/7.2/php-lint deleted file mode 100644 index afb52f2337d64b0c7e1b97b4daf665909e744329..0000000000000000000000000000000000000000 --- a/php-lint/7.2/php-lint +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash - -# Read CLI options -LINT_DIRS=() -LINT_EXTS=() -QUIET=false -while [[ $# -gt 0 ]]; do - case $1 in - -e|--ext) - LINT_EXTS+=("$2") - shift - shift - ;; - -d|--dir) - LINT_DIRS+=("$2") - shift - shift - ;; - -q|--quiet) - QUIET=true - shift - ;; - -h|--help) - printf 'Usage: %s <options>\n' "$0" - printf '\t%s\n' "-e,--ext: Required argument: extensions to lint" - printf '\t%s\n' "-d,--dir: Required argument: directories to lint" - printf '\t%s\n' "-q,--quiet: Optional argument: Quiet mode, only print errors" - printf '\t%s\n' "-h,--help: Prints this help message" - exit 0 - ;; - *) - echo "Unrecognized option ${1}" - shift - ;; - esac -done - -# If no dirs were provided, use CWD -if [[ -z "$LINT_DIRS" ]]; then - LINT_DIRS=($(pwd)) -fi - -# If no extenions were provided, use reasonable defaults -if [[ -z "$LINT_EXTS" ]]; then - LINT_EXTS=(".php" ".phtml") -fi - -# Run PHP Lint on all provided files and directories -for dir in "${LINT_DIRS[@]}"; do - for ext in "${LINT_EXTS[@]}"; do - echo "Scanning directory ${dir} for extension ${ext}" - - # Scan current dir and ext and lint them - for f in $(find "${dir}" -type f -name "*${ext}"); do - OUTPUT=$(php -l $f 2>&1) - rc=$? - - if [[ $rc != 0 ]]; then # Non-zero exit code, print error and exit - >&2 echo "$OUTPUT" - exit $rc - elif [[ $rc == 0 ]] && [[ $QUIET == false ]]; then # all ok - echo "$OUTPUT" - fi - done - done -done diff --git a/php-lint/5.6/docker-entrypoint b/php-lint/docker-entrypoint similarity index 100% rename from php-lint/5.6/docker-entrypoint rename to php-lint/docker-entrypoint diff --git a/php-lint/5.6/php-lint b/php-lint/php-lint similarity index 100% rename from php-lint/5.6/php-lint rename to php-lint/php-lint