Skip to content

Latest commit

 

History

History
41 lines (37 loc) · 884 Bytes

README.md

File metadata and controls

41 lines (37 loc) · 884 Bytes

Pipeline with post actions

JENKINSFILE2

Windows [Note :use sh instead of bat for Linux]

pipeline {
    agent any
    stages {
        stage('build') {
            steps {
                bat 'python -V'
            }
        }
    }
 post {
        always {
            echo 'Always'
        }
        success {
            echo 'Only on SUCCESS'
        }
        failure {
            echo 'Only on Failure'
        }
        unstable {
            echo 'Only if run is unstable'
        }
        changed {
            echo 'Only if status changed from Success to Failure or vice versa w.r.t. last run.'
        }
    }
}

The steps alway run in order: always, changed, success, unstable, failure