From 34caf0f5ee3eb9520ce3458c6325f5fad6e9df1a Mon Sep 17 00:00:00 2001 From: Jose Raul Barreras <barreras@unl.edu> Date: Fri, 22 Mar 2019 19:36:01 +0000 Subject: [PATCH] add PHP gitlab-ci examples --- examples/PHP.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 examples/PHP.md diff --git a/examples/PHP.md b/examples/PHP.md new file mode 100644 index 0000000..09c9ff9 --- /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 +``` -- GitLab