Skip to content

Commit b842e9c

Browse files
committed
PHP QA template/kool.yml
0 parents  commit b842e9c

File tree

4 files changed

+66
-0
lines changed

4 files changed

+66
-0
lines changed

fwd-template.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"output": ".",
3+
"builds": [
4+
{
5+
"name": "7.4",
6+
"data": {
7+
"from": "kooldev/php:7.4"
8+
},
9+
"files": [
10+
{
11+
"name": "Dockerfile",
12+
"path": "template/Dockerfile"
13+
}, {
14+
"name": "entrypoint.sh",
15+
"path": "template/entrypoint"
16+
}
17+
]
18+
}
19+
]
20+
}

kool.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
scripts:
2+
template: kool docker fireworkweb/fwd:v1.0 fwd template
3+
build:
4+
# parse templates
5+
- kool run template
6+
# PHP 7.4
7+
- docker build --pull -t kooldev/phpqa:7.4 7.4
8+
# PHP 8.0
9+
# - docker build --pull -t kooldev/phpqa:8.0 8.0

template/Dockerfile.blade.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
FROM {{ $from }}
2+
3+
# make Composer global vendor/bin available through PATH
4+
RUN sed -i 's/\(^export PATH=.*\)/\1:\/root\/.composer\/vendor\/bin:\/phars/' /etc/profile
5+
6+
# install dependencies (ast)
7+
RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
8+
&& pecl install ast \
9+
&& echo 'extension=ast.so' >> /usr/local/etc/php/php.ini \
10+
&& apk del .build-deps \
11+
&& rm -rf /var/cache/apk/* /tmp/*
12+
13+
# install QA tools
14+
RUN \
15+
# install and set up QA tools from Composer
16+
composer global require friendsofphp/php-cs-fixer phan/phan \
17+
# download PHAR and make them executable
18+
&& mkdir /phars \
19+
&& curl -Lf https://phpmd.org/static/latest/phpmd.phar -o /phars/phpmd \
20+
&& 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 \
21+
&& curl -Lf https://phar.phpunit.de/phpcpd.phar -o /phars/phpcpd \
22+
&& curl -Lf https://phar.phpunit.de/phpunit-nightly.phar -o /phars/phpunit10 \
23+
&& curl -Lf https://phar.phpunit.de/phpunit-9.5.phar -o /phars/phpunit \
24+
&& chmod +x /phars/* \
25+
# post-install tools settings
26+
&& /phars/local-php-security-checker --update-cache
27+
28+
ADD entrypoint.sh /kool/entrypoint.sh
29+
RUN chmod +x /kool/entrypoint.sh
30+
31+
ENTRYPOINT [ "/kool/entrypoint.sh" ]
32+
CMD [ "composer", "--version" ]

template/entrypoint.blade.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
source /etc/profile
4+
5+
exec "$@"

0 commit comments

Comments
 (0)