Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save darinpope/9f3f2c304f38686f65672e495a14a226 to your computer and use it in GitHub Desktop.
Save darinpope/9f3f2c304f38686f65672e495a14a226 to your computer and use it in GitHub Desktop.

Gist for https://youtu.be/TeBqlW_4zVU

Documentation

Jenkinsfiles

Example 1

pipeline {
  agent any
  stages {
    stage('Hello') {
      steps {
        unstable(message:'forcing unstable')
      }
    }
  }
}

Example 2

pipeline {
  agent any
  stages {
    stage('Hello') {
      steps {
        unstable(message:'forcing unstable')
      }
    }
  }
  post {
    unstable {
      sh 'echo post unstable'
    }
  }
}

Example 3

pipeline {
  agent any
  stages {
    stage('Hello') {
      steps {
        warnError(message:'watch this') {
            sh 'exit 0'
        }
      }
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment