2020-01-30 17:02:13 +01:00
|
|
|
#!/usr/bin/env groovy
|
|
|
|
|
|
|
|
pipeline {
|
|
|
|
|
2020-01-30 17:13:10 +01:00
|
|
|
agent any
|
|
|
|
|
2020-01-30 17:09:39 +01:00
|
|
|
stages{
|
|
|
|
stage('checkout VCS'){
|
|
|
|
steps{
|
2020-01-30 17:02:13 +01:00
|
|
|
checkout scm
|
|
|
|
}
|
2020-01-30 17:13:10 +01:00
|
|
|
}
|
2020-01-30 17:02:13 +01:00
|
|
|
|
2020-01-30 17:13:10 +01:00
|
|
|
stage('compile'){
|
2020-01-30 17:14:31 +01:00
|
|
|
steps{
|
|
|
|
sh 'echo "fake-compiling..."'
|
|
|
|
}
|
2020-01-30 17:13:10 +01:00
|
|
|
}
|
2020-01-30 17:02:13 +01:00
|
|
|
|
2020-01-30 17:13:10 +01:00
|
|
|
stage('deploySONAR'){
|
2020-01-30 17:14:31 +01:00
|
|
|
steps{
|
2020-01-30 17:16:32 +01:00
|
|
|
sh '/var/jenkins_home/sonar-scanner-4.2.0.1873-linux/bin/sonar-scanner'
|
2020-01-30 17:14:31 +01:00
|
|
|
}
|
2020-01-30 17:13:10 +01:00
|
|
|
}
|
2020-01-30 17:02:13 +01:00
|
|
|
}
|
2020-01-30 17:05:04 +01:00
|
|
|
post {
|
2020-01-30 17:02:13 +01:00
|
|
|
unstable {
|
|
|
|
script {
|
|
|
|
notifier.sendMail("CI Build Job ${env.JOB_NAME} [${env.BUILD_NUMBER}] is unstable, please fix it in the near future", "**/*.log")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
failure {
|
|
|
|
script {
|
|
|
|
notifier.sendMail("Error while run CI Build Job ${env.JOB_NAME} [${env.BUILD_NUMBER}]", "**/*.log")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fixed {
|
|
|
|
script {
|
|
|
|
notifier.sendMail("CI Build Job ${env.JOB_NAME} [${env.BUILD_NUMBER}] is stable again :-)", "**/*.log")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-01-30 17:05:04 +01:00
|
|
|
}
|