Skip to content
Snippets Groups Projects
Select Git revision
  • master protected
  • develop default protected
  • add-java-build-server
  • add-museum-reservations-server
  • update-mr-approval
  • php-soap
  • add-zaproxy-container
  • 16-update-dependency-check-to-v6-0-3
  • 15-detect-secrets-does-not-detect-secrets-in-subdirectories
9 results

PHP.md

Blame
  • PHP examples of .gitlab-ci.yml

    Standard PHP app with lint and SonarQube analysis

    • One 'test' stage with two jobs.
    • The jobs needs a runner with docker-host capabilities.
    • The job SonarQube is executed only in the branch develop.
    # 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