-
Notifications
You must be signed in to change notification settings - Fork 2
Jenkinsfile
Jeffrey Carpenter edited this page Apr 23, 2026
·
2 revisions
WIP Jenkinsfile examples
pipeline {
agent any // Run on any available agent
environment {
APP_NAME = 'my-app'
}
stages {
stage('Build') {
steps {
echo 'Building...'
sh './mvnw clean compile' // Example shell command
}
}
stage('Test') {
steps {
echo 'Testing...'
sh './mvnw test'
junit '**/target/surefire-reports/*.xml' // Record test results
}
}
stage('Deploy') {
steps {
echo 'Deploying...'
// Add deployment steps here
}
}
}
post {
always {
echo 'Pipeline finished.'
}
failure {
echo 'The pipeline failed.'
}
}
}We can integrate ntfy notifications via a curl hook as shown below:
post {
always {
sh "curl -d 'Build ${currentBuild.fullDisplayName} - ${currentBuild.result}' https://notifications.479831.xyz/jenkins"
}
}