diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 9010720..9033ff8 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - version: ['7.4', '8.0', '8.1'] + version: ['7.4', '8.0', '8.1', '8.2', '8.3'] steps: - name: Checkout code diff --git a/8.2/Dockerfile b/8.2/Dockerfile new file mode 100644 index 0000000..55baf2d --- /dev/null +++ b/8.2/Dockerfile @@ -0,0 +1,35 @@ +FROM kooldev/php:8.2 + +# make Composer global vendor/bin available through PATH +RUN echo "export PATH=\$PATH:\/root\/.composer\/vendor\/bin:\/phars/" | tee -a /etc/profile + +# install dependencies (ast) +RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \ + && pecl install ast \ + && echo 'extension=ast.so' >> /usr/local/etc/php/php.ini \ + && docker-php-ext-enable xdebug \ + && apk del .build-deps \ + && rm -rf /var/cache/apk/* /tmp/* + +# install QA tools +RUN \ + # install and set up QA tools from Composer + composer global require squizlabs/php_codesniffer \ + phpstan/phpstan \ + friendsofphp/php-cs-fixer \ + phan/phan \ + # download PHAR and make them executable + && mkdir /phars \ + && curl -Lf https://phpmd.org/static/latest/phpmd.phar -o /phars/phpmd \ + && curl -Lf https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_amd64 -o /phars/local-php-security-checker \ + && curl -Lf https://phar.phpunit.de/phpcpd.phar -o /phars/phpcpd \ + && curl -Lf https://phar.phpunit.de/phpunit-9.5.phar -o /phars/phpunit \ + && chmod +x /phars/* \ + # post-install tools settings + && /phars/local-php-security-checker --update-cache + +ADD entrypoint.sh /kool/entrypoint.sh +RUN chmod +x /kool/entrypoint.sh + +ENTRYPOINT [ "/kool/entrypoint.sh" ] +CMD [ "composer", "--version" ] diff --git a/8.2/entrypoint.sh b/8.2/entrypoint.sh new file mode 100644 index 0000000..fd66291 --- /dev/null +++ b/8.2/entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +source /etc/profile + +exec "$@" diff --git a/8.3/Dockerfile b/8.3/Dockerfile new file mode 100644 index 0000000..a6ca2ec --- /dev/null +++ b/8.3/Dockerfile @@ -0,0 +1,35 @@ +FROM kooldev/php:8.3 + +# make Composer global vendor/bin available through PATH +RUN echo "export PATH=\$PATH:\/root\/.composer\/vendor\/bin:\/phars/" | tee -a /etc/profile + +# install dependencies (ast) +RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \ + && pecl install ast \ + && echo 'extension=ast.so' >> /usr/local/etc/php/php.ini \ + && docker-php-ext-enable xdebug \ + && apk del .build-deps \ + && rm -rf /var/cache/apk/* /tmp/* + +# install QA tools +RUN \ + # install and set up QA tools from Composer + composer global require squizlabs/php_codesniffer \ + phpstan/phpstan \ + friendsofphp/php-cs-fixer \ + phan/phan \ + # download PHAR and make them executable + && mkdir /phars \ + && curl -Lf https://phpmd.org/static/latest/phpmd.phar -o /phars/phpmd \ + && curl -Lf https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_amd64 -o /phars/local-php-security-checker \ + && curl -Lf https://phar.phpunit.de/phpcpd.phar -o /phars/phpcpd \ + && curl -Lf https://phar.phpunit.de/phpunit-9.5.phar -o /phars/phpunit \ + && chmod +x /phars/* \ + # post-install tools settings + && /phars/local-php-security-checker --update-cache + +ADD entrypoint.sh /kool/entrypoint.sh +RUN chmod +x /kool/entrypoint.sh + +ENTRYPOINT [ "/kool/entrypoint.sh" ] +CMD [ "composer", "--version" ] diff --git a/8.3/entrypoint.sh b/8.3/entrypoint.sh new file mode 100644 index 0000000..fd66291 --- /dev/null +++ b/8.3/entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +source /etc/profile + +exec "$@" diff --git a/README.md b/README.md index ba586df..499fea4 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,8 @@ docker run --rm --init -it -v $(pwd):/app -w /app kooldev/phpqa:7.4 The image built is [`kooldev/phpqa`](https://hub.docker.com/r/kooldev/phpqa/tags?page=1&ordering=last_updated) with tags: +- [**`8.3`**](https://github.com/kool-dev/docker-phpqa/blob/main/8.3/Dockerfile) +- [**`8.2`**](https://github.com/kool-dev/docker-phpqa/blob/main/8.2/Dockerfile) - [**`8.1`**](https://github.com/kool-dev/docker-phpqa/blob/main/8.1/Dockerfile) - [**`8.0`**](https://github.com/kool-dev/docker-phpqa/blob/main/8.0/Dockerfile) - [**`7.4`**](https://github.com/kool-dev/docker-phpqa/blob/main/7.4/Dockerfile) diff --git a/fwd-template.json b/fwd-template.json index 8b78aa6..78933b2 100644 --- a/fwd-template.json +++ b/fwd-template.json @@ -45,6 +45,36 @@ "path": "template/entrypoint" } ] + }, + { + "name": "8.2", + "data": { + "from": "kooldev/php:8.2" + }, + "files": [ + { + "name": "Dockerfile", + "path": "template/Dockerfile" + }, { + "name": "entrypoint.sh", + "path": "template/entrypoint" + } + ] + }, + { + "name": "8.3", + "data": { + "from": "kooldev/php:8.3" + }, + "files": [ + { + "name": "Dockerfile", + "path": "template/Dockerfile" + }, { + "name": "entrypoint.sh", + "path": "template/entrypoint" + } + ] } ] } diff --git a/kool.yml b/kool.yml index 5787917..d122195 100644 --- a/kool.yml +++ b/kool.yml @@ -9,3 +9,7 @@ scripts: - docker build --pull -t kooldev/phpqa:8.0 8.0 # PHP 8.1 - docker build --pull -t kooldev/phpqa:8.1 8.1 + # PHP 8.2 + - docker build --pull -t kooldev/phpqa:8.2 8.2 + # PHP 8.3 + - docker build --pull -t kooldev/phpqa:8.3 8.3