Newer
Older
stages:
- install_dependencies
- test
- sonar
- dockerize
variables:
SONARQUBE_URL: https://sonarqube.lam.fr
install_dependencies:
image: jakzal/phpqa:php8.0
stage: install_dependencies
script:
policy: pull-push
test:
image: jakzal/phpqa:php8.0
stage: test
cache:
- phpdbg
-qrr ./vendor/bin/phpunit
--bootstrap ./tests/bootstrap.php
--whitelist src
--coverage-clover ./coverage/clover.xml
--log-junit ./coverage/junit-logfile.xml
--coverage-text --colors=never ./tests
sonar_scanner:
image: sonarsource/sonar-scanner-cli:latest
stage: sonar
script:
-Dsonar.sources=src
-Dsonar.projectVersion=$VERSION
-Dsonar.host.url=$SONARQUBE_URL
-Dsonar.login=$SONAR_TOKEN_SERVER
-Dsonar.php.tests.reportPath=./coverage/junit-logfile.xml
-Dsonar.php.coverage.reportPaths=./coverage/clover.xml
dockerize:
image: docker:stable
stage: dockerize
cache:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker pull $CI_REGISTRY/anis/anis-next/server:latest || true
- docker build --cache-from $CI_REGISTRY/anis/anis-next/server:latest -t $CI_REGISTRY/anis/anis-next/server:latest .
- docker push $CI_REGISTRY/anis/anis-next/server:latest