diff --git a/.ansible/group_vars/all/work.yml b/.ansible/group_vars/all/work.yml index b7e850a..363545d 100644 --- a/.ansible/group_vars/all/work.yml +++ b/.ansible/group_vars/all/work.yml @@ -149,10 +149,16 @@ tools_available: check: phpunit --version | grep -iE '^PHPUnit\s[0-9][.0-9]+' || (phpunit --version; false) all: type: custom - command: curl -sS -L --fail "https://phar.phpunit.de/phpunit-${PHP_UNIT_VERSION}.phar" -L -o /usr/local/bin/phpunit + command: | + if [ -n "${PHP_UNIT_VERSION}" ]; then \ + PHP_UNIT_URL="https://phar.phpunit.de/phpunit-${PHP_UNIT_VERSION}.phar"; \ + else \ + PHP_UNIT_URL="https://phar.phpunit.de/phpunit.phar"; \ + fi \ + && curl -sS -L --fail "${PHP_UNIT_URL}" -L -o /usr/local/bin/phpunit \ build_dep: [] run_dep: [] - pre: PHP_UNIT_VERSION="9" + pre: PHP_UNIT_VERSION="" post: chmod +x /usr/local/bin/phpunit 7.2: type: custom diff --git a/Dockerfiles/work/Dockerfile-5.3 b/Dockerfiles/work/Dockerfile-5.3 index 1f34c14..ee26f0a 100644 --- a/Dockerfiles/work/Dockerfile-5.3 +++ b/Dockerfiles/work/Dockerfile-5.3 @@ -288,7 +288,13 @@ RUN set -eux \ # -------------------- (custom) phpunit -------------------- RUN set -eux \ && PHP_UNIT_VERSION="4" \ - && curl -sS -L --fail "https://phar.phpunit.de/phpunit-${PHP_UNIT_VERSION}.phar" -L -o /usr/local/bin/phpunit \ + && if [ -n "${PHP_UNIT_VERSION}" ]; then \ + PHP_UNIT_URL="https://phar.phpunit.de/phpunit-${PHP_UNIT_VERSION}.phar"; \ + else \ + PHP_UNIT_URL="https://phar.phpunit.de/phpunit.phar"; \ + fi \ + && curl -sS -L --fail "${PHP_UNIT_URL}" -L -o /usr/local/bin/phpunit \ + \ && chmod +x /usr/local/bin/phpunit \ && phpunit --version | grep -iE '^PHPUnit\s[0-9][.0-9]+' || (phpunit --version; false) \ && true diff --git a/Dockerfiles/work/Dockerfile-5.4 b/Dockerfiles/work/Dockerfile-5.4 index dbc0e6d..1d25fcd 100644 --- a/Dockerfiles/work/Dockerfile-5.4 +++ b/Dockerfiles/work/Dockerfile-5.4 @@ -296,7 +296,13 @@ RUN set -eux \ # -------------------- (custom) phpunit -------------------- RUN set -eux \ && PHP_UNIT_VERSION="4" \ - && curl -sS -L --fail "https://phar.phpunit.de/phpunit-${PHP_UNIT_VERSION}.phar" -L -o /usr/local/bin/phpunit \ + && if [ -n "${PHP_UNIT_VERSION}" ]; then \ + PHP_UNIT_URL="https://phar.phpunit.de/phpunit-${PHP_UNIT_VERSION}.phar"; \ + else \ + PHP_UNIT_URL="https://phar.phpunit.de/phpunit.phar"; \ + fi \ + && curl -sS -L --fail "${PHP_UNIT_URL}" -L -o /usr/local/bin/phpunit \ + \ && chmod +x /usr/local/bin/phpunit \ && phpunit --version | grep -iE '^PHPUnit\s[0-9][.0-9]+' || (phpunit --version; false) \ && true diff --git a/Dockerfiles/work/Dockerfile-5.5 b/Dockerfiles/work/Dockerfile-5.5 index 291b63d..6ab71ac 100644 --- a/Dockerfiles/work/Dockerfile-5.5 +++ b/Dockerfiles/work/Dockerfile-5.5 @@ -312,7 +312,13 @@ RUN set -eux \ # -------------------- (custom) phpunit -------------------- RUN set -eux \ && PHP_UNIT_VERSION="4" \ - && curl -sS -L --fail "https://phar.phpunit.de/phpunit-${PHP_UNIT_VERSION}.phar" -L -o /usr/local/bin/phpunit \ + && if [ -n "${PHP_UNIT_VERSION}" ]; then \ + PHP_UNIT_URL="https://phar.phpunit.de/phpunit-${PHP_UNIT_VERSION}.phar"; \ + else \ + PHP_UNIT_URL="https://phar.phpunit.de/phpunit.phar"; \ + fi \ + && curl -sS -L --fail "${PHP_UNIT_URL}" -L -o /usr/local/bin/phpunit \ + \ && chmod +x /usr/local/bin/phpunit \ && phpunit --version | grep -iE '^PHPUnit\s[0-9][.0-9]+' || (phpunit --version; false) \ && true diff --git a/Dockerfiles/work/Dockerfile-5.6 b/Dockerfiles/work/Dockerfile-5.6 index 02f2844..8b7b15a 100644 --- a/Dockerfiles/work/Dockerfile-5.6 +++ b/Dockerfiles/work/Dockerfile-5.6 @@ -312,7 +312,13 @@ RUN set -eux \ # -------------------- (custom) phpunit -------------------- RUN set -eux \ && PHP_UNIT_VERSION="5" \ - && curl -sS -L --fail "https://phar.phpunit.de/phpunit-${PHP_UNIT_VERSION}.phar" -L -o /usr/local/bin/phpunit \ + && if [ -n "${PHP_UNIT_VERSION}" ]; then \ + PHP_UNIT_URL="https://phar.phpunit.de/phpunit-${PHP_UNIT_VERSION}.phar"; \ + else \ + PHP_UNIT_URL="https://phar.phpunit.de/phpunit.phar"; \ + fi \ + && curl -sS -L --fail "${PHP_UNIT_URL}" -L -o /usr/local/bin/phpunit \ + \ && chmod +x /usr/local/bin/phpunit \ && phpunit --version | grep -iE '^PHPUnit\s[0-9][.0-9]+' || (phpunit --version; false) \ && true diff --git a/Dockerfiles/work/Dockerfile-7.0 b/Dockerfiles/work/Dockerfile-7.0 index d498933..40c8059 100644 --- a/Dockerfiles/work/Dockerfile-7.0 +++ b/Dockerfiles/work/Dockerfile-7.0 @@ -312,7 +312,13 @@ RUN set -eux \ # -------------------- (custom) phpunit -------------------- RUN set -eux \ && PHP_UNIT_VERSION="6" \ - && curl -sS -L --fail "https://phar.phpunit.de/phpunit-${PHP_UNIT_VERSION}.phar" -L -o /usr/local/bin/phpunit \ + && if [ -n "${PHP_UNIT_VERSION}" ]; then \ + PHP_UNIT_URL="https://phar.phpunit.de/phpunit-${PHP_UNIT_VERSION}.phar"; \ + else \ + PHP_UNIT_URL="https://phar.phpunit.de/phpunit.phar"; \ + fi \ + && curl -sS -L --fail "${PHP_UNIT_URL}" -L -o /usr/local/bin/phpunit \ + \ && chmod +x /usr/local/bin/phpunit \ && phpunit --version | grep -iE '^PHPUnit\s[0-9][.0-9]+' || (phpunit --version; false) \ && true diff --git a/Dockerfiles/work/Dockerfile-7.1 b/Dockerfiles/work/Dockerfile-7.1 index 3761648..bc7a17f 100644 --- a/Dockerfiles/work/Dockerfile-7.1 +++ b/Dockerfiles/work/Dockerfile-7.1 @@ -312,7 +312,13 @@ RUN set -eux \ # -------------------- (custom) phpunit -------------------- RUN set -eux \ && PHP_UNIT_VERSION="7" \ - && curl -sS -L --fail "https://phar.phpunit.de/phpunit-${PHP_UNIT_VERSION}.phar" -L -o /usr/local/bin/phpunit \ + && if [ -n "${PHP_UNIT_VERSION}" ]; then \ + PHP_UNIT_URL="https://phar.phpunit.de/phpunit-${PHP_UNIT_VERSION}.phar"; \ + else \ + PHP_UNIT_URL="https://phar.phpunit.de/phpunit.phar"; \ + fi \ + && curl -sS -L --fail "${PHP_UNIT_URL}" -L -o /usr/local/bin/phpunit \ + \ && chmod +x /usr/local/bin/phpunit \ && phpunit --version | grep -iE '^PHPUnit\s[0-9][.0-9]+' || (phpunit --version; false) \ && true diff --git a/Dockerfiles/work/Dockerfile-7.2 b/Dockerfiles/work/Dockerfile-7.2 index de85cb3..f9351e7 100644 --- a/Dockerfiles/work/Dockerfile-7.2 +++ b/Dockerfiles/work/Dockerfile-7.2 @@ -312,7 +312,13 @@ RUN set -eux \ # -------------------- (custom) phpunit -------------------- RUN set -eux \ && PHP_UNIT_VERSION="8" \ - && curl -sS -L --fail "https://phar.phpunit.de/phpunit-${PHP_UNIT_VERSION}.phar" -L -o /usr/local/bin/phpunit \ + && if [ -n "${PHP_UNIT_VERSION}" ]; then \ + PHP_UNIT_URL="https://phar.phpunit.de/phpunit-${PHP_UNIT_VERSION}.phar"; \ + else \ + PHP_UNIT_URL="https://phar.phpunit.de/phpunit.phar"; \ + fi \ + && curl -sS -L --fail "${PHP_UNIT_URL}" -L -o /usr/local/bin/phpunit \ + \ && chmod +x /usr/local/bin/phpunit \ && phpunit --version | grep -iE '^PHPUnit\s[0-9][.0-9]+' || (phpunit --version; false) \ && true diff --git a/Dockerfiles/work/Dockerfile-7.3 b/Dockerfiles/work/Dockerfile-7.3 index 76c8494..76b2db3 100644 --- a/Dockerfiles/work/Dockerfile-7.3 +++ b/Dockerfiles/work/Dockerfile-7.3 @@ -323,8 +323,14 @@ RUN set -eux \ # -------------------- (custom) phpunit -------------------- RUN set -eux \ - && PHP_UNIT_VERSION="9" \ - && curl -sS -L --fail "https://phar.phpunit.de/phpunit-${PHP_UNIT_VERSION}.phar" -L -o /usr/local/bin/phpunit \ + && PHP_UNIT_VERSION="" \ + && if [ -n "${PHP_UNIT_VERSION}" ]; then \ + PHP_UNIT_URL="https://phar.phpunit.de/phpunit-${PHP_UNIT_VERSION}.phar"; \ + else \ + PHP_UNIT_URL="https://phar.phpunit.de/phpunit.phar"; \ + fi \ + && curl -sS -L --fail "${PHP_UNIT_URL}" -L -o /usr/local/bin/phpunit \ + \ && chmod +x /usr/local/bin/phpunit \ && phpunit --version | grep -iE '^PHPUnit\s[0-9][.0-9]+' || (phpunit --version; false) \ && true diff --git a/Dockerfiles/work/Dockerfile-7.4 b/Dockerfiles/work/Dockerfile-7.4 index d87ba7d..66455cf 100644 --- a/Dockerfiles/work/Dockerfile-7.4 +++ b/Dockerfiles/work/Dockerfile-7.4 @@ -323,8 +323,14 @@ RUN set -eux \ # -------------------- (custom) phpunit -------------------- RUN set -eux \ - && PHP_UNIT_VERSION="9" \ - && curl -sS -L --fail "https://phar.phpunit.de/phpunit-${PHP_UNIT_VERSION}.phar" -L -o /usr/local/bin/phpunit \ + && PHP_UNIT_VERSION="" \ + && if [ -n "${PHP_UNIT_VERSION}" ]; then \ + PHP_UNIT_URL="https://phar.phpunit.de/phpunit-${PHP_UNIT_VERSION}.phar"; \ + else \ + PHP_UNIT_URL="https://phar.phpunit.de/phpunit.phar"; \ + fi \ + && curl -sS -L --fail "${PHP_UNIT_URL}" -L -o /usr/local/bin/phpunit \ + \ && chmod +x /usr/local/bin/phpunit \ && phpunit --version | grep -iE '^PHPUnit\s[0-9][.0-9]+' || (phpunit --version; false) \ && true diff --git a/Dockerfiles/work/Dockerfile-8.0 b/Dockerfiles/work/Dockerfile-8.0 index f7fbd59..be5ed0d 100644 --- a/Dockerfiles/work/Dockerfile-8.0 +++ b/Dockerfiles/work/Dockerfile-8.0 @@ -323,8 +323,14 @@ RUN set -eux \ # -------------------- (custom) phpunit -------------------- RUN set -eux \ - && PHP_UNIT_VERSION="9" \ - && curl -sS -L --fail "https://phar.phpunit.de/phpunit-${PHP_UNIT_VERSION}.phar" -L -o /usr/local/bin/phpunit \ + && PHP_UNIT_VERSION="" \ + && if [ -n "${PHP_UNIT_VERSION}" ]; then \ + PHP_UNIT_URL="https://phar.phpunit.de/phpunit-${PHP_UNIT_VERSION}.phar"; \ + else \ + PHP_UNIT_URL="https://phar.phpunit.de/phpunit.phar"; \ + fi \ + && curl -sS -L --fail "${PHP_UNIT_URL}" -L -o /usr/local/bin/phpunit \ + \ && chmod +x /usr/local/bin/phpunit \ && phpunit --version | grep -iE '^PHPUnit\s[0-9][.0-9]+' || (phpunit --version; false) \ && true diff --git a/Dockerfiles/work/Dockerfile-8.1 b/Dockerfiles/work/Dockerfile-8.1 index a8413f6..d2333c2 100644 --- a/Dockerfiles/work/Dockerfile-8.1 +++ b/Dockerfiles/work/Dockerfile-8.1 @@ -323,8 +323,14 @@ RUN set -eux \ # -------------------- (custom) phpunit -------------------- RUN set -eux \ - && PHP_UNIT_VERSION="9" \ - && curl -sS -L --fail "https://phar.phpunit.de/phpunit-${PHP_UNIT_VERSION}.phar" -L -o /usr/local/bin/phpunit \ + && PHP_UNIT_VERSION="" \ + && if [ -n "${PHP_UNIT_VERSION}" ]; then \ + PHP_UNIT_URL="https://phar.phpunit.de/phpunit-${PHP_UNIT_VERSION}.phar"; \ + else \ + PHP_UNIT_URL="https://phar.phpunit.de/phpunit.phar"; \ + fi \ + && curl -sS -L --fail "${PHP_UNIT_URL}" -L -o /usr/local/bin/phpunit \ + \ && chmod +x /usr/local/bin/phpunit \ && phpunit --version | grep -iE '^PHPUnit\s[0-9][.0-9]+' || (phpunit --version; false) \ && true diff --git a/Dockerfiles/work/Dockerfile-8.2 b/Dockerfiles/work/Dockerfile-8.2 index 32adcbd..49b6ab5 100644 --- a/Dockerfiles/work/Dockerfile-8.2 +++ b/Dockerfiles/work/Dockerfile-8.2 @@ -323,8 +323,14 @@ RUN set -eux \ # -------------------- (custom) phpunit -------------------- RUN set -eux \ - && PHP_UNIT_VERSION="9" \ - && curl -sS -L --fail "https://phar.phpunit.de/phpunit-${PHP_UNIT_VERSION}.phar" -L -o /usr/local/bin/phpunit \ + && PHP_UNIT_VERSION="" \ + && if [ -n "${PHP_UNIT_VERSION}" ]; then \ + PHP_UNIT_URL="https://phar.phpunit.de/phpunit-${PHP_UNIT_VERSION}.phar"; \ + else \ + PHP_UNIT_URL="https://phar.phpunit.de/phpunit.phar"; \ + fi \ + && curl -sS -L --fail "${PHP_UNIT_URL}" -L -o /usr/local/bin/phpunit \ + \ && chmod +x /usr/local/bin/phpunit \ && phpunit --version | grep -iE '^PHPUnit\s[0-9][.0-9]+' || (phpunit --version; false) \ && true diff --git a/php_tools/phpunit/install.yml b/php_tools/phpunit/install.yml index 54b3aa7..039c140 100644 --- a/php_tools/phpunit/install.yml +++ b/php_tools/phpunit/install.yml @@ -4,10 +4,16 @@ check: phpunit --version | grep -iE '^PHPUnit\s[0-9][.0-9]+' || (phpunit --versi all: type: custom - command: curl -sS -L --fail "https://phar.phpunit.de/phpunit-${PHP_UNIT_VERSION}.phar" -L -o /usr/local/bin/phpunit + command: | + if [ -n "${PHP_UNIT_VERSION}" ]; then \ + PHP_UNIT_URL="https://phar.phpunit.de/phpunit-${PHP_UNIT_VERSION}.phar"; \ + else \ + PHP_UNIT_URL="https://phar.phpunit.de/phpunit.phar"; \ + fi \ + && curl -sS -L --fail "${PHP_UNIT_URL}" -L -o /usr/local/bin/phpunit \ build_dep: [] run_dep: [] - pre: PHP_UNIT_VERSION="9" + pre: PHP_UNIT_VERSION="" post: chmod +x /usr/local/bin/phpunit 7.2: