Skip to content
Jeffrey Carpenter edited this page Apr 23, 2026 · 2 revisions


Jenkinsfile

WIP Jenkinsfile examples

usage

generic pipeline

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.'
        }
    }
}

ntfy hook

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"
    }
}

Reference Links

Clone this wiki locally