Convert jenkins job/project to pipeline

Install the plugin: Convert To Pipeline Plugin

The plugin provides a link on the left menu at 3 locations:

Root Level
Folder Level
Freestyle Job level

 

Click on the link at any given level and a UI similar to below will appear:

Usage

  1. Click on a link at Root level or Folder level or Job level.
  2. Select the job from the drop-down list that is the beginning point of the “chain”. If job level link is clicked, this drop down list will not be visible.
  3. Provide the new pipeline job name. If this is not specified, the plugin will attempt to create a new pipeline job with the naming convention of “oldname-pipeline”.
  4. Check “Recursively convert downstream jobs if any?” if you wish to have all the downstream jobs converted into this new pipeline. The plugin will write all the logic of current and downstream jobs into a single pipeline.
  5. Check “Commit Jenkinsfile?” if you would like the plugin to create a Jenkinsfile and commit it back to the SCM. The plugin will commit the Jenkinsfile at the root of the SCM repository it finds in the first job (selected in step 1 above). It will attempt to commit to this repo using the credentials it finds in the first job.
    1. Do note that the plugin will checkout the repo in to a temporary workspace on the master (JENKINS_HOME/plugins/convert-to-pipeline/ws). Once the conversion is complete and Jenkinsfile is committed back to the repo, the workspace will be deleted.
  6. Click “Convert” to convert the Freestyle job configurations in to a single scripted pipeline job. Once the conversion is complete and the new job is created, you will be redirected to the newly created pipeline job.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s