Skip to content

Instantly share code, notes, and snippets.

@xb4dc0d3
Created March 9, 2020 14:39
Show Gist options
  • Save xb4dc0d3/3150a7a0f75c7559f9abe1439c877748 to your computer and use it in GitHub Desktop.
Save xb4dc0d3/3150a7a0f75c7559f9abe1439c877748 to your computer and use it in GitHub Desktop.
...
sonarqube:
image: nuga99/sonar-scanner-python
stage: sonarqube
before_script:
- python3 -V
- pip3 install -r requirements.txt
script:
- if [[ $CI_COMMIT_REF_NAME == staging ]]; then ENVIRON="sip.settings.staging"; else ENVIRON="sip.settings.dev"; fi
- coverage run --omit='manage.py,*/venv/*,**/python3.6/**,authentication/cas_wrapper.py,/usr/**' manage.py test --settings=${ENVIRON}
- coverage report -m
- coverage xml -i
- sonar-scanner
-Dsonar.host.url=https://pmpl.cs.ui.ac.id/sonarqube
-Dsonar.projectKey=$SONARQUBE_PROJECT_KEY
-Dsonar.login=$SONARQUBE_TOKEN
-Dsonar.branch.name=$CI_COMMIT_REF_NAME
only:
- master
- staging
- development
- /^.*PBI-.*$/
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment