Skip to content

Instantly share code, notes, and snippets.

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

Gist for https://youtu.be/y_z8mqV8G68

Documentation

Initial job

pipeline {
  agent any
  stages {
    stage('Hello') {
      steps {
        sh 'echo Hello World'
        sleep 60
      }
    }
  }
}

Job with lock

pipeline {
  agent any
  stages {
    stage('Hello') {
      steps {
        lock('my-unique-resource') {
          sh 'echo Hello World'
          sleep 60
        }
      }
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment