Re: Can't capture command results in Kubernetes Pipeline Jenkinsfile

2017-04-20 Thread thomas . lehmann
Easy thing ;)
The variable "c" is not know by the shell script

withEnv(["c=$c"]){
   sh 'c=${c}'
}




On Thursday, April 20, 2017 at 1:55:34 PM UTC+2, Mark Nuttall wrote:
>
> Hello, 
> I'm porting an existing Jenkinsfile to use the kubernetes plugin and its 
> syntax. I've hit a problem in which I need to get the result of a shell 
> command, but get only empty strings. This code worked correctly until being 
> ported to the kubernetes plugin syntax. 
>
> Here's my Jenkinsfile, showing a simple command just to help explain the 
> problem:
>
> #!groovy
>
> podTemplate(
>   label: 'mypod',
>   containers: [containerTemplate(name: 'maven', image: 'maven:3.5.0-jdk-8'
> , ttyEnabled: true, command: 'cat')],
> ){
>   node('mypod') {
> stage ('build') {
>   container ('maven') {
> sh 'ls > out.txt'
> sh 'cat out.txt'
>
> def c = sh(script: 'cat out.txt', returnStdout: true).trim();
> sh 'echo c = ${c}'
>
>
> def c2 = readFile('out.txt').trim()
> sh 'echo c2 = ${c2}'
>   }
> }
>   }
> }
>
> The relevant output, below, is very long but it shows that the 'ls' 
> command runs successfully, and that I can cat the result of that file: but 
> I am completely unable to read the file into a variable, or to execute the 
> command and store the result as a variable, which is what I really want to 
> do. I've highlighted the relevant sections in yellow. Please help me, I'm 
> getting desperate :-(
>
> Many thanks,
>
> -- Mark
>
> # # + ls
>
> [Pipeline] sh[sample.microservicebuilder.test] Running shell script
> Executing shell script inside container [maven] of pod 
> [kubernetes-991f3f512a3e4c13aa5c7960410311bb-25c6ad58b93c]
> Executing command: sh -c echo $$ > 
> '/home/jenkins/workspace/sample.microservicebuilder.test@tmp/durable-e505a1a7/pid';
>  jsc=durable-85fd500743f4a1b75ec1fa7e5bc276e5; JENKINS_SERVER_COOKIE=$jsc 
> '/home/jenkins/workspace/sample.microservicebuilder.test@tmp/durable-e505a1a7/script.sh'
>  > 
> '/home/jenkins/workspace/sample.microservicebuilder.test@tmp/durable-e505a1a7/jenkins-log.txt'
>  2>&1; echo $? > 
> '/home/jenkins/workspace/sample.microservicebuilder.test@tmp/durable-e505a1a7/jenkins-result.txt'
>  
> # cd "/home/jenkins/workspace/sample.microservicebuilder.test"
> sh -c echo $$ > 
> '/home/jenkins/workspace/sample.microservicebuilder.test@tmp/durable-e505a1a7/pid';
>  jsc=durable-85fd500743f4a1b75ec1fa7e5bc276e5; JENKINS_SERVER_COOKIE=$jsc 
> '/home/jenkins/workspace/sample.microservicebuilder.test@tmp/durable-e505a1a7/script.sh'
>  > 
> '/home/jenkins/workspace/sample.microservicebuilder.test@tmp/durable-e505a1a7/jenkins-log.txt'
>  2>&1; echo $? > 
> '/home/jenkins/workspace/sample.microservicebuilder.test@tmp/durable-e505a1a7/jenkins-result.txt'
>  
> exit*# # + cat out.txt
> Dockerfile
> Jenkinsfile
> README.md
> manifests
> out.txt
> pom.xml
> server.xml
> src*[Pipeline] sh[sample.microservicebuilder.test] Running shell script
> Executing shell script inside container [maven] of pod 
> [kubernetes-991f3f512a3e4c13aa5c7960410311bb-25c6ad58b93c]
> Executing command: sh -c echo $$ > 
> '/home/jenkins/workspace/sample.microservicebuilder.test@tmp/durable-9af67ea2/pid';
>  jsc=durable-85fd500743f4a1b75ec1fa7e5bc276e5; JENKINS_SERVER_COOKIE=$jsc 
> '/home/jenkins/workspace/sample.microservicebuilder.test@tmp/durable-9af67ea2/script.sh'
>  > 
> '/home/jenkins/workspace/sample.microservicebuilder.test@tmp/durable-9af67ea2/output.txt'
>  2> 
> '/home/jenkins/workspace/sample.microservicebuilder.test@tmp/durable-9af67ea2/jenkins-log.txt';
>  echo $? > 
> '/home/jenkins/workspace/sample.microservicebuilder.test@tmp/durable-9af67ea2/jenkins-result.txt'
>  
>
> # cd "/home/jenkins/workspace/sample.microservicebuilder.test"
> sh -c echo $$ > 
> '/home/jenkins/workspace/sample.microservicebuilder.test@tmp/durable-9af67ea2/pid';
>  jsc=durable-85fd500743f4a1b75ec1fa7e5bc276e5; JENKINS_SERVER_COOKIE=$jsc 
> '/home/jenkins/workspace/sample.microservicebuilder.test@tmp/durable-9af67ea2/script.sh'
>  > 
> '/home/jenkins/workspace/sample.microservicebuilder.test@tmp/durable-9af67ea2/output.txt'
>  2> 
> '/home/jenkins/workspace/sample.microservicebuilder.test@tmp/durable-9af67ea2/jenkins-log.txt';
>  echo $? > 
> '/home/jenkins/workspace/sample.microservicebuilder.test@tmp/durable-9af67ea2/jenkins-result.txt'
>  
> exit
> # # + cat out.txt[Pipeline] sh[sample.microservicebuilder.test] Running shell 
> script
> Executing shell script inside container [maven] of pod 
> [kubernetes-991f3f512a3e4c13aa5c7960410311bb-25c6ad58b93c]
> Executing command: sh -c echo $$ > 
> '/home/jenkins/workspace/sample.microservicebuilder.test@tmp/durable-3fd54a06/pid';
>  jsc=durable-85fd500743f4a1b75ec1fa7e5bc276e5; JENKINS_SERVER_COOKIE=$jsc 
> '/home/jenkins/workspace/sample.microservicebuilder.test@tmp/durable-3fd54a06/script.sh'
>  > 
> '/home/jenkins/workspace/sample.microservicebuilder.test@tmp/durable-3fd54a06/jenkins-log.txt'
>  2>&1; echo $? > 
> 

Re: How to specify svn credentialsId in pipeline job?

2017-04-20 Thread thomas . lehmann
You assing it to the parameter *credentialsId*.

On Thursday, April 20, 2017 at 1:13:20 PM UTC+2, David Aldrich wrote:
>
> Thanks, I see it now. The credential does have a readable name.  Can I 
> assign that name to credentialsId or should it be assigned to a different 
> property?
>
>  
>
> *From:* thomas@teamaol.com  [mailto:
> thomas@teamaol.com ] 
> *Sent:* 20 April 2017 12:11
> *To:* Jenkins Users 
> *Cc:* thomas@teamaol.com ; David Aldrich <
> david@emea.nec.com >
> *Subject:* Re: How to specify svn credentialsId in pipeline job?
>
>  
>
> Click on the link an a table is shown and there is the columns ID ...
> One note: if you forgot to provide a readable name you cannot change it. 
> You have to re-create it then.
>
> On Thursday, April 20, 2017 at 1:07:53 PM UTC+2, thomas@teamaol.com 
> wrote:
>
> When you click top/left on "Jenkins" (navigate to the mainpage) the link 
> to the credentials
>
> should appear on the left side (short before build queue).
>
> On Thursday, April 20, 2017 at 12:59:31 PM UTC+2, David Aldrich wrote:
>
> Thanks for your reply. I am an admin so I should be able to see 
> everything.  Where should I look for the credentials?
>
>  
>
> All our conventional jobs use the following credential seen on the job 
> configuration page:
>
>  
>
>  
>
> Where should I look for the corresponding credentialId?
>
>  
>
> Best regards
>
>  
>
> David
>
>  
>
> *From:* thomas@teamaol.com [mailto:thomas@teamaol.com] 
> *Sent:* 20 April 2017 11:39
> *To:* Jenkins Users 
> *Cc:* David Aldrich 
> *Subject:* Re: How to specify svn credentialsId in pipeline job?
>
>  
>
> Usually the adminstrator of a Jenkins is reponsible to register credentials
>
> with a useful (readable) name. If those admin forget to give a name Jenkins
> does it for your which results usually in something like this: 
> "b86bc2b6-994b-4811-ac98-0f35e9a9b114'
>
>
> Of course you don't wanna have such ID's in your coded pipeline. Consider
>
> you might have running your pipeline on different Jenkins providing the 
> same
>
> credentials (names) your project should be able to build without code 
> changes.
>
>  
>
> It might be a permission thing that you cannot see the credentials.
>
>  
>
>
> On Wednesday, April 19, 2017 at 1:19:15 PM UTC+2, David Aldrich wrote:
>
> Hi 
>
> I have created a simple pipeline job that is intended just to check out a 
> working copy from svn initially. 
>
> Here's the script: 
>
> node { 
>echo 'Hello World' 
> 
>stage('Checkout') { 
>   checkout([$class: 'SubversionSCM', 
>   additionalCredentials: [], 
>   excludedCommitMessages: '', 
>   excludedRegions: '', 
>   excludedRevprop: '', 
>   excludedUsers: 'buildbot', 
>   filterChangelog: false, 
>   ignoreDirPropChanges: false, 
>   includedRegions: '', 
>   locations: [[credentialsId: 
> 'b86bc2b6-994b-4811-ac98-0f35e9a9b114', 
>depthOption: 'infinity', 
>ignoreExternalsOption: true, 
>local: '.', 
>remote: ""]], 
>   workspaceUpdater: [$class: 'UpdateUpdater']]) 
>   } 
> } 
>
> Is the script valid? 
>
> How do I determine the 'credentialsId' ?   (I have credentials set up in 
> non-pipeline jobs already). 
>
> Best regards 
>
> David 
>
>  
>
> Click here 
> 
>  
> to report this email as spam.
>
>

-- 
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/c3ec1ffd-4020-435f-98d9-013ca8440518%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How/when does Jenkins refresh job configuration (params, etc.) from pipeline script?

2017-04-20 Thread thomas . lehmann
Basically the pipeline script is code and as long the code is not executed 
it does nothing.
If you decide to adjust job configuration via script like "poll scm", 
"interval", enable/disable concurrent build
and how many history entries to keep then it will affect next build only.

You have following options  ...

 a) Pipeline job: you specify all fix parameters and then load the 
Jenkinsfile from your repository. The process is coded the parameters are 
manual.
 b) Multibranch pipeline job: you don't have any parameters and each remote 
branch can build in parallel. The pipeline code need to decide
 when to do what ... (example: you could eval the git branch and 
decided by where to deploy or where to deploy anyway). So basicall all is 
coded.

If you have same job running in multiple Jenkins instances (like cloud: AWS 
regions) then you might wanna also investigate
into Job DSL which is an extension the whole process. It allows to write a 
seed job that could run on each of your Jenkins instances creating
the required Jenkins jobs for you automatically.

A final word of warning related coded parameters ...
The pipeline DSL is - unfortunately - not designed to implement a behavior 
for such job parameters
which reflect the often seen Language feature "+=" (append) which means 
when you change one option only all other parameters you might have set 
manually
in the job configuration are overwritten. As an example ... if you do 
following ... look at the pipeline syntax for the properties and adjust 
those two entries same way and
then you see which options are additional changed ...

properties([
// Max # of builds to keep: 10
buildDiscarder(logRotator(artifactDaysToKeepStr: '', 
artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),
// Do not allow concurrent builds
disableConcurrentBuilds()
])


Kind Regards,
Thomas

On Monday, April 17, 2017 at 6:55:24 PM UTC+2, Pavel Strashkin wrote:
>
> Hi there,
>
> I wonder if anyone has details about how/when jenkins refreshes job 
> configuration from pipeline script (Jenkinsfile)? Is it when build is 
> triggered or some background job? What if I just want to adjust 
> configuration (add optional params) w/o running stages, how would I achieve 
> so?
>
> 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/02fe71cc-f70d-46bc-b582-d052a0f77e76%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to specify svn credentialsId in pipeline job?

2017-04-20 Thread thomas . lehmann
Click on the link an a table is shown and there is the columns ID ...
One note: if you forgot to provide a readable name you cannot change it. 
You have to re-create it then.

On Thursday, April 20, 2017 at 1:07:53 PM UTC+2, thomas@teamaol.com 
wrote:
>
> When you click top/left on "Jenkins" (navigate to the mainpage) the link 
> to the credentials
> should appear on the left side (short before build queue).
>
> On Thursday, April 20, 2017 at 12:59:31 PM UTC+2, David Aldrich wrote:
>>
>> Thanks for your reply. I am an admin so I should be able to see 
>> everything.  Where should I look for the credentials?
>>
>>  
>>
>> All our conventional jobs use the following credential seen on the job 
>> configuration page:
>>
>>  
>>
>>  
>>
>> Where should I look for the corresponding credentialId?
>>
>>  
>>
>> Best regards
>>
>>  
>>
>> David
>>
>>  
>>
>> *From:* thomas@teamaol.com [mailto:thomas@teamaol.com] 
>> *Sent:* 20 April 2017 11:39
>> *To:* Jenkins Users 
>> *Cc:* David Aldrich 
>> *Subject:* Re: How to specify svn credentialsId in pipeline job?
>>
>>  
>>
>> Usually the adminstrator of a Jenkins is reponsible to register 
>> credentials
>>
>> with a useful (readable) name. If those admin forget to give a name 
>> Jenkins
>> does it for your which results usually in something like this: 
>> "b86bc2b6-994b-4811-ac98-0f35e9a9b114'
>>
>>
>> Of course you don't wanna have such ID's in your coded pipeline. Consider
>>
>> you might have running your pipeline on different Jenkins providing the 
>> same
>>
>> credentials (names) your project should be able to build without code 
>> changes.
>>
>>  
>>
>> It might be a permission thing that you cannot see the credentials.
>>
>>  
>>
>>
>> On Wednesday, April 19, 2017 at 1:19:15 PM UTC+2, David Aldrich wrote:
>>
>> Hi 
>>
>> I have created a simple pipeline job that is intended just to check out a 
>> working copy from svn initially. 
>>
>> Here's the script: 
>>
>> node { 
>>echo 'Hello World' 
>> 
>>stage('Checkout') { 
>>   checkout([$class: 'SubversionSCM', 
>>   additionalCredentials: [], 
>>   excludedCommitMessages: '', 
>>   excludedRegions: '', 
>>   excludedRevprop: '', 
>>   excludedUsers: 'buildbot', 
>>   filterChangelog: false, 
>>   ignoreDirPropChanges: false, 
>>   includedRegions: '', 
>>   locations: [[credentialsId: 
>> 'b86bc2b6-994b-4811-ac98-0f35e9a9b114', 
>>depthOption: 'infinity', 
>>ignoreExternalsOption: true, 
>>local: '.', 
>>remote: ""]], 
>>   workspaceUpdater: [$class: 'UpdateUpdater']]) 
>>   } 
>> } 
>>
>> Is the script valid? 
>>
>> How do I determine the 'credentialsId' ?   (I have credentials set up in 
>> non-pipeline jobs already). 
>>
>> Best regards 
>>
>> David 
>>
>>  
>>
>> Click here 
>> 
>>  
>> to report this email as spam.
>>
>

-- 
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/05550dc0-0343-46cd-8666-bb0fb19828b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to specify svn credentialsId in pipeline job?

2017-04-20 Thread thomas . lehmann
When you click top/left on "Jenkins" (navigate to the mainpage) the link to 
the credentials
should appear on the left side (short before build queue).

On Thursday, April 20, 2017 at 12:59:31 PM UTC+2, David Aldrich wrote:
>
> Thanks for your reply. I am an admin so I should be able to see 
> everything.  Where should I look for the credentials?
>
>  
>
> All our conventional jobs use the following credential seen on the job 
> configuration page:
>
>  
>
>  
>
> Where should I look for the corresponding credentialId?
>
>  
>
> Best regards
>
>  
>
> David
>
>  
>
> *From:* thomas@teamaol.com  [mailto:
> thomas@teamaol.com ] 
> *Sent:* 20 April 2017 11:39
> *To:* Jenkins Users 
> *Cc:* David Aldrich 
> *Subject:* Re: How to specify svn credentialsId in pipeline job?
>
>  
>
> Usually the adminstrator of a Jenkins is reponsible to register credentials
>
> with a useful (readable) name. If those admin forget to give a name Jenkins
> does it for your which results usually in something like this: 
> "b86bc2b6-994b-4811-ac98-0f35e9a9b114'
>
>
> Of course you don't wanna have such ID's in your coded pipeline. Consider
>
> you might have running your pipeline on different Jenkins providing the 
> same
>
> credentials (names) your project should be able to build without code 
> changes.
>
>  
>
> It might be a permission thing that you cannot see the credentials.
>
>  
>
>
> On Wednesday, April 19, 2017 at 1:19:15 PM UTC+2, David Aldrich wrote:
>
> Hi 
>
> I have created a simple pipeline job that is intended just to check out a 
> working copy from svn initially. 
>
> Here's the script: 
>
> node { 
>echo 'Hello World' 
> 
>stage('Checkout') { 
>   checkout([$class: 'SubversionSCM', 
>   additionalCredentials: [], 
>   excludedCommitMessages: '', 
>   excludedRegions: '', 
>   excludedRevprop: '', 
>   excludedUsers: 'buildbot', 
>   filterChangelog: false, 
>   ignoreDirPropChanges: false, 
>   includedRegions: '', 
>   locations: [[credentialsId: 
> 'b86bc2b6-994b-4811-ac98-0f35e9a9b114', 
>depthOption: 'infinity', 
>ignoreExternalsOption: true, 
>local: '.', 
>remote: ""]], 
>   workspaceUpdater: [$class: 'UpdateUpdater']]) 
>   } 
> } 
>
> Is the script valid? 
>
> How do I determine the 'credentialsId' ?   (I have credentials set up in 
> non-pipeline jobs already). 
>
> Best regards 
>
> David 
>
>  
>
> Click here 
> 
>  
> to report this email as spam.
>

-- 
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/81d2a0e0-3a50-416d-8baa-f9f04c5102a3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins BuildHistory | MBs of space is consumed

2017-04-20 Thread thomas . lehmann
I would assume that is the size (sum) of your build artifacts.
When you click in one history entry you should see the build artifacts (and 
its size)

On Wednesday, April 19, 2017 at 12:17:35 PM UTC+2, LnT wrote:
>
> Hi,
>
> one of my job's history show like below.
> What are these statistics under trend ?
>
> why such MBs of space is consumed ?
> Any cluse
>
>
> Regards,
> LnT
>

-- 
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/8045633c-6c1a-4dbf-a6f9-e3a45aaeb9a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to specify svn credentialsId in pipeline job?

2017-04-20 Thread thomas . lehmann
Usually the adminstrator of a Jenkins is reponsible to register credentials
with a useful (readable) name. If those admin forget to give a name Jenkins
does it for your which results usually in something like this: 
"b86bc2b6-994b-4811-ac98-0f35e9a9b114'

Of course you don't wanna have such ID's in your coded pipeline. Consider
you might have running your pipeline on different Jenkins providing the same
credentials (names) your project should be able to build without code 
changes.

It might be a permission thing that you cannot see the credentials.


On Wednesday, April 19, 2017 at 1:19:15 PM UTC+2, David Aldrich wrote:
>
> Hi 
>
> I have created a simple pipeline job that is intended just to check out a 
> working copy from svn initially. 
>
> Here's the script: 
>
> node { 
>echo 'Hello World' 
> 
>stage('Checkout') { 
>   checkout([$class: 'SubversionSCM', 
>   additionalCredentials: [], 
>   excludedCommitMessages: '', 
>   excludedRegions: '', 
>   excludedRevprop: '', 
>   excludedUsers: 'buildbot', 
>   filterChangelog: false, 
>   ignoreDirPropChanges: false, 
>   includedRegions: '', 
>   locations: [[credentialsId: 
> 'b86bc2b6-994b-4811-ac98-0f35e9a9b114', 
>depthOption: 'infinity', 
>ignoreExternalsOption: true, 
>local: '.', 
>remote: ""]], 
>   workspaceUpdater: [$class: 'UpdateUpdater']]) 
>   } 
> } 
>
> Is the script valid? 
>
> How do I determine the 'credentialsId' ?   (I have credentials set up in 
> non-pipeline jobs already). 
>
> Best regards 
>
> David 
>
>

-- 
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/f668c4f1-e127-4008-a368-12e3ae10d1f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Job DSL and isDirectory does not work, any ideas?

2017-03-29 Thread thomas . lehmann
Hi,

I have (locally) Jenkins 2.49 and Job DSL 1.58 and Groovy version 2.4.8

I need a way to iterate files in a folder to load configuration (multiple 
files) from it.
Following code does not work using *Job DSL*:

 a) you need WORKSPACE to build absolute path
 The normal Groovy code *new File("config").getAbsolutePath()* does not 
work (with groovyConsole all fine)
 b) *isDirectory* prints out "false" also normal groovy code says "true". 
(with groovyConsole all fine)



println(GroovySystem.version)
def path = new File(WORKSPACE + "/config").getAbsolutePath()
println("info (path): " + path)
println("info (isDirectory) : " + new File(path).isDirectory())

Output:

+ mkdir -p config
Processing provided DSL script
2.4.8
info (path): /data/jenkins/local/workspace/TMP/config
info (isDirectory) : false



Any help is appreciated ...

kind Regards,
Thomas

-- 
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/3e3e11d0-beb7-4e67-8d55-ae9c4221549d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Coded pipeline - auto job creation (webhook) ???

2016-11-10 Thread thomas . lehmann
Hi Greg,

interesting, but it's not on GitHub. Also same plugin would be available 
for Bitbucket ... Jenkinsfile is probably not enough.
We also would like to have a parametrized build. As an example we would 
like to run the pipeline for latest as well as for a feature branch.
But I will have a look, thanks.

Best Regards,
Thomas

On Wednesday, November 9, 2016 at 12:13:44 PM UTC+1, Grégory Lureau wrote:
>
> Hi Thomas,
>
> If you're using github, maybe that could help you? 
> https://wiki.jenkins-ci.org/display/JENKINS/GitHub+Organization+Folder+Plugin
> It's basically checking all repos in your github organization, and if they 
> match some requirements (your regexp + have a Jenkinsfile), it will create 
> all jobs.
> I read there is similar tool for Bitbucket but never tried.
>
> Best Regards,
> Greg
>
> Le mardi 8 novembre 2016 11:07:48 UTC+1, thomas@teamaol.com a écrit :
>>
>> Hi,
>>
>> We have a coded pipeline and using webhooks in our Git system.
>> The *existing* Jenkins pipeline job is executed on a change.
>> Fine.
>>
>> As already mentioned this works only when the job does exist.
>> *Is there a way to organize that a Jenkins job gets automatically 
>> created?*
>>
>> It would be great if we could implement something like: "asking the 
>> concrete repository what to do"
>> I could imagine that I need to store a job.xml in my repository ...
>> *Any ideas?*
>>
>> Regards,
>> Thomas
>>
>

-- 
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/b3aed3e6-e383-4f8a-808b-d5e248211719%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline shared libraries, can I have a constructor when I don't explicitly declare the enclosing class?

2016-11-08 Thread thomas . lehmann
When you define a class then you can write a function that returns an 
instance of that class.
Just the way you write it ... you do not write a class ... you get an 
instance of the library which contains functions

class Foo {
def sum(a, b) {
return a + b
}
}

def createFoo() {
   return new Foo()
}

def sum(a, b){
return a + b
}

return this;

Assume the file is foo.groovy you can do then:

def fooApi = load pwd() + '/foo.groovy'
echo "10+20=" + fooApi.sum(10, 20).toString()
def foo = fooApi.createFoo()
echo "10+20=" + foo.sum(10, 20).toString()

kind of ...
I hope this helps ...


On Monday, November 7, 2016 at 10:54:56 PM UTC+1, Jonathan Hodgson wrote:
>
> Hi,
>
> I'm setting up a folder library as per here.
>
> Now in one of their examples they talk about not declaring the enclosing 
> class (so as to allow access to steps)
>
> This works fine, in the file MyClass.groovy
>
> @package my.package
>
>
>
> def myMethod(data)
> {
> // do stuff with data
> }
>
>
> return this
>
>
> I can declare an instance of the class and use it with 
>
> method = new my.package.MyClass()
>
>
> myClass.myMethod(my_data)
>
>
> But I cannot create a contructor, is there a way to do this?
>

-- 
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/651ec37a-a9b9-4100-9602-a9a93aa40871%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Coded pipeline - auto job creation (webhook) ???

2016-11-08 Thread thomas . lehmann
Hi,

We have a coded pipeline and using webhooks in our Git system.
The *existing* Jenkins pipeline job is executed on a change.
Fine.

As already mentioned this works only when the job does exist.
*Is there a way to organize that a Jenkins job gets automatically created?*

It would be great if we could implement something like: "asking the 
concrete repository what to do"
I could imagine that I need to store a job.xml in my repository ...
*Any ideas?*

Regards,
Thomas

-- 
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/87e6b579-f27b-4316-a4a6-5473e6a64552%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Run builds on Jenkins Slave nodes through Docker

2016-11-08 Thread thomas . lehmann

   
   - From my understanding you would build on slaves with Docker installed 
   there (I guess you have OPS guys for that?).
   - Then you can create Docker images and/or Docker container as needed.
   - As an example you could create a container that install Java 8 and 
   Maven 3 building then a Maven project.
   - Usually you would do a cleanup afterwards ... at least you remove the 
   container (usually with --rm=true done automatically)
   Keep in mind that every build job whould have an own Docker container 
   since those jobs usually run in parallel.
   - You should be able to test that build locally ... sth. like following: 
   docker run --rm=true -v $PWD:/docker -it centos:7.2.15 /docker/build-it.sj

...when this is ... what you have been looking for ...

On Monday, November 7, 2016 at 5:48:34 PM UTC+1, Natale Vinto wrote:
>
> Hello,
>
> I was looking at documentation about running builds on jenkins slave 
> through Docker and everything looks fine with Docker cloud provider and a 
> jenkins slave image running docker on the same Jenkins host, but I didn't 
> understood if it would be possible to run builds on Docker containers as 
> slaves living on another physical/virtual Jenkins node, and how to get it. 
>
> Is it possible?
>
> Thanks
>
> Natale
>

-- 
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/3a90d664-1cce-412e-b89c-a6d566ae33c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to get selenium tests running in Jenkins

2016-11-08 Thread thomas . lehmann
Either you have a central selenium environment or ...
... have a look here: https://github.com/elgalu/docker-selenium
You can do a ci/cd pipeline that spawns a Docker container when needed.

On Tuesday, November 8, 2016 at 10:27:31 AM UTC+1, Sven Person wrote:
>
> Hi,
>
> i build my first selenium test project. i build it as maven project using 
> selenium 2.53.1 in intellij. the test is opening a website, grabbing links 
> there and opens them in a new window to check if the site the links 
> redirect to is a 200, 404 or 505 page. as  browser i use firefox. 
> its running fine when i start the test in selenium.
>
> i use the standart notation with  @BeforeClass  @ Test and @AfterClass
>
> now i want to get the test running in jenkins. i put the source code on 
> bitbucket (using it for version controlling too) and then but the bitbucket 
> source into jenkins. 
>
> when i build the project it seems to run fine, but no tests get executed.
>
> attached you will find the pom.xml file.
>
> i hope someone can give me a hint what i need to do to get my test project 
> running in jenkins.
>

-- 
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/9aca6c31-bff1-4ecd-a769-bc6b88df8948%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins Pipeline with custom class does hang forever

2016-10-17 Thread thomas . lehmann
Yeah ... found out that too ... "Thread dumps" link in Jenkins job has 
shown the multiplle calls.
Wasn't aware of the property cabability.

Thank you

On Monday, October 17, 2016 at 10:50:39 AM UTC+2, Daniel Beck wrote:
>
> > def setMessage(String message) { 
> > this.message = message 
> > } 
>
> This looks like a potential infinite loop, because Groovy allows calling 
> setters by just setting the property. Probably something getting messed up 
> in one of the Groovy transformations (because this is supposed to only 
> happen for fields without access modifier, and only outside the class[1]). 
>
> Try this: 
>
> > this.@message = message 
>
> Or just skip the getters/setters while you don't need them. 
>
> 1: http://groovy-lang.org/objectorientation.html#properties 
>
>

-- 
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/358437a9-d3e0-4814-935c-6a028809b96a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins Pipeline with custom class does hang forever

2016-10-17 Thread thomas . lehmann
Hi,

I were trying to write custom class in Jenkinsfile.

With following example the JOb does hang after the line "echo hi:2". I have 
to click to abort the build and then click twice
on provided links in the Jenkins Console to fully cancel it. On our server 
- even after kill - Jenkins remains 200 and more percentage of CPU.
We were forced to shutdown the Service and to restart. Locally I'm running 
Jenkins inside a Docker container. No CPU problems there.
I'm using a 2.8 and on our server we have a 2.23.

The Console output looks like this:

hi:2
Aborted by Thomas Lehmann <http://tlehmann.office.aol.com:8080/user/tlehmann>

Click here to forcibly terminate running steps 
<http://tlehmann.office.aol.com:8080/job/Test1/25/console#>

Terminating node

Click here to forcibly kill entire build 
<http://tlehmann.office.aol.com:8080/job/Test1/25/console#>

Hard kill!
Finished: ABORTED


And ideas?

Kind Regards,
Thomas

class Project implements Serializable {
static final serialVersionUID = 1L

private String message = ""

def setMessage(String message) {
this.message = message
}

def getMessage() {
return this.message
}
}

node {
echo "hi:1"
def project = new Project()

stage("Using a class") {
echo "hi:2"
project.setMessage("some message")
echo "hi:3"
echo project.getMessage()
echo "hi:4"
}
}



-- 
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/48fca903-6d35-4852-ade9-38688f2663f6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is adding private key to Jenkins credential list a security breach?

2016-09-20 Thread thomas . lehmann
It's a matter how it is organized ...
If administrators only (a limited number of persons) have access to the 
manage section in Jenkins then it's probably a first step.
Also an option might be to use Vault.


On Monday, September 19, 2016 at 3:57:58 AM UTC+2, John Cho wrote:
>
> Hi,
> I am reading thru how to set up slaves on Jenkins using ssh keys.   Read 
> thru about three articles on how to do that.   According to them, the setup 
> is based upon using the slave as a ssh server with public and private keys 
> and it adds the slave's private key to the Jenkins master's credential 
> instead of the slave's public key.  Private key should never be shared.   
> Any thought on this practice?   Or, am I missing any?   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/7b76bf38-986d-4d25-892c-97bb336a3e87%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is there any variable for total build time in pipeline plugin?

2016-09-20 Thread thomas . lehmann
Mm   ... I tried that ... with a sleep of 10 seconds before. The result 
is 0. In opposite to the variant with using System.currentTimeMillis which 
works fine.

On Monday, September 19, 2016 at 9:24:22 PM UTC+2, Cuong Tran wrote:
>
> How about:
>
> currentBuild.getDuration()
>
>
> https://github.com/jenkinsci/workflow-support-plugin/blob/master/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/RunWrapper.java
>
> On Monday, September 19, 2016 at 1:34:38 AM UTC-7, Denis Kot wrote:
>>
>> I would like to send message from pipeline to hipchat contains total 
>> build time, i.e.: 
>> job-pipeline #3007 SUCCESSFUL after 1 min 42 sec
>> How can I implement it?
>>
>

-- 
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/9c9a5056-6c59-47e5-a720-6220e2005f96%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins pipeline: how to get the different paths

2016-09-20 Thread thomas . lehmann
One information is "*pwd(tmp:true)*" which provides the  @tmp path. When 
same job runs two times in parallel the path provided by pwd(...) returns a 
path with additionally a number.

Current path:/var/lib/jenkins/workspace/Foo@2
Temp path:/var/lib/jenkins/workspace/Foo@2@tmp


*Remains*: how do I get the @script Path? 

On Tuesday, September 20, 2016 at 9:34:29 AM UTC+2, thomas@teamaol.com 
wrote:
>
> Hi,
>
> writing a Jenkinsfile like this:
>
> node{
> def WORKSPACE=pwd()
> }
>
> The path is initially empty. The content is stored at pwd() + "@script".
>
> So basically I could use two variables
>  - def WORK_PATH=pwd()
>  - def SOURCES=pwd() + "@script"
>
> However there is also a @tmp path for the project and when the job runs in 
> parallel we also have numbering in the paths.
>
> Since I'm writing coded pipelines ... I could live with that if I could see
> how to access the individial paths. I have not found documentation on this.
>
> Anybody who could help please?
>
> Kind regards,
> Thomas
>

-- 
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/3acd3033-b266-4676-9e84-6ca4bad0c902%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins pipeline: how to get the different paths

2016-09-20 Thread thomas . lehmann
Hi,

writing a Jenkinsfile like this:

node{
def WORKSPACE=pwd()
}

The path is initially empty. The content is stored at pwd() + "@script".

So basically I could use two variables
 - def WORK_PATH=pwd()
 - def SOURCES=pwd() + "@script"

However there is also a @tmp path for the project and when the job runs in 
parallel we also have numbering in the paths.

Since I'm writing coded pipelines ... I could live with that if I could see
how to access the individial paths. I have not found documentation on this.

Anybody who could help please?

Kind regards,
Thomas

-- 
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/532af1ba-ed01-4051-b822-d4a6448b5685%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error in jenkins related to s3 bucket here i would like push the war file into S3 bucket and i am getting the following error.

2016-09-20 Thread thomas . lehmann
What is the S3 command you have used?
Pushing a file to S3  (as you say) is something like "aws --region $region 
--profile $profile s3 cp $file s3://$bucket_name/$path/$file.

On Monday, September 19, 2016 at 2:12:37 PM UTC+2, shrik...@gmail.com wrote:
>
> Failed CodeDeploy post-build step; exception follows. S3 Bucket field 
> cannot contain any subdirectories.  Bucket name only!
>
> this is the error i am getting can any one please suggest me please
>

-- 
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/ab840883-4885-4e7e-aed0-7365df351fcf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Parameterized build, REST, one parameter with new value rest with default

2016-08-15 Thread thomas . lehmann
Yes, basically you could retrieve the job XML parsing for the parameter 
definitions storing the default values and
then changing the values you want. Your function could also stop if not all 
mandatory fields are set.

I wrote my own jenkins controller (cannot publish the moment) but that one 
is not bad: https://github.com/txels/autojenkins
However one important feature is 
missing: https://github.com/txels/autojenkins/issues/30 (CSRF protection)

Regards,
Thomas

On Monday, August 15, 2016 at 8:53:44 AM UTC+2, Daniel Olausson wrote:
>
> Hi,
>
> I have a job that I would like to trigger via REST where I have one 
> parameter that I want to change every time and the other ones I would like 
> to use the default values for. If I do a POST to /build it just ignores the 
> default values and set them to empty. If I do a post to 
> /buildWithParameters I can't set the new value for the parameter I want, 
> the default values for all parameters are taken.
>
> How can I achieve this? First do a GET to get the default values, and then 
> do a POST to /build with all the parameters even if they are just the 
> default? 
>

-- 
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/10497232-60ea-4f9a-be8a-77820a60e9bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins 2.x - Pipeline(DSL) - Build failed but all stages are green

2016-08-12 Thread thomas . lehmann
All parts of the script are like this:

try {
   // do something
} catch(all) {
def message=""
notifySlack(message)
throw new Exception(message)
}

// finally
notifySlack("Done!")
currentBuild.result = "SUCCESS"


I never see a message from the "catch" but I see the "Done!". All processes 
of the pipeline are fine:
 - war file created
 - Docker container/images created and/or deleted
 - Upload of things in S3 bucket
 - ...

The build is red. To be more precise ... the stage show in deep red is this 
one:

 stage 'Remove Build Image'
try {
removeBuildImage(WORKSPACE)
} catch (all) {
def message="Failed to remove build image!"
notifySlack(message)
// Does not make sense to continue
throw new Exception(message)
}


The slack message is not shown ... and in the logs:

*06:58:21* Deleted: 
sha256:aa4e7c1557f3bfab99c3e233d6be5647061d81fdc5b570921eec0d7cc033c2dd*06:58:21*
 Deleted: 
sha256:6a74d75c87b71c9d8e6e6988baf48cc2ed2b7fb6b4ea87cb5d602c4b224a0483*06:58:21*
 remove_image.sh :: Success: Docker build image removed


That's the last "echo" of that script. In the Jenkins file the function 
looks like this

  4 // Remove the Docker image for the build.   
  
  5 def removeBuildImage(WORKSPACE) {   
  
  6 sh "WORKSPACE=$WORKSPACE $WORKSPACE/cicd/scripts/remove_image.sh 
build"   
  7 }

I don't see the moment how to proceed. If I could adjust the pipeline to 
debug mode that it does print
its state so I could see at which point it "believes" that something has 
been going wrong ...

Any ideas what I could do?


On Tuesday, August 2, 2016 at 1:42:58 PM UTC+2, Baptiste Mathus wrote:
>
> Maybe you could share a gist of your script, showing the issue you're 
> having and what you want/expect? Will probably be more efficient than just 
> speaking about that code?
>
> Le 2 août 2016 12:39 PM,  a écrit :
>
>> I still have the issue with a succeeded pipeline that shows red.
>> Even when I say: currentBuild.result = "SUCCESS" ... at the end
>> No trace all steps are executed fine  just the state is wrong.
>>
>> Using now Jenkins 2.14
>>
>> On Thursday, July 21, 2016 at 11:53:41 AM UTC+2, thomas@teamaol.com 
>> wrote:
>>>
>>> We are working with Jenkins 2.13 the moment.
>>> We have a ci/cd pipeline with all stages green but the build itself is 
>>> red.
>>>
>>> From the log I cannot see anything which gives me a hint.
>>> Also all deployed stuff is fine and the final slack notification were 
>>> also fine!
>>>
>>> Every "sh" call is wrapped by the try ... catch ... throw ... so if 
>>> there would
>>> be an error the pipeline should stop at the stage where the error 
>>> appears.
>>>
>>> I wrote manually a jenkinsfile but ... as you can guess ... all fine.
>>>
>>> I didn't found a way to check the build state. When is this set?
>>> Can I do an echo of current state so I could add some output?
>>>
>>> currentBuild.result prints null, so obviously this is not used.
>>> Any help, proposes?
>>>
>>> Kind regards,
>>> Thomas
>>>
>> -- 
>> 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/deca56cf-72e0-4735-a570-e59aad7b79e7%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/3941d3c2-7149-4552-aa87-52c34e4e3365%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins 2.x - Pipeline(DSL) - Build failed but all stages are green

2016-08-02 Thread thomas . lehmann
I still have the issue with a succeeded pipeline that shows red.
Even when I say: currentBuild.result = "SUCCESS" ... at the end
No trace all steps are executed fine  just the state is wrong.

Using now Jenkins 2.14

On Thursday, July 21, 2016 at 11:53:41 AM UTC+2, thomas@teamaol.com 
wrote:
>
> We are working with Jenkins 2.13 the moment.
> We have a ci/cd pipeline with all stages green but the build itself is red.
>
> From the log I cannot see anything which gives me a hint.
> Also all deployed stuff is fine and the final slack notification were also 
> fine!
>
> Every "sh" call is wrapped by the try ... catch ... throw ... so if there 
> would
> be an error the pipeline should stop at the stage where the error appears.
>
> I wrote manually a jenkinsfile but ... as you can guess ... all fine.
>
> I didn't found a way to check the build state. When is this set?
> Can I do an echo of current state so I could add some output?
>
> currentBuild.result prints null, so obviously this is not used.
> Any help, proposes?
>
> Kind regards,
> Thomas
>

-- 
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/deca56cf-72e0-4735-a570-e59aad7b79e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins 2.x - Pipeline(DSL) - Build failed but all stages are green

2016-07-21 Thread thomas . lehmann
When I do this ... currentBuild.result = "FAILURE" for a small test 
pipeline job then the build fails also the stages are green.
Exactly the problem I explained. When setting to "SUCCESS" all is fine. So 
obvious there is anything adjusting the state wrongly.

Is there a way where I can check the success state after each operation?
(as mentioned ... echo currentBuild.result prints null)

On Thursday, July 21, 2016 at 12:07:43 PM UTC+2, thomas@teamaol.com 
wrote:
>
> Will give it a try ...
>
> On Thursday, July 21, 2016 at 12:00:15 PM UTC+2, Thomas Zoratto wrote:
>>
>> currentBuild.result is writable
>>
>> try to set it to 'SUCCESS' when before your pipeline reaches the end
>>
>> Le 21 juil. 2016 à 11:53, thomas@teamaol.com a écrit :
>>
>> We are working with Jenkins 2.13 the moment.
>> We have a ci/cd pipeline with all stages green but the build itself is 
>> red.
>>
>> From the log I cannot see anything which gives me a hint.
>> Also all deployed stuff is fine and the final slack notification were 
>> also fine!
>>
>> Every "sh" call is wrapped by the try ... catch ... throw ... so if there 
>> would
>> be an error the pipeline should stop at the stage where the error appears.
>>
>> I wrote manually a jenkinsfile but ... as you can guess ... all fine.
>>
>> I didn't found a way to check the build state. When is this set?
>> Can I do an echo of current state so I could add some output?
>>
>> currentBuild.result prints null, so obviously this is not used.
>> Any help, proposes?
>>
>> Kind regards,
>> Thomas
>>
>> -- 
>> 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/13fa2d82-4e53-40df-a9a6-d6d2f020b2b7%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/5393aca6-eee1-4832-9dce-3052781a6010%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins 2.x - Pipeline(DSL) - Build failed but all stages are green

2016-07-21 Thread thomas . lehmann
Will give it a try ...

On Thursday, July 21, 2016 at 12:00:15 PM UTC+2, Thomas Zoratto wrote:
>
> currentBuild.result is writable
>
> try to set it to 'SUCCESS' when before your pipeline reaches the end
>
> Le 21 juil. 2016 à 11:53, thomas@teamaol.com  a écrit :
>
> We are working with Jenkins 2.13 the moment.
> We have a ci/cd pipeline with all stages green but the build itself is red.
>
> From the log I cannot see anything which gives me a hint.
> Also all deployed stuff is fine and the final slack notification were also 
> fine!
>
> Every "sh" call is wrapped by the try ... catch ... throw ... so if there 
> would
> be an error the pipeline should stop at the stage where the error appears.
>
> I wrote manually a jenkinsfile but ... as you can guess ... all fine.
>
> I didn't found a way to check the build state. When is this set?
> Can I do an echo of current state so I could add some output?
>
> currentBuild.result prints null, so obviously this is not used.
> Any help, proposes?
>
> Kind regards,
> Thomas
>
> -- 
> 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/13fa2d82-4e53-40df-a9a6-d6d2f020b2b7%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/2164302d-50df-4c0d-ad29-ce7d72358486%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins 2.x - Pipeline(DSL) - Build failed but all stages are green

2016-07-21 Thread thomas . lehmann
We are working with Jenkins 2.13 the moment.
We have a ci/cd pipeline with all stages green but the build itself is red.

>From the log I cannot see anything which gives me a hint.
Also all deployed stuff is fine and the final slack notification were also 
fine!

Every "sh" call is wrapped by the try ... catch ... throw ... so if there 
would
be an error the pipeline should stop at the stage where the error appears.

I wrote manually a jenkinsfile but ... as you can guess ... all fine.

I didn't found a way to check the build state. When is this set?
Can I do an echo of current state so I could add some output?

currentBuild.result prints null, so obviously this is not used.
Any help, proposes?

Kind regards,
Thomas

-- 
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/13fa2d82-4e53-40df-a9a6-d6d2f020b2b7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins 2.x: jenkinscli failed to start pipeline build (freestyle does work)

2016-06-07 Thread thomas . lehmann
I've been creating two jobs:

   - FOO1 (pipeline)
   - FOO2 (freestyle).

No configuration; just creation of the jobs.
I have registered a SSH key with no passphrase at my user.
The jenkins-cli.jar has been downloaded from the Jenkins specified in the 
URL.
I'm using Jenkins 2.0-rc1 the moment.

$ cat build.sh 
#!/bin/bash
PROMPT="$(basename $0) :: "
echo "${PROMPT}Build job for ${JOB_NAME} ..."
java -jar jenkins-cli.jar -s ${JENKINS_URL} -i ${JENKINS_PRIVATE_KEY} build 
"${JOB_NAME}"

With "*export JOB_NAME=FOO1; ./build.sh*" I get following output:

build.sh :: Build job for FOO1 ...

ERROR: No such job 'FOO1'; perhaps you meant 'Build-and-run-Nginx'?

With "*export JOB_NAME=FOO2; ./build.sh*" I get no error and the freestyle 
job is really executed.

Regards,
Thomas

-- 
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/aef40f03-4c74-434e-97d2-39a5b2856ad4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins 2.x pipeline: how to get git details after checkout?

2016-05-11 Thread thomas . lehmann
How do I get the git information right which were - in the past - provided 
by Jenkins Git plugin?

I have found one information 
here: 
https://github.com/jenkinsci/pipeline-examples/blob/master/pipeline-examples/gitcommit/gitcommit.groovy
You see that in the code below (extract).

I have the treeish (job parameter which refers to a git tag name or git 
branch name).

What I'm still missing ... let's say since last build there might have been 
(n=5) commits.
So I would like to have the "n" commit messages. I know how to get the last 
"n" log messages in Git ...
...but how do I know how many commits have been since last build?





*I see from the stage view (left side, row labels) that the pipeline 
definitely knows aboutthe number of commits and even it knows the git 
details showing them in a tooltip whenI move with the mouse cursor above 
the label.*
*How can I get this information after the checkout?*

Kind Regards,
Thomas

APPENDIX:

// ...

// Retrieving first 6 characters of the SHA Git commit id.
def getCommit() {
def command="git rev-parse HEAD > " + this.workspace + "/GIT_COMMIT"
script.sh(command)
script.readFile(this.workspace + "/GIT_COMMIT").take(6)
}

// ...

stage 'Get Code'
checkout([$class: 'GitSCM', branches: [[name: treeish]],
doGenerateSubmoduleConfigurations: false,
submoduleCfg: [],
userRemoteConfigs: [[credentialsId: 'XXX_CREDENTIALS',
 url: 
'ssh://git@xxt']]])



-- 
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/eeba94cb-242f-4c53-b5bb-acee892202e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to MaskPasswordsBuildWrapper in DSL?

2016-04-27 Thread thomas . lehmann
In addition to mention:

The "Snippet Generator" provides documentation on this:

*Password Parameter*s, or any other type of build parameters selected for 
masking in Hudson's/Jenkins' main configuration screen (*Manage Hudson* > 
*Configure 
System*), will be automatically masked.

And also provide code generation. Even with specifying in the job
a name and a password doesn't work:

wrap([$class: 'MaskPasswordsBuildWrapper', varPasswordPairs: 
[[password: '4567', var: 'BAR']]]) {
echo "BAR=${BAR}"
echo "FOO=${FOO}"
}

Result:

groovy.lang.MissingPropertyException: No such property: BAR for class: 
WorkflowScript
at 
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:53)






On Wednesday, April 27, 2016 at 11:31:15 AM UTC+2, thomas@teamaol.com 
wrote:
>
> I created a masked password FOO with "1234".
> Here my simple test DSL script:
>
> node {
> stage "ONE"
>
> wrap([$class: 'MaskPasswordsBuildWrapper']) {
> echo "FOO=${FOO}"
> }
> }
>
> Independent whether I check "Prepare an environment for the run" or not 
> ...
> I get this:
>
> groovy.lang.MissingPropertyException: No such property: FOO for class: 
> WorkflowScript
>   at 
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:53)
>   at 
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:458)
>
>
> Most probably I'm using it the wrong way.
> Could you please help on this?
>
> Regards,
> Thomas
>
>
>
>
>

-- 
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/beed4e52-0c25-4304-9148-80f4b3c5e17c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to MaskPasswordsBuildWrapper in DSL?

2016-04-27 Thread thomas . lehmann
I created a masked password FOO with "1234".
Here my simple test DSL script:

node {
stage "ONE"
   
wrap([$class: 'MaskPasswordsBuildWrapper']) {
echo "FOO=${FOO}"
}
}

Independent whether I check "Prepare an environment for the run" or not ...
I get this:

groovy.lang.MissingPropertyException: No such property: FOO for class: 
WorkflowScript
at 
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:53)
at 
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:458)


Most probably I'm using it the wrong way.
Could you please help on this?

Regards,
Thomas




-- 
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/433c8b4e-7e35-4fa1-a203-cad4e53acaf1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins 2.x - DSL - error handling?

2016-04-13 Thread thomas . lehmann
See my answer 
here: https://groups.google.com/forum/#!topic/jenkinsci-users/QN7ClRVj1fQ

On Wednesday, April 13, 2016 at 10:43:04 AM UTC+2, thomas@teamaol.com 
wrote:
>
> Assume a pipeline where one stage "Provide Database" runs a Docker 
> container providing a database.
> Assume we have some tests in a next stage "Run Tests".
> Assume the tests fails.
>
> *How do I cleanup the running Docker container when the*
> *next stage "Cleanup Database" is not called*?
>
> Kind Regards,
> Thomas
>

-- 
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/c2aef460-d012-4c3f-9677-9462b51068d7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How can I react to a build failure in pipeline?

2016-04-13 Thread thomas . lehmann
Hi,

It took me a while to find it but it looks like this is the approach
which is also documented ...

... you can find the relating documentation when you use the "*Snippet 
Generator*"
looking for the entry "*catchError*" and then clicking one the question 
mark.

The final implementation of course depends on your needs. If you wanna stop
the pipeline but doing the cleanup then next example is probably one way to 
go.
But you also could do a kind of cleanup and proceed with next stage when 
this
is possible in your case.

A bit unfortune - I say - that such things are not documented 
here: https://jenkins.io/doc/pipeline/

Regards,
Thomas

node {
try {
stage "One"
sh "rm /tmp/file_does_not_exist"
} catch (all) {
// doing some cleanup for stage one
throw new Exception("Stage One failed!")
} 

try {
stage "Two"
echo "hello world!"
} catch (all) {
// doing some cleanup for stage two
throw new Exception("Stage Two failed!")
} 
}




On Wednesday, April 13, 2016 at 12:25:44 AM UTC+2, Scott Richmond wrote:
>
> I need to be able to do a HTTP POST when the Jenkins Pipeline job finishes 
> in failure due to some issue in the process of doing its tasks. Basically I 
> need to surround the pipeline in a giant try-catch{}. Does pipeline provide 
> functionality to perform final tasks in the event of a failure?
>

-- 
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/7c2528d6-e13a-4408-919c-0a884b9ea258%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins 2.x - DSL - error handling?

2016-04-13 Thread thomas . lehmann
Assume a pipeline where one stage "Provide Database" runs a Docker 
container providing a database.
Assume we have some tests in a next stage "Run Tests".
Assume the tests fails.

*How do I cleanup the running Docker container when the*
*next stage "Cleanup Database" is not called*?

Kind Regards,
Thomas

-- 
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/d6964f2b-38bd-4b61-9bc3-f2e5b2a8445c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to change the folder name of each build?

2016-04-12 Thread thomas . lehmann
I don't get currently why you need to change that since build number and 
build date are displayed in
the Jenkins build history.

If you need further information like which component and which version
has been built on a concrete build number then you might look for this:
https://wiki.jenkins-ci.org/display/JENKINS/Description+Setter+Plugin

I hope it did help.

Regards,
Thomas


On Tuesday, April 12, 2016 at 11:53:43 AM UTC+2, Franz Sarmiento wrote:
>
> Hello!
>
> So I know how to edit the build display name that gets displayed via the 
> Jenkins build history, but I'm confused how to edit the name of the folder 
> of the build itself? For example, if I have a build #30, the directory is 
> also called "30". I want to modify this to be dates instead, is there any 
> way to do that? I'm talking about the individual build directory name 
> itself, not the one that shows up on the Jenkins web portal.
>
> I tried editing it via the set next build number plugin, but I don't want 
> to do it manually each time I need to build. I just want to change the 
> folder name into the date. It says that it needs to be an integer, but even 
> a plain int with format "YYMMDD" is fine for me, since I read that it must 
> always be increasing.
>
> Jenkins version: 1.642.4
>
> Cheers,
> Franz
>

-- 
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/826adb01-be6b-4d9d-ade5-4347629f421b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins 2.x (DSL) - can ansi color be used used?

2016-04-11 Thread thomas . lehmann
I found it after some Google 
searches: https://github.com/dblock/jenkins-ansicolor-plugin

$ cat cicd/Jenkinsfile 
#!groovy
node {
wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm', 
'defaultFg': 1, 'defaultBg': 2]) {
// This is the current syntax for invoking a build wrapper, naming 
the class.
wrap([$class: 'TimestamperBuildWrapper']) {




On Monday, April 11, 2016 at 4:14:45 PM UTC+2, thomas@teamaol.com wrote:
>
> Hi,
>
> relating Jenkins 2.x and DSL ...
> You can do a wrap([$class: 'TimestamperBuildWrapper']) { ... } for getting 
> timestamps.
> *Is there also a way to get the ansi color plugin enabled*?
> (https://wiki.jenkins-ci.org/display/JENKINS/AnsiColor+Plugin)
>
> Kind Regards,
> Thomas
>

-- 
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/d78768f2-7982-4857-ae62-2bcf62ab3f19%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins 2.x (DSL) - can ansi color be used used?

2016-04-11 Thread thomas . lehmann
Hi,

relating Jenkins 2.x and DSL ...
You can do a wrap([$class: 'TimestamperBuildWrapper']) { ... } for getting 
timestamps.
*Is there also a way to get the ansi color plugin enabled*?
(https://wiki.jenkins-ci.org/display/JENKINS/AnsiColor+Plugin)

Kind Regards,
Thomas

-- 
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/86e6011d-c842-4458-a3dc-2ecf240cd08a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins 2.x Pipeline: masked password defined globally not passed?

2016-04-08 Thread thomas . lehmann
Using RC1 of Jenkins 2.0 I check that when globally defining environment
variables those are passed to the pipeline but using the masked password
plugin those variable seems not being passed.

Anyway I'm missing the "Inject passwords to the build as environment 
variables"
which was provided by the 
https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin.

Could somebody please verify?
Is there another solution? Will it be fixed?

Kind Regards,
Thomas

-- 
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/3e31de01-0391-4873-b9ba-263324953d17%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins 2.x Pipeline - parametrized build, parameters are not evaluated in Git

2016-04-08 Thread thomas . lehmann
I tested that with the first release candidate.
*The issue is still there!*

On Wednesday, April 6, 2016 at 8:10:09 AM UTC+2, thomas@teamaol.com 
wrote:
>
> *Just to clarify*:
> The variable is required before using the content of the repository.
> That's true for the normal use of the Git plugin and also documented
> looking at the question icon (in both cases, normal and the pipeline 
> variant)
>
> The text:
>
>- *${ENV_VARIABLE}*
>It is also possible to use environment variables. In this case the 
>variables are evaluated and the result is used as described above.
>E.g. ${TREEISH}, refs/tags/${TAGNAME},...
>
>
> I think it is also logical. I would like to run a pipeline on "git master" 
> to deploy into production.
> But I also need to be able to run the pipeline for a feature branch (which 
> ends after the regression tests).
>
> Kind Regards,
> Thomas
>
>
> On Tuesday, April 5, 2016 at 1:36:48 PM UTC+2, Björn Pedersen wrote:
>>
>> Hi,
>>
>>  yes, I can confirm that behaviour. Taking a closer look at the log shows 
>> that any build wrappers that inject e.g. Environment vars are not running 
>> at this early stage. 
>> My guess is, that the assumption was that these wrappers are instantiated 
>> in the Jenkinsfile, so that they are not yet known. 
>>
>> Wether this is a good assumption in all use-cases is an open question.
>>
>> Björn
>>
>> Am Dienstag, 5. April 2016 09:47:50 UTC+2 schrieb thomas@teamaol.com:
>>>
>>> Hi,
>>>
>>> Mode: Pipeline script from SCM
>>>
>>>
>>> I tried to change working example to take a TAG as String parameter
>>> and to use *${TAG}* for the Branch using the Pipeline job in Jenkins 2.x
>>> When trying this I get this:
>>>
>>>  > git rev-parse origin/${TAG}^{commit} # timeout=10
>>>  > git rev-parse ${TAG}^{commit} # timeout=10
>>> ERROR: Couldn't find any revision to build. Verify the repository and 
>>> branch configuration for this job.
>>>
>>>
>>> It looks to me that the variable TAG is not evaluated. Using "master" 
>>> instead
>>> of "${TAG}" works fine.
>>>
>>>
>>> Bug? I guess so.
>>>
>>>
>>> Kind Regards,
>>>
>>> Thomas
>>>
>>>
>>> PS: I tried to register at Jenkins JIRA but it's a nightmare. Either the 
>>> captcha popup appears
>>> after hours, or it timeouts or I get null pointer exception after 
>>> submitting or whatever.
>>>
>>> After 20 minutes I gave up. So don't ask me to write a ticket please ;)
>>>
>>>

-- 
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/00bf4baf-764e-4c86-8722-ee99a02d3ac7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins 2.x Pipeline - parametrized build, parameters are not evaluated in Git

2016-04-06 Thread thomas . lehmann
*Just to clarify*:
The variable is required before using the content of the repository.
That's true for the normal use of the Git plugin and also documented
looking at the question icon (in both cases, normal and the pipeline 
variant)

The text:

   - *${ENV_VARIABLE}*
   It is also possible to use environment variables. In this case the 
   variables are evaluated and the result is used as described above.
   E.g. ${TREEISH}, refs/tags/${TAGNAME},...


I think it is also logical. I would like to run a pipeline on "git master" 
to deploy into production.
But I also need to be able to run the pipeline for a feature branch (which 
ends after the regression tests).

Kind Regards,
Thomas


On Tuesday, April 5, 2016 at 1:36:48 PM UTC+2, Björn Pedersen wrote:
>
> Hi,
>
>  yes, I can confirm that behaviour. Taking a closer look at the log shows 
> that any build wrappers that inject e.g. Environment vars are not running 
> at this early stage. 
> My guess is, that the assumption was that these wrappers are instantiated 
> in the Jenkinsfile, so that they are not yet known. 
>
> Wether this is a good assumption in all use-cases is an open question.
>
> Björn
>
> Am Dienstag, 5. April 2016 09:47:50 UTC+2 schrieb thomas@teamaol.com:
>>
>> Hi,
>>
>> Mode: Pipeline script from SCM
>>
>>
>> I tried to change working example to take a TAG as String parameter
>> and to use *${TAG}* for the Branch using the Pipeline job in Jenkins 2.x
>> When trying this I get this:
>>
>>  > git rev-parse origin/${TAG}^{commit} # timeout=10
>>  > git rev-parse ${TAG}^{commit} # timeout=10
>> ERROR: Couldn't find any revision to build. Verify the repository and branch 
>> configuration for this job.
>>
>>
>> It looks to me that the variable TAG is not evaluated. Using "master" instead
>> of "${TAG}" works fine.
>>
>>
>> Bug? I guess so.
>>
>>
>> Kind Regards,
>>
>> Thomas
>>
>>
>> PS: I tried to register at Jenkins JIRA but it's a nightmare. Either the 
>> captcha popup appears
>> after hours, or it timeouts or I get null pointer exception after submitting 
>> or whatever.
>>
>> After 20 minutes I gave up. So don't ask me to write a ticket please ;)
>>
>>

-- 
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/c060ea9c-9271-4f46-8d4b-e641764ab4ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins 2.x Pipeline - parametrized build, parameters are not evaluated in Git

2016-04-05 Thread thomas . lehmann
Hi,

Mode: Pipeline script from SCM


I tried to change working example to take a TAG as String parameter
and to use *${TAG}* for the Branch using the Pipeline job in Jenkins 2.x
When trying this I get this:

 > git rev-parse origin/${TAG}^{commit} # timeout=10
 > git rev-parse ${TAG}^{commit} # timeout=10
ERROR: Couldn't find any revision to build. Verify the repository and branch 
configuration for this job.


It looks to me that the variable TAG is not evaluated. Using "master" instead
of "${TAG}" works fine.


Bug? I guess so.


Kind Regards,

Thomas


PS: I tried to register at Jenkins JIRA but it's a nightmare. Either the 
captcha popup appears
after hours, or it timeouts or I get null pointer exception after submitting or 
whatever.

After 20 minutes I gave up. So don't ask me to write a ticket please ;)

-- 
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/bfea1f0d-b9e9-4be7-8aff-c00aece09876%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.