Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def imageName="192.168.44.44:8082/docker_registry/frontend"
- pipeline {
- agent {
- label 'agent'
- }
- environment {
- PIP_BREAK_SYSTEM_PACKAGES = 1
- scannerHome = tool 'SonarQube'
- }
- stages {
- stage('Get Code') {
- steps {
- git branch: 'jenkinsfile', url: 'https://github.com/Panda-Academy-Core-2-0/Frontend'
- }
- }
- stage('Unit tests') {
- steps {
- sh "pip3 install -r requirements.txt"
- sh "python3 -m pytest --cov=. --cov-report xml:test-results/coverage.xml --junitxml=test-results/pytest-report.xml"
- }
- }
- stage('Sonarqube analysis') {
- steps {
- withSonarQubeEnv('SonarQube') {
- sh "${scannerHome}/bin/sonar-scanner"
- }
- }
- }
- stage('Build application image') {
- steps {
- script {
- applicationImage = docker.build("$imageName")
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement