diff --git a/examples/PHP.md b/examples/PHP.md new file mode 100644 index 0000000000000000000000000000000000000000..09c9ff958504ca30e6655c9ec5f870536046b918 --- /dev/null +++ b/examples/PHP.md @@ -0,0 +1,35 @@ +# PHP examples of .gitlab-ci.yml + +## Standard PHP app with lint and SonarQube analysis + +``` +# To use this script, you must have the following variables defined +# You can define them at the project or the group level +# +# SONAR_URL: Full URL to the SonarQube server +# SONAR_TOKEN: API token for SonarQube + +variables: + GITLAB_CI: 1 + +stages: + - test + +PHP Lint: + stage: test + image: its-registry.unl.edu/unl-its/docker-ci/php-lint:7.0 + tags: + - docker + script: + - php-lint -d ./ + +SonarQube: + stage: test + image: its-registry.unl.edu/unl-its/docker-ci/static-code-analysis:php + tags: + - docker + only: + - develop + script: + - sonar-scanner -Dsonar.host.url=$SONAR_URL -Dsonar.projectKey=$CI_PROJECT_PATH_SLUG -Dsonar.sources=. -Dsonar.login=$SONAR_TOKEN +```