Created
May 9, 2025 15:15
-
-
Save eeganlf/391ab3ed4b59bfb22a4ae8e219ca923a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline { | |
agent any | |
tools{ | |
maven 'maven 3.9.8' | |
} | |
stages{ | |
stage(build){ | |
when{ | |
changeset "**/worker/**" | |
} | |
steps{ | |
echo 'Compiling worker app..' | |
dir('worker'){ | |
sh 'mvn compile' | |
} | |
} | |
} | |
stage(test){ | |
when{ | |
changeset "**/worker/**" | |
} | |
steps{ | |
echo 'Running Unit Tests on worker app..' | |
dir('worker'){ | |
sh 'mvn clean test' | |
} | |
} | |
} | |
stage(package){ | |
when{ | |
branch 'master' | |
changeset "**/worker/**" | |
} | |
steps{ | |
echo 'Packaging worker app' | |
dir('worker'){ | |
sh 'mvn package -DskipTests' | |
archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true } | |
} | |
} | |
} | |
post{ | |
always{ | |
echo 'Building multibranch pipeline for worker is completed..' | |
} | |
failure{ | |
slackSend (channel: "instavote-cd", message: "Build Failed - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)") } | |
success{ | |
slackSend (channel: "instavote-cd", message: "Build Succeeded - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)") | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment