Create single use nodes

2017-01-09 Thread Patrick van der Velde
Hi all

Is it possible for jenkins to use nodes only a for a single job instance? 
i.e. what I would like is this:

* A new job is queued
* Jenkins checks the job labels and determines which node template could be 
used to create a node
* Jenkins creates the node from the template and assigns the job to the node
* Once the job completes Jenkins deletes the node

I think the first few steps are possible with the 'clouds' approach (e.g. 
docker or nomad clouds) however what I haven't been able to figure out is 
the final step. I want a node to be used exactly once and then to be shut 
down. That way each job has a fresh environment to work with. Obviously 
that doesn't work with physical boxes (or even VMs, as the boot time is 
rather large) but it would work with containers.

Is there a plugin that can handle this?

Thanks

Petrik

-- 
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/2ee0c607-d747-468a-b9c9-30b292e7ed67%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using mailer publisher inside Jenkinsfile

2017-01-09 Thread Raffaele Sgarro
The problem is that both Mailer and Email-ext require wrapping steps inside
a try/catch or equivalent. I already use Mailer activated by the catchError
trigger, but hoped to find a declarative solution because loops and
branches are too scripty for a Jenkinsfile in my opinion (I don't want,
should not need and definitely don't know how to test pipeline files).

However this is how things work and I guess there must be valid reasons for
it. Thanks for your support!

Il mar 10 gen 2017 00:53 Slide  ha scritto:

> For pipeline you have two options:
>
> https://jenkins.io/doc/pipeline/steps/workflow-basic-steps/#mail-mail
>
> https://jenkins.io/doc/pipeline/steps/email-ext/
>
> The first uses the bundled Mailer plugin, the second uses Email-ext, which
> allows for more options.
>
> On Mon, Jan 9, 2017 at 4:36 PM Raffaele Sgarro 
> wrote:
>
> Hi Ohad! As I understand from your kind message, the job DSL is not
> available in a Jenkinsfile. The jobDsl trick is clearly a hack and I
> prefer keeping it simple, even if try-finally and if-else constructs
> don't really belong to a declarative way of describing a pipeline.
>
> May I ask if you think this (configuring the mailer publisher via 
> stage([$class:
> 'Mailer'])) is intended or just not implemented yet?
>
> --
>
> 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/58191228-334c-45e0-84eb-f602a2105792%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/jenkinsci-users/VWnkOYPOKTA/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CAPiUgVeMFGbn-NYmS_%3DSzTa7mV8bZCRVoVDeextBMWLFV7ih%2Bw%40mail.gmail.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/CAKg%3D9UUXNyZPPEekyWTZVgFB5Rvk7w7bTJAiLqBdadN0%2BDA0Pw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using mailer publisher inside Jenkinsfile

2017-01-09 Thread Slide
For pipeline you have two options:

https://jenkins.io/doc/pipeline/steps/workflow-basic-steps/#mail-mail

https://jenkins.io/doc/pipeline/steps/email-ext/

The first uses the bundled Mailer plugin, the second uses Email-ext, which
allows for more options.

On Mon, Jan 9, 2017 at 4:36 PM Raffaele Sgarro 
wrote:

> Hi Ohad! As I understand from your kind message, the job DSL is not
> available in a Jenkinsfile. The jobDsl trick is clearly a hack and I
> prefer keeping it simple, even if try-finally and if-else constructs
> don't really belong to a declarative way of describing a pipeline.
>
> May I ask if you think this (configuring the mailer publisher via 
> stage([$class:
> 'Mailer'])) is intended or just not implemented yet?
>
> --
> 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/58191228-334c-45e0-84eb-f602a2105792%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/CAPiUgVeMFGbn-NYmS_%3DSzTa7mV8bZCRVoVDeextBMWLFV7ih%2Bw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Get the root directory of node in Pipeline

2017-01-09 Thread Indra Gunawan (ingunawa)
How about this :


import jenkins.model.*

node () {
def nodeName = ${env.NODE_NAME}
def nodeRootPath = nodeRootDir(nodeName)
...

}

@NonCPS
def nodeRootDir(nodeName) {
for (node in Jenkins.instance.nodes) {
if ( !nodeName.equals('master') && node.name.equals(nodeName) ) 
{
return node.getRootPath()
break
}
}
}

On 1/9/17, 9:01 AM, "jenkinsci-users@googlegroups.com on behalf of Kristian" 
 
wrote:

This gives me the workspace of the job. But I want the root directory
which I set when I create a new slave node in Jenkins.

So, as an example, I create a new slave node. The root directory i am
setting there is /home/jenkins.
Currently, when I run a job, I get "/home/jenkins/workspace/Some Job
Name" when running pwd(). But I want only this "/home/jenkins" stuff.


2017-01-09 17:54 GMT+01:00 Slide :
> You can use pwd, to get it.
>
> node() {
>ROOT = pwd()
> }
>
> On Mon, Jan 9, 2017 at 9:45 AM Kristian  
wrote:
>>
>> Hi,
>>
>> do someone knows how to get the root directory of a node in a Pipeline
>> script?
>>
>> --
>> 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/CAO5HUhMvCZXGLe91bb4W%3DpHGH470C2QbVF5CX70XdeL0aYm5_A%40mail.gmail.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/CAPiUgVfJ0UjVfPnQhq8rTsj6Sde9uCUKOopQzJfLRRegLiWE1Q%40mail.gmail.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/CAO5HUhOBwpNj0aEoB3G_sWYaZAExoakgmSX9udSx7CvQQeCYdw%40mail.gmail.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/3E417B6C-4745-4E56-BF49-9DA1E8579708%40cisco.com.
For more options, visit https://groups.google.com/d/optout.


Maximum number of executors?

2017-01-09 Thread Jakov Sosic

Hi guys,

I'm wondering what is the highest number of executors on a single 
jenkins master instance that you have seen?


What number of executors is some kind of theoretical maximum for 
Jenkins, and are there any information at which number Master gets 
overwhelmed?



I'm currently running single master, with 360 executors on 3 slaves, but 
am getting executors starvations from time to time.


I was thinking of battling it with dynamic slaves, but I've heard that 
it's not very good idea to run more then 100 executors per a single 
Jenkins master instance.


What are your thoughts / experiences with this?


Thanks,

Jakov

--
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/ab321ca7-e682-fc43-53c3-20292194ba7b%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using mailer publisher inside Jenkinsfile

2017-01-09 Thread Raffaele Sgarro
Hi Ohad! As I understand from your kind message, the job DSL is not 
available in a Jenkinsfile. The jobDsl trick is clearly a hack and I prefer 
keeping it simple, even if try-finally and if-else constructs don't really 
belong to a declarative way of describing a pipeline.

May I ask if you think this (configuring the mailer publisher via 
stage([$class: 
'Mailer'])) is intended or just not implemented yet?

-- 
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/58191228-334c-45e0-84eb-f602a2105792%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Nexus plugins can't connect to my fresh Nexus install

2017-01-09 Thread Khurram Nizami
I'm having the same problem.  Where you able to resolve it?  Maybe this is 
an issue with Nexus 3.2.X and the Jenkins Plugin?

On Thursday, November 17, 2016 at 4:14:30 AM UTC-6, Arnaud wrote:
>
> Hi 
>
> I installed both "Nexus Jenkins plugin" and "Nexus task runner plugin", 
> but in the Jenkins "Configure System" page, none of them can connect to my 
> local Nexus server. 
>
> I tried "http://localhost:8081;  (and also "http://localhost:8081/nexus; 
> as seen in the Nexus doc, even if it is not the correct url) but the "test 
> connection" button says :
>
> Nexus Repository Manager 2.x connection failed 
>
> com.sonatype.nexus.api.exception.RepositoryManagerException: Could not 
> retrieve list of repositories
> at com.sonatype.nexus.api.b.getRepositoryList(SourceFile:68)
> at 
> com.sonatype.nexus.api.repository.RepositoryManagerClient$getRepositoryList.call(Unknown
>  Source)
> at 
> com.sonatype.nexus.ci.util.NxrmUtil.getApplicableRepositories(NxrmUtil.groovy:61)
> at 
> com.sonatype.nexus.ci.util.NxrmUtil$getApplicableRepositories.call(Unknown 
> Source)
> at 
> com.sonatype.nexus.ci.config.Nxrm2Configuration$DescriptorImpl.doVerifyCredentials(Nxrm2Configuration.groovy:92)
> at sun.reflect.GeneratedMethodAccessor951.invoke(Unknown Source)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at 
> org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:324)
> at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:167)
> at 
> org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:100)
> at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:124)
> at 
> org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
> at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
> at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
> at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:233)
> at 
> org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
> at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
> at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
> at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
> at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
> at 
> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
> at 
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
> at 
> hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:135)
> at 
> hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:126)
> at 
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
> at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:80)
> at 
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
> at 
> hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
> at 
> hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
> at 
> hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
> at 
> jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
> at 
> hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
> at 
> org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
> at 
> hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
> at 
> org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
> at 
> hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
> at 
> org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
> at 
> hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
> at 
> jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93)
> at 
> hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
> at 
> org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
> at 
> hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
> at 
> hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
> at 
> hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
> at 

Re: How to trigger Jenkins build with parameters from Gitlab webhook?

2017-01-09 Thread David Karr
I'm not sure if this matters, but did you define that parameter in the
pipeline job?

On Mon, Jan 9, 2017 at 3:02 AM, Mark Allison  wrote:
> I have GitLab Community Edition 8.15.2 successfully trigger pipeline
> projects in Jenkins 2.32.1 using a webhook (but without any parameters). I
> want the gitlab push to trigger a build with parameters but the parameter
> value is null when it comes through to Jenkins so the build fails.
>
> The gitlab webhook looks like:
>
> http://jenkins.server:8080/project/project-a/buildWithParameters?MYPARAM=foo
>
>
> In my pipeline project I echo the parameter value out with
>
> echo "MYPARAM: ${MYPARAM}"
>
>
> and it's not set to anything. Any ideas on where I've gone wrong?
>
> --
> 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/058c423d-150e-4f17-99ca-aa0dfc2c5d50%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/CAA5t8VrNt_5cOJXSd%2BdFMEQ4QuKWNeLDW%2BNCBgb3PX5W9cPq4Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Different interpretation between "Pipeline Script" and "Pipeline Script from SCM"?

2017-01-09 Thread timothyx . hargreaves
Should probably add that we're on 2.7.1 for the master and 2.6 for the 
Pipeline API plugin.

On Monday, January 9, 2017 at 10:05:07 AM UTC-8, timothyx@intel.com 
wrote:
>
> I have a Jenkinsfile/pipeline script where I'm accessing a passed 
> parameter.
>
> When the code is pasted into the GUI and run, the value is resolved fine. 
> When the same code is pasted into a file, pushed into SCM and then accessed 
> by the job, it fails to resolve the value.
>
> Example line:
>
> sh "cd out; zip -r -FS ${params.BUILD_TARGET}.zip ${params.BUILD_TARGET}"
>
> Output from "Pipeline Script"
>
> + zip -r -FS mytarget.zip mytarget
>
> Output from "Pipeline Script from SCM"
>
> + zip -r -FS null.zip null
>
>
> Is there an inconsistency in interpretation/execution, or am I just doing 
> something wrong?
>
>
> Thanks,
>
>
> Tim
>
>

-- 
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/18052542-b66a-4313-a03a-d426fbe14c89%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Different interpretation between "Pipeline Script" and "Pipeline Script from SCM"?

2017-01-09 Thread timothyx . hargreaves
I have a Jenkinsfile/pipeline script where I'm accessing a passed parameter.

When the code is pasted into the GUI and run, the value is resolved fine. 
When the same code is pasted into a file, pushed into SCM and then accessed 
by the job, it fails to resolve the value.

Example line:

sh "cd out; zip -r -FS ${params.BUILD_TARGET}.zip ${params.BUILD_TARGET}"

Output from "Pipeline Script"

+ zip -r -FS mytarget.zip mytarget

Output from "Pipeline Script from SCM"

+ zip -r -FS null.zip null


Is there an inconsistency in interpretation/execution, or am I just doing 
something wrong?


Thanks,


Tim

-- 
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/467c3a93-4092-4a15-8e7f-24fc11f8157b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Get the root directory of node in Pipeline

2017-01-09 Thread Kristian
This gives me the workspace of the job. But I want the root directory
which I set when I create a new slave node in Jenkins.

So, as an example, I create a new slave node. The root directory i am
setting there is /home/jenkins.
Currently, when I run a job, I get "/home/jenkins/workspace/Some Job
Name" when running pwd(). But I want only this "/home/jenkins" stuff.


2017-01-09 17:54 GMT+01:00 Slide :
> You can use pwd, to get it.
>
> node() {
>ROOT = pwd()
> }
>
> On Mon, Jan 9, 2017 at 9:45 AM Kristian  wrote:
>>
>> Hi,
>>
>> do someone knows how to get the root directory of a node in a Pipeline
>> script?
>>
>> --
>> 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/CAO5HUhMvCZXGLe91bb4W%3DpHGH470C2QbVF5CX70XdeL0aYm5_A%40mail.gmail.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/CAPiUgVfJ0UjVfPnQhq8rTsj6Sde9uCUKOopQzJfLRRegLiWE1Q%40mail.gmail.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/CAO5HUhOBwpNj0aEoB3G_sWYaZAExoakgmSX9udSx7CvQQeCYdw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Get the root directory of node in Pipeline

2017-01-09 Thread Slide
You can use pwd, to get it.

node() {
   ROOT = pwd()
}

On Mon, Jan 9, 2017 at 9:45 AM Kristian  wrote:

> Hi,
>
> do someone knows how to get the root directory of a node in a Pipeline
> script?
>
> --
> 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/CAO5HUhMvCZXGLe91bb4W%3DpHGH470C2QbVF5CX70XdeL0aYm5_A%40mail.gmail.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/CAPiUgVfJ0UjVfPnQhq8rTsj6Sde9uCUKOopQzJfLRRegLiWE1Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Get the root directory of node in Pipeline

2017-01-09 Thread Kristian
Hi,

do someone knows how to get the root directory of a node in a Pipeline script?

-- 
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/CAO5HUhMvCZXGLe91bb4W%3DpHGH470C2QbVF5CX70XdeL0aYm5_A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Declarative Pipeline - setting up basic pipeline properties

2017-01-09 Thread Ohad Cohen
Hi All,

I'm new to Jenkins and i have created a multibranch pipeline, 

does anyone knows how to set the pipeline description through the pipeline 
script?

and also how can i use gerrit trigger from the pipeline script?

Thanks in advance,

Ohad Cohen

-- 
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/af354963-4924-4e5d-8207-ba3190e1182d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Repository connection Issue

2017-01-09 Thread Sam
Hi all,

I have a private repo using gogs and trying to setup a connection from my 
jenkins project via http but getting the following error:

Failed to connect to repository : Command "git ls-remote -h 
http://myrepourl.git HEAD" returned status code 128:
stdout: 

stderr: fatal: unable to access 'http://myrepourl.git/': The requested URL 
returned error: 500

I have added a jenkins user to gogs and tested it.  I can wget the url from 
the jenkins server ok and also run the git -ls remote repourl HEAD command 
ok, aswell as clone the repo using git clone on the cli.  I do get prompted 
for access to the gogs repo when cloning however the username and password 
i have added to the connection config in the jenkins project works fine.  

There is nothing being outputted to /var/log/jenkins/jenkins.log relating 
to this so im at a bit of a loss as to how to continue troubleshooting 
this, I tried using an ssh key but had similar problems, any input would be 
greatly appreciated.

Many Thanks

Sam


-- 
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/b775c6b1-0fb5-4baa-8371-49ba9a620177%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using mailer publisher inside Jenkinsfile

2017-01-09 Thread Ohad Cohen
Hi Raffaele,

If you are using the 'Declarative Pipleine' syntax and you want to use 'Job 
Dsl' features, I think you should do:

jobDsl scriptText: '''publishers {
mailer(\'m...@example.com\', true, true)
}'''

** Taken from the snippet generator

hope this was helpful

בתאריך יום שני, 9 בינואר 2017 בשעה 14:44:24 UTC+2, מאת Raffaele Sgarro:
>
> I have this Jenkinsfile in my repository, which is fed to Jenkins via a 
> Multibranch pipeline job:
>
> node {
> checkout scm
>
> stage("Compile") {
> sh "./gradlew classes"
> }
>
> stage("Test") {
> try {
> sh "./gradlew cleanTest test"
> } finally {
> junit "**/build/test-results/test/TEST-*.xml"
> }
> }
> }
>
> I need to be notified when build fails or is back to normal. I found the 
> publishers/mailer 
> in the DSL documentation 
> 
>  but it doesn't inside node {}, neither in the top-level scope:
>
> publishers {
> mailer('m...@example.com ', true, true)
> }
>
>
> Lots of examples use catchErrors {} or a plain try {} finally {} and 
> maintain the build status by hand. Is any declarative approach like 
> publisher/mail available for my setup? I would also get rid of that try {} 
> finally {} for junit test results processing since there is a junit 
> publisher.
>

-- 
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/47a59781-7eaa-4277-828b-c9edb5890a0e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Declarative pipepipe] Reusable stages ?

2017-01-09 Thread jerome
On the same note, anybody have a good *complete* example of the possibility 
for external part (@NonCPS, function, class, block, stage, steps, ...) for 
external parts file import/usage? I'm looking for a good do/don't.

Right now I put a file into Jenkins for the install exec path that I import 
using:
my_var = evaluate(new File("${env.JENKINS_HOME}\\custom_scripts.groovy"))

my_var is a dictionary that I can access based on the build machine to get 
the exec install path. But for importing function and having a proper for 
loop or iterator that actually work from another file, I'm a bit lost for 
how to do it properly, I managed 1 way but was having a lot of troubles 
with built-in function and @NonCPS nightmare.

Thanks

-- 
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/8063d424-2ee3-4141-b8c4-c7e2e89a0ce2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: jenkins groovy plugin - setup and failures

2017-01-09 Thread Mark Waite
The "Groovy executable is NULL" message probably means that you've not
configured the Jenkins groovy plugin to know where to find command line
groovy on your system (or systems).  Refer to the groovy plugin
documentation 
for more hints on plugin configuration.

The later messages indicate that you are probably running a Unix variant
(Linux), have a script named /usr/bin/groovy, but the PATH environment
variable is damaged in the context where that script is run.  I'm not sure
what would cause that damage, but after you've resolved the global
configuration of the location of the groovy interpreter, you may still need
to fix some additional configurations.

Mark Waite

On Mon, Jan 9, 2017 at 6:46 AM Gb Gb  wrote:

> Im trying to execute groovy command using the groovy plugin
> In "execute groovy script" i tried both groovy command and groovy script
> file.
> getting error:
>
> Groovy executable is NULL, please check your Groovy configuration, trying
> fallback 'groovy' instead.
> . groovy /path_to_file_name.groovy
> /usr/bin/groovy: line 40: ls: command not found
> /usr/bin/groovy: line 41: expr: command not found
> /usr/bin/groovy: line 42: expr: command not found
> /usr/bin/groovy: line 45: dirname: command not found
> /usr/bin/groovy: line 49: dirname: command not found
> /usr/bin/groovy: line 51: /startGroovy: No such file or directory
>
>
>
> so
> 1) how should i configure groovy to work with jenkins?
> 2) how should i configure jenkins groovy plugin?
> 3) any other relevant how to.
>
> Thanks.
>
>
> --
> 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/ee861651-718d-4622-9500-6f387859bba7%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/CAO49JtFmfr_7NNJX_r%2Byowqe_fCE%3DGO4KQAWp8JTL01dr6vWkw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


jenkins groovy plugin - setup and failures

2017-01-09 Thread Gb Gb
Im trying to execute groovy command using the groovy plugin
In "execute groovy script" i tried both groovy command and groovy script 
file.
getting error: 

Groovy executable is NULL, please check your Groovy configuration, trying 
fallback 'groovy' instead.
. groovy /path_to_file_name.groovy
/usr/bin/groovy: line 40: ls: command not found
/usr/bin/groovy: line 41: expr: command not found
/usr/bin/groovy: line 42: expr: command not found
/usr/bin/groovy: line 45: dirname: command not found
/usr/bin/groovy: line 49: dirname: command not found
/usr/bin/groovy: line 51: /startGroovy: No such file or directory



so
1) how should i configure groovy to work with jenkins?
2) how should i configure jenkins groovy plugin?
3) any other relevant how to.

Thanks.


-- 
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/ee861651-718d-4622-9500-6f387859bba7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Memory leak (groovy)

2017-01-09 Thread Сергей Баранов
I'v tried to analyze heap dump as described here 
https://wiki.jenkins-ci.org/display/JENKINS/I'm+getting+OutOfMemoryError

this - value: groovy.lang.GroovyClassLoader #45007
 <- delegate - class: groovy.lang.GroovyClassLoader$InnerLoader, value: 
groovy.lang.GroovyClassLoader #45007
  <-  - class: Script1, value: 
groovy.lang.GroovyClassLoader$InnerLoader #45095
   <- klazz - class: org.codehaus.groovy.reflection.ClassInfo, value: 
Script1 class Script1
<- value - class: 
org.codehaus.groovy.reflection.GroovyClassValuePreJava7$EntryWithValue, 
value: org.codehaus.groovy.reflection.ClassInfo #45981
 <- [1] - class: java.lang.Object[], value: 
org.codehaus.groovy.reflection.GroovyClassValuePreJava7$EntryWithValue 
#45980
  <- [7055] - class: java.lang.Object[], value: java.lang.Object[] 
#98508
   <- table - class: 
org.codehaus.groovy.reflection.GroovyClassValuePreJava7$GroovyClassValuePreJava7Segment,
 
value: java.lang.Object[] #79578
<- [2] - class: 
org.codehaus.groovy.util.AbstractConcurrentMapBase$Segment[], value: 
org.codehaus.groovy.reflection.GroovyClassValuePreJava7$GroovyClassValuePreJava7Segment
 
#14
 <- segments - class: 
org.codehaus.groovy.reflection.GroovyClassValuePreJava7$GroovyClassValuePreJava7Map,
 
value: org.codehaus.groovy.util.AbstractConcurrentMapBase$Segment[] #2
  <- map - class: 
org.codehaus.groovy.reflection.GroovyClassValuePreJava7, value: 
org.codehaus.groovy.reflection.GroovyClassValuePreJava7$GroovyClassValuePreJava7Map
 
#1
   <- globalClassValue - class: 
org.codehaus.groovy.reflection.ClassInfo, value: 
org.codehaus.groovy.reflection.GroovyClassValuePreJava7 #1
<- [3662] - class: java.lang.Object[], value: 
org.codehaus.groovy.reflection.ClassInfo class ClassInfo
 <- elementData - class: java.util.Vector, value: 
java.lang.Object[] #162921
  <- classes (Java frame) - class: 
org.eclipse.jetty.webapp.WebAppClassLoader, value: java.util.Vector #39670


пятница, 6 января 2017 г., 13:17:58 UTC+3 пользователь Сергей Баранов 
написал:
>
> Hi all,
>
> I have a problem with memory leaks on our Jenkins ver. 2.39 (Pipeline 
> groovy plugin ver. 2.23). 
> We have a lot of pipeline jobs, jenkins server crushes 1-2 times a week 
> and we can't find the reason.
>
> I'v created the heap dump and I see a lot of arrays without values 
> https://i.gyazo.com/fed8f8e9fbd752ad460bda1174f68911.png
> https://i.gyazo.com/a980b213e6ebfe586c9f0d3ff9a91b84.png
>
> How can I detect the cause of this problem?
>
> Thanks in advance.
>

-- 
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/27cbfcd7-c6ec-47a7-8c53-bf1d8e7645b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Using mailer publisher inside Jenkinsfile

2017-01-09 Thread Raffaele Sgarro
I have this Jenkinsfile in my repository, which is fed to Jenkins via a
Multibranch pipeline job:

node {
checkout scm

stage("Compile") {
sh "./gradlew classes"
}

stage("Test") {
try {
sh "./gradlew cleanTest test"
} finally {
junit "**/build/test-results/test/TEST-*.xml"
}
}
}

I need to be notified when build fails or is back to normal. I found
the publishers/mailer
in the DSL documentation

 but it doesn't inside node {}, neither in the top-level scope:

publishers {
mailer('m...@example.com', true, true)
}


Lots of examples use catchErrors {} or a plain try {} finally {} and
maintain the build status by hand. Is any declarative approach like
publisher/mail available for my setup? I would also get rid of that try {}
finally {} for junit test results processing since there is a junit
publisher.

-- 
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/CAKg%3D9UVkp5tXCkUP8a4%2B%3DDFHOqHDjbhvVYF8Oy0kXkd7xBfYgg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


How to trigger Jenkins build with parameters from Gitlab webhook?

2017-01-09 Thread Mark Allison
I have GitLab Community Edition 8.15.2 successfully trigger pipeline 
projects in Jenkins 2.32.1 using a webhook (but without any parameters). I 
want the gitlab push to trigger a build with parameters but the parameter 
value is null when it comes through to Jenkins so the build fails.

The gitlab webhook looks like:

http://jenkins.server:8080/project/project-a/buildWithParameters?MYPARAM=foo


In my pipeline project I echo the parameter value out with

echo "MYPARAM: ${MYPARAM}"


and it's not set to anything. Any ideas on where I've gone wrong?

-- 
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/058c423d-150e-4f17-99ca-aa0dfc2c5d50%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Crumb Update / crumb restriction

2017-01-09 Thread Santhosh Kumar
Team,

Using crumb value, remote job trigger is working with curl -X post. We need 
to understand 2 things here. 

1. Is this crumb value static for 1 user/1 session.

2. How can i update the crumb if i want to change it for unauthorized 
access.[For example every 3 months].

Regards,
Santhosh P

-- 
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/8db4232a-8a31-46b3-9e0c-f28a0bf84df1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.