Converting pipeline job to dsl, actions node

26 views
Skip to first unread message

Kirk Fitzsimons

unread,
Mar 22, 2024, 5:59:38 AMMar 22
to job-dsl-plugin
Hi, 

I am trying to convert pipeline jobs to dsl, I have converted all the elements in the source job config.xml to dsl, but I am unsure what to do with the <actions> element in the xml

Source job config.xml:

 <actions>
    <org.jenkinsci.plugins.pipeline.modeldefinition.actions.DeclarativeJobAction plugin="pipeline-mod...@2.2114.v2654ca_721309"/>
    <org.jenkinsci.plugins.pipeline.modeldefinition.actions.DeclarativeJobPropertyTrackerAction plugin="pipeline-mod...@2.2114.v2654ca_721309">
      <jobProperties>
        <string>org.jenkinsci.plugins.workflow.job.properties.DisableConcurrentBuildsJobProperty</string>
        <string>jenkins.model.BuildDiscarderProperty</string>
      </jobProperties>
      <triggers>
        <string>hudson.triggers.TimerTrigger</string>
      </triggers>
      <parameters/>
      <options/>
    </org.jenkinsci.plugins.pipeline.modeldefinition.actions.DeclarativeJobPropertyTrackerAction>
  </actions>

In the job dsl I have used the following configure block to generate the above:

configure { flowdefinition ->
    flowdefinition / 'actions' << 'org.jenkinsci.plugins.pipeline.modeldefinition.actions.DeclarativeJobAction'(plugin:'pipeline-mod...@2.2114.v2654ca_721309')
    flowdefinition / 'actions' << 'org.jenkinsci.plugins.pipeline.modeldefinition.actions.DeclarativeJobPropertyTrackerAction'(plugin:'pipeline-mod...@2.2114.v2654ca_721309') {
      'jobProperties' {
        'string'('org.jenkinsci.plugins.workflow.job.properties.DisableConcurrentBuildsJobProperty')
        'string'('jenkins.model.BuildDiscarderProperty')
      }
      'triggers' {
        'string'('hudson.triggers.TimerTrigger')
      }
      'parameters'()
      'options'()
    }
  }

It works.

But my question is, am i doing the correct thing, should actions get converted/translated? I can not see any documentation on how to handle actions?

Kirk

Kirk Fitzsimons

unread,
Apr 16, 2024, 2:57:09 AMApr 16
to job-dsl-plugin
Any ideas?
Reply all
Reply to author
Forward
0 new messages