Re: How to configure Maven Installation via Groovy

2016-05-03 Thread Karl Davis
Baptiste,

This is great -- thanks! I had a hard time finding an example that'd 
auto-install Maven for me.

Best regards,
Karl M. Davis

On Saturday, January 23, 2016 at 8:38:45 AM UTC-5, Baptiste Mathus wrote:
>
>
> https://github.com/batmat/jez/blob/master/jenkins-master/init_scripts/add_maven_auto_installer.groovy
>
> auto-installs Maven 3.3.9 for example.
>
> HTH
>
> 2016-01-21 17:43 GMT+01:00 Антон Юшков >:
>
>> Useful for me:
>> import jenkins.model.*
>>
>> a=Jenkins.instance.getExtensionList(hudson.tasks.Maven.DescriptorImpl.
>> class)[0];
>> b=(a.installations as List);
>> b.add(new hudson.tasks.Maven.MavenInstallation("MAVEN", 
>> "/usr/local/maven", []));
>> a.installations=b
>> a.save()
>>
>>
>>
>> On Friday, January 9, 2015 at 2:08:17 AM UTC+4, Kenneth Baltrinic wrote:
>>>
>>> I am trying to build a chef recipe to deploy/manage our Jenkins 
>>> instances.  Things are going reasonably well but the ops-code Jenkin 
>>> cookbook only provides some basic configuration recipes. It does give you a 
>>> resource by which to run groovy scripts though and with that and the help 
>>> of a few blogs I have gotten some basic stuff set up.  However, now now I 
>>> am trying to do something quite simple in the UI but am stumped about how 
>>> to do this with a groovy script: Set up a Maven installation that installs 
>>> a specific version automatically.
>>>
>>> Here is what I think I have figured out so far:
>>>
>>>
>>> *import jenkins.model.**
>>>
>>> *def inst = Jenkins.getInstance()*
>>> *def desc = inst.getDescriptor('hudson.tasks.Maven')*
>>> *def installs = desc.getInstallations()*
>>>
>>> installs in this case seems to have the list of existing installs, but I 
>>> cannot figure out how to programatically add an install to it, for instance 
>>> I would like to add an installation that is named 'mvn-3-0-5' that 
>>> automatically installs maven v 3.0.5.
>>>
>>> Any idea on how I can do this?  Any help will be much appreciated.  
>>> Thanks.
>>>
>>> --Ken
>>>
>>> -- 
>> 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/6b4218ec-2008-490b-9b45-c1f283879219%40googlegroups.com
>>  
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/95a6f9d2-7859-4f9a-84b7-c81784e16e19%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to configure Maven Installation via Groovy

2016-01-23 Thread Baptiste Mathus
https://github.com/batmat/jez/blob/master/jenkins-master/init_scripts/add_maven_auto_installer.groovy

auto-installs Maven 3.3.9 for example.

HTH

2016-01-21 17:43 GMT+01:00 Антон Юшков :

> Useful for me:
> import jenkins.model.*
>
> a=Jenkins.instance.getExtensionList(hudson.tasks.Maven.DescriptorImpl.
> class)[0];
> b=(a.installations as List);
> b.add(new hudson.tasks.Maven.MavenInstallation("MAVEN", "/usr/local/maven"
> , []));
> a.installations=b
> a.save()
>
>
>
> On Friday, January 9, 2015 at 2:08:17 AM UTC+4, Kenneth Baltrinic wrote:
>>
>> I am trying to build a chef recipe to deploy/manage our Jenkins
>> instances.  Things are going reasonably well but the ops-code Jenkin
>> cookbook only provides some basic configuration recipes. It does give you a
>> resource by which to run groovy scripts though and with that and the help
>> of a few blogs I have gotten some basic stuff set up.  However, now now I
>> am trying to do something quite simple in the UI but am stumped about how
>> to do this with a groovy script: Set up a Maven installation that installs
>> a specific version automatically.
>>
>> Here is what I think I have figured out so far:
>>
>>
>> *import jenkins.model.**
>>
>> *def inst = Jenkins.getInstance()*
>> *def desc = inst.getDescriptor('hudson.tasks.Maven')*
>> *def installs = desc.getInstallations()*
>>
>> installs in this case seems to have the list of existing installs, but I
>> cannot figure out how to programatically add an install to it, for instance
>> I would like to add an installation that is named 'mvn-3-0-5' that
>> automatically installs maven v 3.0.5.
>>
>> Any idea on how I can do this?  Any help will be much appreciated.
>> Thanks.
>>
>> --Ken
>>
>> --
> 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-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/6b4218ec-2008-490b-9b45-c1f283879219%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CANWgJS717NjnOGdUhYYNuDAD-UN1yczF4eo1W1X5s1EGwAhOMw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to configure Maven Installation via Groovy

2016-01-21 Thread Антон Юшков
Useful for me:
import jenkins.model.*

a=Jenkins.instance.getExtensionList(hudson.tasks.Maven.DescriptorImpl.class
)[0];
b=(a.installations as List);
b.add(new hudson.tasks.Maven.MavenInstallation("MAVEN", "/usr/local/maven", 
[]));
a.installations=b
a.save()



On Friday, January 9, 2015 at 2:08:17 AM UTC+4, Kenneth Baltrinic wrote:
>
> I am trying to build a chef recipe to deploy/manage our Jenkins instances. 
>  Things are going reasonably well but the ops-code Jenkin cookbook only 
> provides some basic configuration recipes. It does give you a resource by 
> which to run groovy scripts though and with that and the help of a few 
> blogs I have gotten some basic stuff set up.  However, now now I am trying 
> to do something quite simple in the UI but am stumped about how to do this 
> with a groovy script: Set up a Maven installation that installs a specific 
> version automatically.
>
> Here is what I think I have figured out so far:
>
>
> *import jenkins.model.**
>
> *def inst = Jenkins.getInstance()*
> *def desc = inst.getDescriptor('hudson.tasks.Maven')*
> *def installs = desc.getInstallations()*
>
> installs in this case seems to have the list of existing installs, but I 
> cannot figure out how to programatically add an install to it, for instance 
> I would like to add an installation that is named 'mvn-3-0-5' that 
> automatically installs maven v 3.0.5.
>
> Any idea on how I can do this?  Any help will be much appreciated.  Thanks.
>
> --Ken
>
>

-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/6b4218ec-2008-490b-9b45-c1f283879219%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to configure Maven Installation via Groovy

2015-07-07 Thread plop gark
Hi,

I am facing the same issue.

Did you solve this problem ?

Do you have tips about that ?

Sincerely yours,

Benoit

-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/dd5a57fc-ef47-4ac0-856c-5c1444e365f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to configure Maven Installation via Groovy

2015-06-18 Thread Torben Knerr
Hi Ken,

did you solve that problem eventually?

I installed maven outside of jenkins now and it is available and on the 
PATH, but still I'd need to add it to Jenkins to make it aware of it.

A groovy script would be nice actually...

Cheers, Torben 



Am Donnerstag, 8. Januar 2015 23:08:17 UTC+1 schrieb Kenneth Baltrinic:
>
> I am trying to build a chef recipe to deploy/manage our Jenkins instances. 
>  Things are going reasonably well but the ops-code Jenkin cookbook only 
> provides some basic configuration recipes. It does give you a resource by 
> which to run groovy scripts though and with that and the help of a few 
> blogs I have gotten some basic stuff set up.  However, now now I am trying 
> to do something quite simple in the UI but am stumped about how to do this 
> with a groovy script: Set up a Maven installation that installs a specific 
> version automatically.
>
> Here is what I think I have figured out so far:
>
>
> *import jenkins.model.**
>
> *def inst = Jenkins.getInstance()*
> *def desc = inst.getDescriptor('hudson.tasks.Maven')*
> *def installs = desc.getInstallations()*
>
> installs in this case seems to have the list of existing installs, but I 
> cannot figure out how to programatically add an install to it, for instance 
> I would like to add an installation that is named 'mvn-3-0-5' that 
> automatically installs maven v 3.0.5.
>
> Any idea on how I can do this?  Any help will be much appreciated.  Thanks.
>
> --Ken
>
>

-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/f880b907-4c68-4598-bf78-7a7e0ba55539%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to configure Maven Installation via Groovy

2015-01-08 Thread Kenneth Baltrinic
I am trying to build a chef recipe to deploy/manage our Jenkins instances. 
 Things are going reasonably well but the ops-code Jenkin cookbook only 
provides some basic configuration recipes. It does give you a resource by 
which to run groovy scripts though and with that and the help of a few 
blogs I have gotten some basic stuff set up.  However, now now I am trying 
to do something quite simple in the UI but am stumped about how to do this 
with a groovy script: Set up a Maven installation that installs a specific 
version automatically.

Here is what I think I have figured out so far:


*import jenkins.model.**

*def inst = Jenkins.getInstance()*
*def desc = inst.getDescriptor('hudson.tasks.Maven')*
*def installs = desc.getInstallations()*

installs in this case seems to have the list of existing installs, but I 
cannot figure out how to programatically add an install to it, for instance 
I would like to add an installation that is named 'mvn-3-0-5' that 
automatically installs maven v 3.0.5.

Any idea on how I can do this?  Any help will be much appreciated.  Thanks.

--Ken

-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/563f2849-f165-434d-8f04-83a793c87fcd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.