first configuring "Jenkins"

62 views
Skip to first unread message

Diego Lagos

unread,
Sep 20, 2017, 5:23:14 PM9/20/17
to Jenkins Users
I would like to ask you if there is a documentation explaining how to configure through files, plugins, nodes, git repositories, etc ... 
so you do not have to use the graphics console every time

Mark Waite

unread,
Sep 21, 2017, 12:49:35 AM9/21/17
to Jenkins Users
I use a docker image with copies of the relevant configuration files copied from a system that behaves the way I want.  It has worked quite well for me, and has avoided me spending any significant time investigating how to script the initial configuration.

Refer to https://github.com/MarkEWaite/docker-lfs/tree/lts-with-plugins for an example of that technique.

Others have preferred to script the initial configuration with groovy init scripts. 

I'm not aware of a definitive reference for groovy init scripts.  Refer to https://wiki.jenkins.io/display/JENKINS/Jenkins+Script+Console for groovy examples


Mark Waite

On Wed, Sep 20, 2017 at 3:23 PM Diego Lagos <diegomau...@gmail.com> wrote:
I would like to ask you if there is a documentation explaining how to configure through files, plugins, nodes, git repositories, etc ... 
so you do not have to use the graphics console every time

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/dfc5e3ea-5a33-445e-82d7-0d8c0c011fab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Diego Lagos

unread,
Sep 27, 2017, 11:24:55 AM9/27/17
to Jenkins Users
Thx so much

is a starting point, even if it is a limit that there is no direct thing to automatically configure jenkins without too much trouble

Mark Waite

unread,
Sep 27, 2017, 11:36:35 AM9/27/17
to jenkins...@googlegroups.com
On Wed, Sep 27, 2017 at 9:25 AM Diego Lagos <diegomau...@gmail.com> wrote:
Thx so much

is a starting point, even if it is a limit that there is no direct thing to automatically configure jenkins without too much trouble


I'm not sure I can envision a "direct thing to automatically configure" something that has 1300+ plugins which are allowed to increase its capabilities and modify its behavior.  The Jenkins ecosystem is interesting to users because it has so connections to so many things, and can help with so many different problems.

The current techniques (use groovy init scripts, keep copies of the configuration files) have different strengths and weaknesses.  

The groovy init scripts technique seems to be the preferred technique for expressing configuration as code.  The resulting scripts read like code, and are very clear about what they change.  Unfortunately, it generally takes more work to find examples, explore alternatives, and ultimately create the configuration you want.

The "keep copies of the configuration files" is easy to configure initially, but is not as easy to read or modify as the groovy init scripts technique.

Mark Waite
 

Martin Marcher

unread,
Sep 27, 2017, 1:41:04 PM9/27/17
to Jenkins Users
I would very much like to do the same.

If it helps, I have pretty clear picture of what I'd like to achieve. At least in my mind :)

* Run thru the setup steps that install the "default plugins", just like the ones when doing it manually
* Either one of:
** Make a setup so that Jenkins authenticates "everyone can do anything" to a given LDAP server.
** No authentication so that when I go to the Jenkins URL I am an administrator and can start configuring.

I'm having a hard time finding examples or docs, so if you have pointers maybe that would be enough. I just can't get a starting point. I'll try and take a look at the examples in https://wiki.jenkins.io/display/JENKINS/Jenkins+Script+Console now that I have a pointer to it...

Best,
Martin

Mark Waite

unread,
Sep 27, 2017, 2:32:07 PM9/27/17
to jenkins...@googlegroups.com
On Wed, Sep 27, 2017 at 11:41 AM Martin Marcher <mar...@marcher.name> wrote:
I would very much like to do the same.

If it helps, I have pretty clear picture of what I'd like to achieve. At least in my mind :)

* Run thru the setup steps that install the "default plugins", just like the ones when doing it manually
* Either one of:
** Make a setup so that Jenkins authenticates "everyone can do anything" to a given LDAP server.
** No authentication so that when I go to the Jenkins URL I am an administrator and can start configuring.

I'm having a hard time finding examples or docs, so if you have pointers maybe that would be enough. I just can't get a starting point. I'll try and take a look at the examples in https://wiki.jenkins.io/display/JENKINS/Jenkins+Script+Console now that I have a pointer to it...


I think that the technique you're trying to apply can be done entirely without scripts.  It is illustrated in the repository I shared earlier in this thread.
  1. Create a reference installation which is configured to meet your needs
  2. Copy the XML configuration files from the JENKINS_HOME directory
  3. Copy the plugins (hpi and/or jpi files) from the JENKINS_HOME/plugins directory
  4. Place those copies into your docker image (or onto the file system where you're testing your "fresh install" steps)
  5. Run that "fresh install", confirm that it preserved all the settings you need
Mark Waite
 
Best,
Martin


On Wednesday, September 20, 2017 at 11:23:14 PM UTC+2, Diego Lagos wrote:
I would like to ask you if there is a documentation explaining how to configure through files, plugins, nodes, git repositories, etc ... 
so you do not have to use the graphics console every time

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

Martin

unread,
Sep 27, 2017, 5:46:35 PM9/27/17
to jenkins...@googlegroups.com
On Wed, Sep 27, 2017 at 8:31 PM, Mark Waite <mark.ea...@gmail.com> wrote:

I think that the technique you're trying to apply can be done entirely without scripts.  It is illustrated in the repository I shared earlier in this thread.
  1. Create a reference installation which is configured to meet your needs
  2. Copy the XML configuration files from the JENKINS_HOME directory
  3. Copy the plugins (hpi and/or jpi files) from the JENKINS_HOME/plugins directory
  4. Place those copies into your docker image (or onto the file system where you're testing your "fresh install" steps)
  5. Run that "fresh install", confirm that it preserved all the settings you need
I get that this would be one way. I just find it to be ... not elegant enough.

I really think that this part of Jenkins is something is somehow way to hard to get done. To get stuff done I'll definitely go down that route but to minimize maintenance efforts I'd rather have it in a Groovy script (that is despite not having done a whole lot of it; actually: 0).

Using a scripting language and API just seems to be more "affordable" in the long run.

/Martin 


--

Ewelina Wilkosz

unread,
Sep 29, 2017, 9:11:20 AM9/29/17
to Jenkins Users
https://github.com/Praqma/JenkinsAsCodeReference is an interesting initiative, not perfect though.
it can anyway give you some idea about what and how to configure.
I'm currently working on a more "elegant" and easier to maintain solution, will announce it somewhere here for sure when it's ready to be announced :)

Diego Lagos

unread,
Oct 7, 2017, 5:36:19 AM10/7/17
to Jenkins Users
thanks to everyone for advice and resources, it is a great starting point
Reply all
Reply to author
Forward
0 new messages