.gitlab-ci.yml 671 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
stages:
  - test

sonar-analysis:
  stage: test
  script:
    - wget "https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-3.3.0.1492-linux.zip"
    - echo "import zipfile" > unzip.py
    - echo "" >> unzip.py
    - echo "with zipfile.ZipFile('sonar-scanner-cli-3.3.0.1492-linux.zip', \"r\") as z:" >> unzip.py
    - echo "  z.extractall(\".\")" >> unzip.py
    - python unzip.py
    - rm unzip.py
    - rm sonar-scanner-cli-3.3.0.1492-linux.zip
    - chmod -R +x sonar-scanner-3.3.0.1492-linux/
16
    - sonar-scanner-3.3.0.1492-linux/bin/sonar-scanner -D sonar.branch.name=$(git log -n 1 --decorate | head -n 1 | sed -e 's/.*\/\(.*\)).*/\1/')