Add jenkins build #1
19
Jenkinsfile
vendored
19
Jenkinsfile
vendored
@ -7,13 +7,12 @@ pipeline {
|
|||||||
triggers {
|
triggers {
|
||||||
pollSCM("*/10 * * * *")
|
pollSCM("*/10 * * * *")
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
environment {
|
environment {
|
||||||
MSBUILD_SQ_SCANNER_HOME = tool name: 'sonarscanner', type: 'hudson.plugins.sonar.MsBuildSQRunnerInstallation'
|
SONAR_SCANNER_VERSION=4.7.0.2747
|
||||||
DOTNET_USE_POLLING_FILE_WATCHER = true
|
SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux
|
||||||
DOTNET_HOSTBUILDER__RELOADCONFIGONCHANGE = false
|
PATH=$SONAR_SCANNER_HOME/bin:$PATH
|
||||||
|
SONAR_SCANNER_OPTS="-server"
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
stages {
|
stages {
|
||||||
stage('Checkout'){
|
stage('Checkout'){
|
||||||
steps{
|
steps{
|
||||||
@ -23,14 +22,14 @@ pipeline {
|
|||||||
}
|
}
|
||||||
stage('Clean'){
|
stage('Clean'){
|
||||||
steps {
|
steps {
|
||||||
withEnv(["PATH+RUST=$HOME/.cargo/bin"]) {
|
withEnv(["PATH+RUST=$HOME/.cargo/bin"]) { // Cargo needs to be installed for the jenkins user
|
||||||
sh 'cargo clean'
|
sh 'cargo clean'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Build'){
|
stage('Build'){
|
||||||
steps {
|
steps {
|
||||||
withSonarQubeEnv(installationName: 'grover.local:9000', envOnly: true) {
|
withSonarQubeEnv(installationName: 'SQ Bib Watcher', envOnly: true) {
|
||||||
withEnv(["PATH+RUST=$HOME/.cargo/bin"]) {
|
withEnv(["PATH+RUST=$HOME/.cargo/bin"]) {
|
||||||
sh 'cargo build --release'
|
sh 'cargo build --release'
|
||||||
}
|
}
|
||||||
@ -41,7 +40,11 @@ pipeline {
|
|||||||
stage('SonarQube Analysis') {
|
stage('SonarQube Analysis') {
|
||||||
steps {
|
steps {
|
||||||
withSonarQubeEnv('grover.local:9000') {
|
withSonarQubeEnv('grover.local:9000') {
|
||||||
sh "dotnet ${MSBUILD_SQ_SCANNER_HOME}/SonarScanner.MSBuild.dll end"
|
sh """
|
||||||
|
printenv
|
||||||
|
cargo clippy --message-format=json &> clippy-output.json
|
||||||
|
sonar-scanner -Dsonar.projectKey=bib-watcher -Dsonar.sources=. -Dsonar.host.url=http://grover.local:9000
|
||||||
|
"""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
1
sonar-project.properties
Normal file
1
sonar-project.properties
Normal file
@ -0,0 +1 @@
|
|||||||
|
community.rust.clippy.reportPaths=clippy-output.json
|
Loading…
Reference in New Issue
Block a user