bib-watcher/Jenkinsfile

53 lines
1.2 KiB
Plaintext
Raw Normal View History

2023-11-10 17:19:44 +00:00
pipeline {
2023-11-10 17:41:23 +00:00
agent any
options {
buildDiscarder(logRotator(numToKeepStr: "100"))
skipDefaultCheckout(true)
}
triggers {
pollSCM("*/10 * * * *")
}
environment {
2023-11-10 17:58:06 +00:00
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"
2023-11-10 17:41:23 +00:00
}
stages {
stage('Checkout'){
steps{
cleanWs()
checkout scm
}
2023-11-10 17:19:44 +00:00
}
2023-11-10 17:41:23 +00:00
stage('Clean'){
steps {
2023-11-10 17:58:06 +00:00
withEnv(["PATH+RUST=$HOME/.cargo/bin"]) { // Cargo needs to be installed for the jenkins user
2023-11-10 17:41:23 +00:00
sh 'cargo clean'
2023-11-10 17:19:44 +00:00
}
2023-11-10 17:41:23 +00:00
}
}
stage('Build'){
steps {
2023-11-10 17:58:06 +00:00
withSonarQubeEnv(installationName: 'SQ Bib Watcher', envOnly: true) {
2023-11-10 17:41:23 +00:00
withEnv(["PATH+RUST=$HOME/.cargo/bin"]) {
sh 'cargo build --release'
}
2023-11-10 17:19:44 +00:00
}
2023-11-10 17:41:23 +00:00
}
}
/*
stage('SonarQube Analysis') {
steps {
withSonarQubeEnv('grover.local:9000') {
2023-11-10 17:58:06 +00:00
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
"""
2023-11-10 17:19:44 +00:00
}
2023-11-10 17:41:23 +00:00
}
2023-11-10 17:19:44 +00:00
}
2023-11-10 17:41:23 +00:00
*/
}
2023-11-10 17:19:44 +00:00
}