Automatic build and deploy of plugin (CI style)

44 views
Skip to first unread message

Gavin Mogan

unread,
Dec 23, 2015, 2:39:41 PM12/23/15
to Jenkins Developers
Hey everyone

I can't decide if this belongs on the user list or the dev list but trying here first.

Has anyone come up with a way (maven or jenkins) to automatically deploy a plugin to a jenkins instance? I want to setup a nice demo server that always has the latest version of our plugin, but don't want to go through the steps of having to manually goto the plugins page, then upload, then wait, then restart, etc.

I can probably script something with the cli tool, but don't want to duplicate work.

Gavin

Mark Waite

unread,
Dec 23, 2015, 2:59:17 PM12/23/15
to Jenkins Developers
jenkins-cli.jar includes the install-plugin command which can install a plugin.  It can also do a safe restart of the Jenkins server (may be needed after the plugin installation).

Mark Waite

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/7444f258-8e22-4296-8d91-7988648227f6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Baptiste Mathus

unread,
Dec 24, 2015, 2:16:23 AM12/24/15
to jenkin...@googlegroups.com
Another solution can be to use Docker. Your Dockerfile would be something like:

FROM jenkins:1.625.3
ADD yourplugin.hpi /usr/share/jenkins/ref/plugins/yourplugin.jpi

Then build [ && push ] && run.

My 2 cents.


For more options, visit https://groups.google.com/d/optout.



--
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !

Gavin Mogan

unread,
Dec 24, 2015, 2:20:44 AM12/24/15
to jenkin...@googlegroups.com
I ended up going with jenkins-cli. Also forgot I could use cli remotely (But wasn't necessary in this case).

Docker would totally be a solution if I was using docker to start with.

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-dev/oxeeeFVrK98/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANWgJS7OXOGDR%2BoMWOPRhs5h-hkoUewUe3g1yxsi%2BYeJ9GVVDA%40mail.gmail.com.

Mark Waite

unread,
Dec 24, 2015, 2:22:43 AM12/24/15
to jenkin...@googlegroups.com
If a Docker container is an option, then you might consider https://github.com/jenkinsci/docker (I think that is the likely source of jenkins:1.625.3) or might even look at https://github.com/MarkEWaite/docker/tree/master-with-plugins for a derivative that reduces Docker instance build time by keeping plugin copies in the ref/plugins directory.

Mark Waite

Victor Martinez

unread,
Dec 24, 2015, 7:59:18 AM12/24/15
to Jenkins Developers
Hi there,

Have you considered to use any Config. mgmt tool? Ansible, Chef and Puppet provides that feature. You can either run those agents cronly or push based.

Cheers

Samuel Van Oort

unread,
Dec 30, 2015, 11:16:36 AM12/30/15
to Jenkins Developers
Hi,

As a side note, if you're building out demo machines with a precanned config, there are some really helpful scripts in the Jenkins docker image repo.
Even if you're not running docker, the scripts and techniques should work well on demo VMs.

To preinstall a list of plugins from the update center, listed in a text file:

To land a precanned jenkins home (which can be preloaded with your plugin HPI) and use it to start up:

A couple examples of how these scripts were used are here:

-- Sam

Samuel Van Oort

unread,
Dec 30, 2015, 11:17:00 AM12/30/15
to Jenkins Developers
Hi,

As a side note, if you're building out demo machines with a precanned config, there are some really helpful scripts in the Jenkins docker image repo.
Even if you're not running docker, the scripts and techniques should work well on demo VMs.

To preinstall a list of plugins from the update center, listed in a text file:

To land a precanned jenkins home (which can be preloaded with your plugin HPI) and use it to start up:

A couple examples of how these scripts were used are here:

-- Sam

On Wednesday, December 23, 2015 at 2:39:41 PM UTC-5, Gavin Mogan wrote:
Reply all
Reply to author
Forward
0 new messages