ghale / gradle-jenkins-plugin

Gradle plugin to programmatically configure Jenkins jobs.
123 stars 42 forks source link

Manage Jenkins CI plugins #46

Open itavero opened 10 years ago

itavero commented 10 years ago

I don't know if this is at all possible, but it would be nice to add "dependencies" for certain Jenkins CI plugins. Then, when updating the jobs, it should check if these plugins are installed and install them if they are not yet present.

We are thinking about using this plugin and Gradle to setup new projects. This way configuring a new build server would be easier than ever (just run a single Gradle task and you're good to go).

ghale commented 10 years ago

This used to not be possible, but it looks like they've added support for this at some point. Let me take a look at it and see if I can use it to provide this capability.

itavero commented 9 years ago

Awesome! If I can help in any way, please let me know and I'll see what I can do. :+1:

inka commented 9 years ago

+1 would really appreciate this feature

itavero commented 9 years ago

Perhaps I'll have some time in the coming weeks to add this functionality. I'll let you know if/when I start working on it :wink:

inka commented 9 years ago

Have done some research how to do this. Probably this should work via HTTP POST like described here https://gist.github.com/basmussen/8182784 or via jenkins-cli https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/cli/InstallPluginCommand.java

Could imagine a really simple DSL extension:

jenkins {
    servers {
    [...]
    }
    plugins {
        git:2.3.4
        gradle:latest
    }
    jobs {
    [...]
    }
}
ghale commented 9 years ago

I'd really welcome a contribution for this. I just haven't had the time lately to devote to it.

itavero commented 9 years ago

Finally found some time to look into this. Apparently plug-ins can be installed by sending an XML containing the plug-ins and the version you wish to install (have a look at this blogpost). I would like to implement this in your plug-in, however I first need to wrap my head around the code. Is it just me or do a lot of (internal) interfaces not have any documentation at all?

itavero commented 9 years ago

Additional notes:

This should return at least the default update-center.json link. This JSON file contains data that can be used to provide a mechanism saying that you wish to install the latest version of a plugin, for example.