Skip to content

Early pipeline support

Pre-release
Pre-release
Compare
Choose a tag to compare
@mchugh19 mchugh19 released this 14 Nov 11:36
· 135 commits to master since this release

A super early draft of version 2 of the saltstack plugin.

This supports:

  • running salt via a jenkins pipeline
  • large cleanups
  • salt subset support
  • detect minion timeouts in order to fail build
  • allow parameterized batch size

Example pipeline

def userInput
stage('prompt') {
  userInput = input message: 'Change parameters?', parameters: [
    string(defaultValue: 'master', description: 'What machines to target with command', name: 'target'),    
    string(defaultValue: 'runas=jenkins', description: 'Any kwargs', name: 'kwarguments')
    ]
  echo ("target is: "+userInput['target'])
}

stage('execute salt') {
  node {
    echo ("kwarguments is: "+userInput['kwarguments'])
    salt arguments: 'ls -la', authtype: 'pam', clientInterface: local(blockbuild: false, jobPollTime: 5, target: userInput['target'], targetType: 'glob'), credentialsId: 'a3d814c2-84ed-4752-94a8-271791bb5375', function: 'cmd.run', kwarguments: userInput['kwarguments'], servername: 'http://localhost:8000', target: 'master', targettype: 'glob'
  }
}