commit 4c992b4222c7294c962b89260193f7063a5f409e Author: Alexandre Agostinho Date: Mon Mar 18 17:09:27 2024 +0100 init diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..c5db96f --- /dev/null +++ b/.drone.yml @@ -0,0 +1,20 @@ +kind: pipeline +type: docker +name: build + +trigger: + event: + - push + +steps: + - name: docker-build + image: image: plugins/docker + settings: + dockerfile: Dockerfile + context: . + registry: hub.codefirst.iut.uca.fr + repo: hub.codefirst.iut.uca.fr/alexandre.agostinho/codefirst-dronesonarplugin-php + username: + from_secret: SECRET_REGISTRY_USERNAME + password: + from_secret: SECRET_REGISTRY_PASSWORD diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..982058f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM aosapps/drone-sonar-plugin AS base + +FROM cimg/php:8.2 +COPY --from=base /bin/drone-sonar /bin/ + +RUN pecl install xdebug \ + && php-ext enable xdebug \ + && echo "xdebug.mode=coverage" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \ + && wget -O phpunit.phar https://phar.phpunit.de/phpunit-10.phar \ + && sudo mv phpunit.phar /usr/local/bin/phpunit \ + && chmod +x /usr/local/bin/phpunit \ + && phpunit --version + + +#RUN phpunit ${TESTS_FOLDER} --coverage-clover=coverage.xml + +ENTRYPOINT /bin/drone-sonar +