Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to convert a Jenkins free-style job to a multi-configuration job?

Tags:

I have quite a few free-style jobs in Jenkins that I would like to convert to multi-configuration jobs so I can build across multiple platforms under one job. These jobs specify quite a few build parameters and I would like to not have to set them up manually again by creating new multi-configuration jobs. Each job is currently limiting their builds to the platform we've been building on and the only other option I see is to clone the existing job and change the restriction to the new platform. This isn't ideal as I'll need to maintain 2 jobs where the only difference is the target platform.

I don't see a way to do this via the UI, but wondering if there is another way.

like image 346
RC. Avatar asked Oct 03 '11 14:10

RC.


People also ask

Is it possible to run a Jenkinsfile from a freestyle project?

Generating a Jenkinsfile from a project for FreestyleIn the text editor or GUI, a Jenkinsfile can be generated. The file is maintained either with the project code or, for example, a software configuration management (SCM) tool like Git in a separate repository.

Can a single Jenkin job run on multiple nodes?

Step 1− If multi node selection was enabled, you get the chance to select multiple nodes to run the job on. The job will then be executed on each of the nodes, one after the other or concurrent - depending on the configuration.


1 Answers

As far as I know, there's no way to convert the type of job in the UI. You'll have to either edit the job's config.xml, or copy and edit the config file and create a new job based on the edited configuration.

You'll have to check the differences between a free-style and multi-configuration job with the various settings that you use. It might be as simple as changing the top-level element in config.xml from project to matrix-project.

If you edit the existing job configuration, you'll need to either do it while Jenkins is offline, or tell Jenkins to reload its configuration via Manage Jenkins -> Reload Configuration from Disk.

If you decide to create new jobs, this previous question might be helpful once you figure out what edits need to be made. Specifically this answer describes how to upload a config file to create a new job.

like image 123
Dave Bacher Avatar answered Sep 25 '22 07:09

Dave Bacher