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 j

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

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 S

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') &&

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 sin

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

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

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 g

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

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

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 Na

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" g

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...@

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 ar

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

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 בינוא

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 u

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

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 /

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 <-

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

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

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 -