Skip to content

Commit

Permalink
added jenkins to master
Browse files Browse the repository at this point in the history
  • Loading branch information
Suchty112 authored Sep 9, 2017
1 parent 2712fe4 commit 544caa6
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
pipeline {
agent any

stages {
stage('Build') {
steps {
echo 'GIT CLONE'
checkout scm

echo 'SONARQUBE'
script {
def workspace = pwd()
def extraParameter = ""

try {
if (CHANGE_ID) {
extraParameter = " -Dsonar.github.pullRequest=${CHANGE_ID} -Dsonar.analysis.mode=preview"
} else {
extraParameter = ""
}
} catch (exception) {
echo 'Kein PR'
}


withSonarQubeEnv('Sonar') {
withCredentials([string(credentialsId: 'LssmBotAuthKey', variable: 'TOKEN')]) {
sh "/var/lib/jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/SonarqubeScanner/bin/sonar-scanner -Dproject.settings=sonar.properties -Dsonar.branch=$BRANCH_NAME -Dsonar.projectBaseDir=$WORKSPACE -Dsonar.login=$SONAR_AUTH_TOKEN -Dsonar.github.oauth=$TOKEN $extraParameter"
}
}
}
}
}
}
}

0 comments on commit 544caa6

Please sign in to comment.