Estu Fardani
Estu Fardani

Reputation: 87

Job DSL Pipeline Config Trigger

I want to know how can i use Job Dsl to configure trigger "Trigger build remotely" a pipeline job.

I need input string as Authentication Token. enter image description here

My sample code:

pipelineJob("PipelineJobs") {
  logRotator {
    daysToKeep(7)
    numToKeep(10)
  }
  concurrentBuild(false)
  parameters {
    stringParam('PHID',null,null)
    stringParam('SHA1',null,null)
  }
  triggers {

  }
}

Thanks.

Upvotes: 2

Views: 2219

Answers (1)

daspilker
daspilker

Reputation: 8194

Internally that option is not a trigger, so you can't find it within the triggers context.

You need to use authenticationToken on the job level, see the API Viewer

pipelineJob('example') {
  authenticationToken('secret')
}

Upvotes: 3

Related Questions