Add jenkins build #1
19
Jenkinsfile
vendored
19
Jenkinsfile
vendored
@ -7,13 +7,12 @@ pipeline {
|
||||
triggers {
|
||||
pollSCM("*/10 * * * *")
|
||||
}
|
||||
/*
|
||||
environment {
|
||||
MSBUILD_SQ_SCANNER_HOME = tool name: 'sonarscanner', type: 'hudson.plugins.sonar.MsBuildSQRunnerInstallation'
|
||||
DOTNET_USE_POLLING_FILE_WATCHER = true
|
||||
DOTNET_HOSTBUILDER__RELOADCONFIGONCHANGE = false
|
||||
SONAR_SCANNER_VERSION=4.7.0.2747
|
||||
SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux
|
||||
PATH=$SONAR_SCANNER_HOME/bin:$PATH
|
||||
SONAR_SCANNER_OPTS="-server"
|
||||
}
|
||||
*/
|
||||
stages {
|
||||
stage('Checkout'){
|
||||
steps{
|
||||
@ -23,14 +22,14 @@ pipeline {
|
||||
}
|
||||
stage('Clean'){
|
||||
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'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Build'){
|
||||
steps {
|
||||
withSonarQubeEnv(installationName: 'grover.local:9000', envOnly: true) {
|
||||
withSonarQubeEnv(installationName: 'SQ Bib Watcher', envOnly: true) {
|
||||
withEnv(["PATH+RUST=$HOME/.cargo/bin"]) {
|
||||
sh 'cargo build --release'
|
||||
}
|
||||
@ -41,7 +40,11 @@ pipeline {
|
||||
stage('SonarQube Analysis') {
|
||||
steps {
|
||||
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