Kubernetes slaves in parallel

2017-02-01 Thread Lionel Orellana
Hi

I have a pipeline with a podTemaplate definition from the Kubernetes plugin 
to create slaves on Openshift. 

Something like this.

podTemplate(name: 'jenkins-slave', label: 'kube-node',  instanceCap: 4,
containers: [
containerTemplate(
name: 'maven', 
image: "${registry}:5000/jenkins/slave-maven",
command: '/bin/bash',
args: '',
alwaysPullImage: true,
ttyEnabled: true,
envVars: [containerEnvVar(key: 'no_proxy', value: "${noProxy}")]),
containerTemplate(
name: 'oc', 
image: "${registry}:5000/jenkins/slave-oc",
args: 'cat',
alwaysPullImage: true,
ttyEnabled: true,
envVars: [containerEnvVar(key: 'KUBE_TOKEN', value: "${token}")])
])
{
node('kube-node') {
   stage ('Compile') {
   container ('maven') {
}
   }
}
node('kube-node') {
stage ('Unit Tests') {
container('maven') {
}
}
}
node('kube-node') {
stage ('Container Build') {
container('oc') {
}
}
}
}

That works fine and 3 kube-node pods get created one after the other.  But 
I want to parallelise the Unit Tests and the Container Build stages. When I 
move those two nodes into a parallel step they still get created in 
sequence. 

 parallel (
   "Tests": {
   node('kube-node') {
   stage ('Unit Tests') {
   container('maven') {
   }
   }
   }
   },
   "Container": {
   node('kube-node') {
   stage ('Container Build') {
   container('oc') {
   }
   }
   }
   }
)

The console shows both branches waiting for a new pod to be created.


[Pipeline] parallel[Pipeline] [Tests] { (Branch: Tests)[Pipeline] [Container] { 
(Branch: Container)[Pipeline] [Tests] node[Pipeline] [Container] node

[Tests] Still waiting to schedule task
[Tests] All nodes of label ‘kube-node’ are offline
[Container] Still waiting to schedule task
[Container] All nodes of label ‘kube-node’ are offline


At this point one pod is created and one of the branches runs. The branch 
finishes, the pod is terminated, a new pod created and the other branch 
runs. 

I have set -Dhudson.slaves.NodeProvisioner.MARGIN=50 
-Dhudson.slaves.NodeProvisioner.MARGIN0=0.85 in my jenkins startup options 
but made no difference. 

Any ideas how I can parallise these pods? 

Thanks

Lionel



-- 
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/9854d0c9-5a7d-4d1c-be5d-1a6166ae7cb7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Pipeline: aborting an input step marks the stage as failed

2016-12-12 Thread Lionel Orellana
Hi,

Consider this stage step with a body and an input step. 

stage ('Deploy') {
 input 'Ready to deploy?'
 ...
}

If the user clicks Abort on the manual input step the stage is marked as 
failed.

If the input step is moved outside of the stage then the dialog doesn't 
come up when the user hovers overs the stage so I want to keep it there. 

The old-style stage without a body would have been marked as Aborted:

stage 'Deploy'
input 'Ready to deploy?'

(if the user Aborts, the stage is rightly marked as Aborted). 

Is there a way to make this work with the new stage format? 

Cheers

Lionel.

-- 
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/836c1a27-1ef7-4575-8ec1-7950e4d2efc7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Secure Jenkins and mutlibranch github pipeline trigger

2016-10-06 Thread Lionel Orellana
Hi Corey

Unfortunately I don't have this server running anymore. I was just using it 
to learn stuff. But I do remember that re-registering hooks worked straight 
away for me. Are you behind a firewall? I was running this on a cloud 
provider with direct access from the outside world (e.g. from github.com) 
 When you say it doesn't work, what error or wrong behavior do you see?

Lionel 

On Thursday, 6 October 2016 16:49:12 UTC+11, Corey Wei wrote:
>
> Hi Lionel,
>
> I just tested this on Jenkins 2.19.1. 
> Looks like "Re-register hooks for all jobs" is not working for my 
> multibranch job. Is there anything I am missing?
>
> Thanks
>
> On Monday, May 9, 2016 at 9:08:52 PM UTC+8, Lionel Orellana wrote:
>>
>>
>> Apologies for my rather disorganised thought process in this thread.  
>>
>> I just found the 'Re-register hooks for all jobs' in the global config 
>> (GitHub Servers Advanced options). That created the hooks correctly for me 
>> without any additional configuration in the multibranch job. 
>>
>> Thanks.
>>
>> On Saturday, 7 May 2016 16:38:49 UTC+10, Lionel Orellana wrote:
>>>
>>> Well seems like the solution would for the GitHub Plugin to support 
>>> Multibranch pipelines
>>>
>>> On Saturday, 7 May 2016 12:29:22 UTC+10, Lionel Orellana wrote:
>>>>
>>>> Hi All
>>>>
>>>> How can I trigger a build on a multibranch pipeline where there is a 
>>>> push in github and Jenkins requires authentication.
>>>>
>>>> I tried "Trigger builds remotely (e.g., from scripts)" but the token 
>>>> generated here isn't enough for a github webhook to authenticate with 
>>>> Jenkins.  Github throws "Authentication required". This is using  a 
>>>> webhook like /job//build?token=some token  where 
>>>> the token matches what's in the "Trigger builds remotely" configuration.
>>>>
>>>> Thanks
>>>>
>>>> Lionel.
>>>>
>>>>  
>>>>
>>>

-- 
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/2af91f3c-6f77-4528-b2e6-2fd6becfb132%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Git Polling fails after upgrade

2016-07-01 Thread Lionel Orellana
That worked. Thanks. 

On Friday, 1 July 2016 14:56:54 UTC+10, Mark Waite wrote:
>
> You need to upgrade the workflow pipeline components in addition to the 
> git plugin.  The git workflow SCM step really belongs inside the git 
> plugin, so we moved it there as part of git plugin 2.5.0.
>
> On Thu, Jun 30, 2016 at 10:55 PM Lionel Orellana <lion...@gmail.com 
> > wrote:
>
>> Not related to my original problem which was fixed with one of the latest 
>> builds, there is an issue with the Git plugin. 
>>
>> I get the errors I mentioned before when upgrading to 2.5.0 even with 
>> jenkins core 2.12-SNAPSHOT. Manually reverting back to Git plugin 2.4.4 
>> works.
>>
>>
>> On Friday, 1 July 2016 13:37:03 UTC+10, Lionel Orellana wrote:
>>>
>>> If I upgrade the Git plugin to 2.5.0 from 2.4.4  I get 
>>>
>>> SEVERE: found cycle in plugin dependencies: (root=Plugin:git, 
>>> deactivating all involved) Plugin:git -> Plugin:workflow-scm-step -> 
>>> Plugin:git
>>>
>>> and all hell breaks loose. 
>>>
>>> WARNING: Failed to load 
>>> net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition$DescriptorImpl
>>> java.lang.NoClassDefFoundError: hudson/plugins/git/GitSCM
>>>
>>> Jul 01, 2016 1:23:44 PM 
>>> hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1 error
>>> WARNING: Failed to instantiate 
>>> Key[type=org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition$DescriptorImpl,
>>>  
>>> annotation=[none]]; skipping this component
>>> com.google.inject.ProvisionException: Guice provision errors:
>>>
>>> 1) Error injecting constructor, java.lang.NoClassDefFoundError: 
>>> org/jenkinsci/plugins/workflow/steps/scm/SCMStep
>>>   at 
>>> org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition$DescriptorImpl.(CpsScmFlowDefinition.java:134)
>>> Caused by: java.lang.ClassNotFoundException: 
>>> org.jenkinsci.plugins.workflow.steps.scm.SCMStep
>>> at 
>>> jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1376)
>>> at 
>>> jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1326)
>>> at 
>>> jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1079)
>>>
>>> and a few more similar errors. 
>>>
>>>
>>>
>>>
>>> On Friday, 1 July 2016 13:20:12 UTC+10, Lionel Orellana wrote:
>>>>
>>>> Hi, 
>>>>
>>>> I just upgraded from 2.10 to 2.11 not expecting much to change but I'm 
>>>> getting this error now in my git projects.
>>>>
>>>> ERROR: Failed to record SCM polling for 
>>>> hudson.maven.MavenModuleSet@5830700a[] 
>>>>
>>>> java.lang.NullPointerException 
>>>> <http://stacktrace.jenkins-ci.org/search?query=java.lang.NullPointerException>
>>>>
>>>>  at 
>>>> jenkins.triggers.SCMTriggerItem$SCMTriggerItems$Bridge.poll(SCMTriggerItem.java:124)
>>>> at 
>>>> hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:528)
>>>> at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:574)
>>>> at 
>>>> hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:119)
>>>> at 
>>>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
>>>> at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>>>> at 
>>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>>>> at 
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>>>> at java.lang.Thread.run(Thread.java:745)
>>>>
>>>>
>>>>
>>>>
>>>> I tried upgrading the Git Plugin and the GitHub Branch Source plugin 
>>>> but that only made it worse and Jenkins wouldn't start so I had to revert 
>>>> that.
>>>>
>>>> Anyone had this problem before?
>>>>
>>>> Thanks
>>>>
>>>> Lionel.
>>>>
>>> -- 
>> 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/83ce4ae0-b61e-46d2-9746-53e1a86f2e2d%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/83ce4ae0-b61e-46d2-9746-53e1a86f2e2d%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> 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/b66a541e-8b17-4a8e-b1cc-691761262d0b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Git Polling fails after upgrade

2016-06-30 Thread Lionel Orellana
Not related to my original problem which was fixed with one of the latest 
builds, there is an issue with the Git plugin. 

I get the errors I mentioned before when upgrading to 2.5.0 even with 
jenkins core 2.12-SNAPSHOT. Manually reverting back to Git plugin 2.4.4 
works.

On Friday, 1 July 2016 13:37:03 UTC+10, Lionel Orellana wrote:
>
> If I upgrade the Git plugin to 2.5.0 from 2.4.4  I get 
>
> SEVERE: found cycle in plugin dependencies: (root=Plugin:git, deactivating 
> all involved) Plugin:git -> Plugin:workflow-scm-step -> Plugin:git
>
> and all hell breaks loose. 
>
> WARNING: Failed to load 
> net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition$DescriptorImpl
> java.lang.NoClassDefFoundError: hudson/plugins/git/GitSCM
>
> Jul 01, 2016 1:23:44 PM 
> hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1 error
> WARNING: Failed to instantiate 
> Key[type=org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition$DescriptorImpl,
>  
> annotation=[none]]; skipping this component
> com.google.inject.ProvisionException: Guice provision errors:
>
> 1) Error injecting constructor, java.lang.NoClassDefFoundError: 
> org/jenkinsci/plugins/workflow/steps/scm/SCMStep
>   at 
> org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition$DescriptorImpl.(CpsScmFlowDefinition.java:134)
> Caused by: java.lang.ClassNotFoundException: 
> org.jenkinsci.plugins.workflow.steps.scm.SCMStep
> at 
> jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1376)
> at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1326)
> at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1079)
>
> and a few more similar errors. 
>
>
>
>
> On Friday, 1 July 2016 13:20:12 UTC+10, Lionel Orellana wrote:
>>
>> Hi, 
>>
>> I just upgraded from 2.10 to 2.11 not expecting much to change but I'm 
>> getting this error now in my git projects.
>>
>> ERROR: Failed to record SCM polling for 
>> hudson.maven.MavenModuleSet@5830700a[] 
>>
>> java.lang.NullPointerException 
>> <http://stacktrace.jenkins-ci.org/search?query=java.lang.NullPointerException>
>>
>>  at 
>> jenkins.triggers.SCMTriggerItem$SCMTriggerItems$Bridge.poll(SCMTriggerItem.java:124)
>> at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:528)
>> at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:574)
>> at 
>> hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:119)
>> at 
>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
>> at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>> at 
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>> at 
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>> at java.lang.Thread.run(Thread.java:745)
>>
>>
>>
>>
>> I tried upgrading the Git Plugin and the GitHub Branch Source plugin but 
>> that only made it worse and Jenkins wouldn't start so I had to revert that.
>>
>> Anyone had this problem before?
>>
>> Thanks
>>
>> Lionel.
>>
>

-- 
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/83ce4ae0-b61e-46d2-9746-53e1a86f2e2d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Git Polling fails after upgrade

2016-06-30 Thread Lionel Orellana
Thanks Mark.

On Friday, 1 July 2016 13:28:40 UTC+10, Mark Waite wrote:
>
> Looks like that might be fixed in the latest source code.  Refer to 
> https://github.com/jenkinsci/jenkins/commit/6d29dd4554345aed2905e8ab32da678e301736a7#diff-b2027094e76e9b99db901e8cd779e580
>  .
>
> Seems to be documented as a bug in Jenkins 2.11, 
> https://issues.jenkins-ci.org/browse/JENKINS-36232 .  Your could roll 
> back to Jenkins 2.10, or build from the latest source code.
>
> Mark Waite
>
> On Thu, Jun 30, 2016 at 9:20 PM Lionel Orellana <lion...@gmail.com 
> > wrote:
>
>> Hi, 
>>
>> I just upgraded from 2.10 to 2.11 not expecting much to change but I'm 
>> getting this error now in my git projects.
>>
>> ERROR: Failed to record SCM polling for 
>> hudson.maven.MavenModuleSet@5830700a[] 
>>
>> java.lang.NullPointerException 
>> <http://stacktrace.jenkins-ci.org/search?query=java.lang.NullPointerException>
>>
>>  at 
>> jenkins.triggers.SCMTriggerItem$SCMTriggerItems$Bridge.poll(SCMTriggerItem.java:124)
>> at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:528)
>> at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:574)
>> at 
>> hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:119)
>> at 
>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
>> at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>> at 
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>> at 
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>> at java.lang.Thread.run(Thread.java:745)
>>
>>
>>
>>
>> I tried upgrading the Git Plugin and the GitHub Branch Source plugin but 
>> that only made it worse and Jenkins wouldn't start so I had to revert that.
>>
>> Anyone had this problem before?
>>
>> Thanks
>>
>> Lionel.
>>
>> -- 
>> 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/b91cdfba-237d-409b-b3b9-80a8fdbd92db%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/b91cdfba-237d-409b-b3b9-80a8fdbd92db%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> 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/1e4ee4c2-b836-4789-8748-fac44e3dcf99%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Git Polling fails after upgrade

2016-06-30 Thread Lionel Orellana
If I upgrade the Git plugin to 2.5.0 from 2.4.4  I get 

SEVERE: found cycle in plugin dependencies: (root=Plugin:git, deactivating 
all involved) Plugin:git -> Plugin:workflow-scm-step -> Plugin:git

and all hell breaks loose. 

WARNING: Failed to load 
net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition$DescriptorImpl
java.lang.NoClassDefFoundError: hudson/plugins/git/GitSCM

Jul 01, 2016 1:23:44 PM 
hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1 error
WARNING: Failed to instantiate 
Key[type=org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition$DescriptorImpl,
 
annotation=[none]]; skipping this component
com.google.inject.ProvisionException: Guice provision errors:

1) Error injecting constructor, java.lang.NoClassDefFoundError: 
org/jenkinsci/plugins/workflow/steps/scm/SCMStep
  at 
org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition$DescriptorImpl.(CpsScmFlowDefinition.java:134)
Caused by: java.lang.ClassNotFoundException: 
org.jenkinsci.plugins.workflow.steps.scm.SCMStep
at 
jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1376)
at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1326)
at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1079)

and a few more similar errors. 




On Friday, 1 July 2016 13:20:12 UTC+10, Lionel Orellana wrote:
>
> Hi, 
>
> I just upgraded from 2.10 to 2.11 not expecting much to change but I'm 
> getting this error now in my git projects.
>
> ERROR: Failed to record SCM polling for 
> hudson.maven.MavenModuleSet@5830700a[] 
>
> java.lang.NullPointerException 
> <http://stacktrace.jenkins-ci.org/search?query=java.lang.NullPointerException>
>
>  at 
> jenkins.triggers.SCMTriggerItem$SCMTriggerItems$Bridge.poll(SCMTriggerItem.java:124)
> at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:528)
> at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:574)
> at 
> hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:119)
> at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
> at java.util.concurrent.FutureTask.run(FutureTask.java:262)
> at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> at java.lang.Thread.run(Thread.java:745)
>
>
>
>
> I tried upgrading the Git Plugin and the GitHub Branch Source plugin but 
> that only made it worse and Jenkins wouldn't start so I had to revert that.
>
> Anyone had this problem before?
>
> Thanks
>
> Lionel.
>

-- 
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/ca0b3529-bade-4958-8ad2-3c4ef3bb2cee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to break a pipeline manually?

2016-06-29 Thread Lionel Orellana
Thanks Sverre. That marks the build as failed though. 

Doing a return between nodes is what I was looking for to exit without 
changing the build result. 

On Wednesday, 29 June 2016 17:20:34 UTC+10, Sverre Moe wrote:
>
> You could use the error step:
> error 'Error message'
>
> https://jenkins.io/doc/pipeline/steps/workflow-basic-steps/#code-error-code-error-signal
>
> mandag 30. mai 2016 09.21.16 UTC+2 skrev Feng Yu følgende:
>>
>> Hi there:
>> Here is my pipeline code:
>> node{
>> // my code here
>> try {
>> // some steps
>> currentBuild.result = 'SUCCESS'
>> } catch (Exception err) {
>> currentBuild.result = 'FAILURE'
>> mail  // email to me if failed
>> // some clean steps
>> }
>>
>> if (currentBuild.result == 'FAILURE') {
>> // How to exit pipeline ?
>> }
>>
>> /*
>>  * other steps here
>>  */
>> }
>>
>>
>> How do I break the pipeline manually if some steps failed?
>>
>> 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/9556d548-5a72-41f3-8a9d-2b26ff449567%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to break a pipeline manually?

2016-06-29 Thread Lionel Orellana

That gets out of the node but will continue if there other nodes below it. 

I've found that to get out completely it needs to be at the very top (i.e. 
between nodes). 

On Wednesday, 29 June 2016 16:41:56 UTC+10, Michael Neale wrote:
>
> If return is called from the "top level" of a script (ie not inside a 
> function) then it should return early. 
>
> eg: 
>
> node {
>
>   echo "42"
>   if (42 == 42) {
>   currentBuild.result = 'UNSTABLE'
>   return
>   }
>echo "43"
> }
>
> This will exit early and never print "43". 
>
> On Wednesday, June 29, 2016 at 2:28:37 PM UTC+10, Lionel Orellana wrote:
>>
>> From what I've tried simply returning doesn't stop the execution of the 
>> script. 
>>
>> If you throw an exception the result seems to always be FAILURE. 
>>
>> I would like to know if there is a way to stop execution but leave the 
>> result as say UNSTABLE.
>>
>> On Monday, 30 May 2016 18:38:41 UTC+10, Michael Neale wrote:
>>>
>>> you can just return - and it should exit the script? (or throw an 
>>> exception).
>>>
>>> On Monday, May 30, 2016 at 5:21:16 PM UTC+10, Feng Yu wrote:
>>>>
>>>> Hi there:
>>>> Here is my pipeline code:
>>>> node{
>>>> // my code here
>>>> try {
>>>> // some steps
>>>> currentBuild.result = 'SUCCESS'
>>>> } catch (Exception err) {
>>>> currentBuild.result = 'FAILURE'
>>>> mail  // email to me if failed
>>>> // some clean steps
>>>> }
>>>>
>>>> if (currentBuild.result == 'FAILURE') {
>>>> // How to exit pipeline ?
>>>> }
>>>>
>>>> /*
>>>>  * other steps here
>>>>  */
>>>> }
>>>>
>>>>
>>>> How do I break the pipeline manually if some steps failed?
>>>>
>>>> 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/e081b199-d20f-4512-b79a-604b97435ba5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to break a pipeline manually?

2016-06-28 Thread Lionel Orellana
>From what I've tried simply returning doesn't stop the execution of the 
script. 

If you throw an exception the result seems to always be FAILURE. 

I would like to know if there is a way to stop execution but leave the 
result as say UNSTABLE.

On Monday, 30 May 2016 18:38:41 UTC+10, Michael Neale wrote:
>
> you can just return - and it should exit the script? (or throw an 
> exception).
>
> On Monday, May 30, 2016 at 5:21:16 PM UTC+10, Feng Yu wrote:
>>
>> Hi there:
>> Here is my pipeline code:
>> node{
>> // my code here
>> try {
>> // some steps
>> currentBuild.result = 'SUCCESS'
>> } catch (Exception err) {
>> currentBuild.result = 'FAILURE'
>> mail  // email to me if failed
>> // some clean steps
>> }
>>
>> if (currentBuild.result == 'FAILURE') {
>> // How to exit pipeline ?
>> }
>>
>> /*
>>  * other steps here
>>  */
>> }
>>
>>
>> How do I break the pipeline manually if some steps failed?
>>
>> 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/4c203b58-2062-4a0d-94d2-2aac30bfcb17%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline and SonarQube

2016-06-27 Thread Lionel Orellana
A workaround is to have a freestyle job do the sonar analysis and call that 
from the pipeline. I'll see if I can jump in and do some work in the 
SonarQube plugin though.

On Monday, 27 June 2016 21:54:24 UTC+10, Lionel Orellana wrote:
>
> Some work seems to be happening here: 
> https://jira.sonarsource.com/browse/SONARJNKNS-213
>
> Thanks.
>
> On 27 June 2016 at 17:57, Antonio Muñiz <amu...@cloudbees.com> wrote:
>
>> To get a similar UX for SonarQube when using Pipeline, the SonarQube 
>> Jenkins Plugin needs to be adapted to Pipeline (i.e. a `sonar` step that 
>> prepares the environment and execute the analysis using any predefined 
>> goals (with any predefined options).
>>
>> On Mon, Jun 27, 2016 at 9:06 AM, Lionel Orellana <lione...@gmail.com> 
>> wrote:
>>
>>> Hi,
>>>
>>> I have a job where I use the SonarQube plugin option to "Prepare 
>>> SonarQube Scanner environment" and then run the sonar maven goal like this:
>>>
>>> $SONAR_MAVEN_GOAL -Dsonar.host.url=$SONAR_HOST_URL $SONAR_EXTRA_PROPS
>>>
>>> How can I do this in Pipeline? I would image I can Prepare SonarQube 
>>> environment using a step? 
>>>
>>> Thanks
>>>
>>> Lionel.
>>>
>>>
>>> -- 
>>> 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/79d501b5-bcf6-44ee-953e-1bb2ee0684ac%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/jenkinsci-users/79d501b5-bcf6-44ee-953e-1bb2ee0684ac%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> -- 
>> Antonio Muñiz
>> Software Engineer
>> CloudBees, Inc.
>>
>> -- 
>> 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/vC4XR7bqemY/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/CAJc7kzS1P%3DXmK9BW_bAG4-_k7fgkN0s-8U-%2BnZXWSUgfGr5c-Q%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/CAJc7kzS1P%3DXmK9BW_bAG4-_k7fgkN0s-8U-%2BnZXWSUgfGr5c-Q%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
>> 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/b44adc31-f99a-4ad3-8582-a5276b3b4d4f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline and SonarQube

2016-06-27 Thread Lionel Orellana
Some work seems to be happening here:
https://jira.sonarsource.com/browse/SONARJNKNS-213

Thanks.

On 27 June 2016 at 17:57, Antonio Muñiz <amu...@cloudbees.com> wrote:

> To get a similar UX for SonarQube when using Pipeline, the SonarQube
> Jenkins Plugin needs to be adapted to Pipeline (i.e. a `sonar` step that
> prepares the environment and execute the analysis using any predefined
> goals (with any predefined options).
>
> On Mon, Jun 27, 2016 at 9:06 AM, Lionel Orellana <lione...@gmail.com>
> wrote:
>
>> Hi,
>>
>> I have a job where I use the SonarQube plugin option to "Prepare
>> SonarQube Scanner environment" and then run the sonar maven goal like this:
>>
>> $SONAR_MAVEN_GOAL -Dsonar.host.url=$SONAR_HOST_URL $SONAR_EXTRA_PROPS
>>
>> How can I do this in Pipeline? I would image I can Prepare SonarQube
>> environment using a step?
>>
>> Thanks
>>
>> Lionel.
>>
>>
>> --
>> 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/79d501b5-bcf6-44ee-953e-1bb2ee0684ac%40googlegroups.com
>> <https://groups.google.com/d/msgid/jenkinsci-users/79d501b5-bcf6-44ee-953e-1bb2ee0684ac%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Antonio Muñiz
> Software Engineer
> CloudBees, Inc.
>
> --
> 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/vC4XR7bqemY/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/CAJc7kzS1P%3DXmK9BW_bAG4-_k7fgkN0s-8U-%2BnZXWSUgfGr5c-Q%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-users/CAJc7kzS1P%3DXmK9BW_bAG4-_k7fgkN0s-8U-%2BnZXWSUgfGr5c-Q%40mail.gmail.com?utm_medium=email_source=footer>
> .
>
> 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/CAO-n44N-E_VtLKf3aa4%3DWxr-YbPrJuiVHW_ooPEvsRM-ZbBdkg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Pipeline and SonarQube

2016-06-27 Thread Lionel Orellana
Hi,

I have a job where I use the SonarQube plugin option to "Prepare SonarQube 
Scanner environment" and then run the sonar maven goal like this:

$SONAR_MAVEN_GOAL -Dsonar.host.url=$SONAR_HOST_URL $SONAR_EXTRA_PROPS

How can I do this in Pipeline? I would image I can Prepare SonarQube 
environment using a step? 

Thanks

Lionel.


-- 
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/79d501b5-bcf6-44ee-953e-1bb2ee0684ac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Secure Jenkins and mutlibranch github pipeline trigger

2016-05-09 Thread Lionel Orellana

Apologies for my rather disorganised thought process in this thread.  

I just found the 'Re-register hooks for all jobs' in the global config 
(GitHub Servers Advanced options). That created the hooks correctly for me 
without any additional configuration in the multibranch job. 

Thanks.

On Saturday, 7 May 2016 16:38:49 UTC+10, Lionel Orellana wrote:
>
> Well seems like the solution would for the GitHub Plugin to support 
> Multibranch pipelines
>
> On Saturday, 7 May 2016 12:29:22 UTC+10, Lionel Orellana wrote:
>>
>> Hi All
>>
>> How can I trigger a build on a multibranch pipeline where there is a push 
>> in github and Jenkins requires authentication.
>>
>> I tried "Trigger builds remotely (e.g., from scripts)" but the token 
>> generated here isn't enough for a github webhook to authenticate with 
>> Jenkins.  Github throws "Authentication required". This is using  a 
>> webhook like /job//build?token=some token  where 
>> the token matches what's in the "Trigger builds remotely" configuration.
>>
>> Thanks
>>
>> Lionel.
>>
>>  
>>
>

-- 
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/9d64a0bd-c50b-4eff-ae8b-dc303732cdee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Secure Jenkins and mutlibranch github pipeline trigger

2016-05-07 Thread Lionel Orellana
Well seems like the solution would for the GitHub Plugin to support 
Multibranch pipelines

On Saturday, 7 May 2016 12:29:22 UTC+10, Lionel Orellana wrote:
>
> Hi All
>
> How can I trigger a build on a multibranch pipeline where there is a push 
> in github and Jenkins requires authentication.
>
> I tried "Trigger builds remotely (e.g., from scripts)" but the token 
> generated here isn't enough for a github webhook to authenticate with 
> Jenkins.  Github throws "Authentication required". This is using  a 
> webhook like /job//build?token=some token  where 
> the token matches what's in the "Trigger builds remotely" configuration.
>
> Thanks
>
> Lionel.
>
>  
>

-- 
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/20857378-40b9-4ffb-b2d6-f8fcb7cae005%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Secure Jenkins and mutlibranch github pipeline trigger

2016-05-06 Thread Lionel Orellana
Invoking without the branch name in the url triggers the indexing job of
course. So it seems I need a different webhook per branch?

On 7 May 2016 at 14:17, Lionel Orellana <lione...@gmail.com> wrote:

> Actually something's not quite right.
>
> Firstly, the configuration in the Multibranch project to "Trigger builds
> remotely" disappears after I save. Select the option, put a token, save and
> reopen. They are gone.
>
> Secondly, assuming the configuration is actually saved, the url to trigger
> the build needs to have the branch name in it:
>
>   /job//branch/master/build?token=some token
>
> This actually works (despite the config seemingly not being saved). But
> without the branch name in the url it doesn't do anything. So do I have to
> setup a different webhook for each branch?
>
> It feels like this should work out of the box and I'm doing something very
> silly.
>
>
>
> And yet, invoking the url with curl triggers the build. Seems like a UI
> problem.
>
> On Saturday, 7 May 2016 12:29:22 UTC+10, Lionel Orellana wrote:
>>
>> Hi All
>>
>> How can I trigger a build on a multibranch pipeline where there is a push
>> in github and Jenkins requires authentication.
>>
>> I tried "Trigger builds remotely (e.g., from scripts)" but the token
>> generated here isn't enough for a github webhook to authenticate with
>> Jenkins.  Github throws "Authentication required". This is using  a
>> webhook like /job//build?token=some token  where
>> the token matches what's in the "Trigger builds remotely" configuration.
>>
>> Thanks
>>
>> Lionel.
>>
>>
>>
> --
> 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/Jv2V4tldkFs/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/78ab11b0-4df2-47a2-8153-a2c51ab1fc7a%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/78ab11b0-4df2-47a2-8153-a2c51ab1fc7a%40googlegroups.com?utm_medium=email_source=footer>
> .
> 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/CAO-n44OQOLm_O1Ai6MaVyUm5oJZ0JChJyoZJc9Se6mNwO6o86g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Secure Jenkins and mutlibranch github pipeline trigger

2016-05-06 Thread Lionel Orellana
Actually something's not quite right.

Firstly, the configuration in the Multibranch project to "Trigger builds 
remotely" disappears after I save. Select the option, put a token, save and 
reopen. They are gone. 

Secondly, assuming the configuration is actually saved, the url to trigger 
the build needs to have the branch name in it:

  /job//branch/master/build?token=some token

This actually works (despite the config seemingly not being saved). But 
without the branch name in the url it doesn't do anything. So do I have to 
setup a different webhook for each branch? 

It feels like this should work out of the box and I'm doing something very 
silly.



And yet, invoking the url with curl triggers the build. Seems like a UI 
problem. 

On Saturday, 7 May 2016 12:29:22 UTC+10, Lionel Orellana wrote:
>
> Hi All
>
> How can I trigger a build on a multibranch pipeline where there is a push 
> in github and Jenkins requires authentication.
>
> I tried "Trigger builds remotely (e.g., from scripts)" but the token 
> generated here isn't enough for a github webhook to authenticate with 
> Jenkins.  Github throws "Authentication required". This is using  a 
> webhook like /job//build?token=some token  where 
> the token matches what's in the "Trigger builds remotely" configuration.
>
> Thanks
>
> Lionel.
>
>  
>

-- 
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/78ab11b0-4df2-47a2-8153-a2c51ab1fc7a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Secure Jenkins and mutlibranch github pipeline trigger

2016-05-06 Thread Lionel Orellana
Sorry found my answer. Nothing to do with pipeline. 

http://:@/job//build?token=job 
token

On Saturday, 7 May 2016 12:29:22 UTC+10, Lionel Orellana wrote:
>
> Hi All
>
> How can I trigger a build on a multibranch pipeline where there is a push 
> in github and Jenkins requires authentication.
>
> I tried "Trigger builds remotely (e.g., from scripts)" but the token 
> generated here isn't enough for a github webhook to authenticate with 
> Jenkins.  Github throws "Authentication required". This is using  a 
> webhook like /job//build?token=some token  where 
> the token matches what's in the "Trigger builds remotely" configuration.
>
> Thanks
>
> Lionel.
>
>  
>

-- 
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/55283fad-2948-47f8-8938-e33951d7c94a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Secure Jenkins and mutlibranch github pipeline trigger

2016-05-06 Thread Lionel Orellana
Hi All

How can I trigger a build on a multibranch pipeline where there is a push 
in github and Jenkins requires authentication.

I tried "Trigger builds remotely (e.g., from scripts)" but the token 
generated here isn't enough for a github webhook to authenticate with 
Jenkins.  Github throws "Authentication required". This is using  a webhook 
like /job//build?token=some token  where the token 
matches what's in the "Trigger builds remotely" configuration.

Thanks

Lionel.

 

-- 
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/626e3f75-bb73-4523-a07a-adc57b589d25%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 2.0 Pipeline - input step with choice param fails

2016-05-04 Thread Lionel Orellana
Cool. Gracias.

On 4 May 2016 at 18:43, Antonio Muñiz <amu...@cloudbees.com> wrote:

>
> On Sun, May 1, 2016 at 4:21 PM, Lionel Orellana <lione...@gmail.com>
> wrote:
>
>> Any ideas?
>
>
> Filed https://issues.jenkins-ci.org/browse/JENKINS-34590 (there is a
> workaround in a comment).
>
>
> --
> Antonio Muñiz
> Software Engineer
> CloudBees, Inc.
>
> --
> 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/IM9HmP3PMf8/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/CAJc7kzSUM4mnnyK1jauz6kaVzUY1CW21LktxTobJxcEh%3D3i8LA%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-users/CAJc7kzSUM4mnnyK1jauz6kaVzUY1CW21LktxTobJxcEh%3D3i8LA%40mail.gmail.com?utm_medium=email_source=footer>
> .
> 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/CAO-n44PmUUtSZohTNTuWS24ei420f2_FDe1FsJHveMz6JNZKyQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Proxy for branch indexing in multibranch pipeline

2016-05-02 Thread Lionel Orellana
It was the switch from the Git branch source to the GitHub branch source what 
probably fixed mine. I only found there was a github one whe I upgraded.

-- 
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/bd1789d2-1374-4714-a96e-806b9a2a1c94%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


2.0 Pipeline - input step with choice param fails

2016-05-01 Thread Lionel Orellana
Hello

I got this code from the snippet generator to capture user input with a 
Choice Parameter:

input message: 'where do you want to build this?', parameters: [[$class: 
'ChoiceParameterDefinition', choices: ['ec2', 'docker'], description: '', 
name: 'label']]

When I add it to my pipeline it throws

java.lang.ClassCastException: hudson.model.ChoiceParameterDefinition.choices 
expects class java.lang.String but received class java.util.ArrayList


ChoiceParameterDefinition 
 
does seem to have a constructor that takes a string[] for choices. 

Any ideas?

thanks

Lionel.

-- 
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/6ee54f06-ca8b-45ef-b079-8cef1c8ea713%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-05-01 Thread Lionel Orellana
Doesn't the Pipeline Multibranch Plugin 
 do 
what you want? Still sounds like a bug though.

On Friday, 8 April 2016 17:06:59 UTC+10, thomas@teamaol.com wrote:
>
> 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/c42063b8-3595-4023-ab4a-c26c4e5c629f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Proxy for branch indexing in multibranch pipeline

2016-04-29 Thread Lionel Orellana

Upgrading from 1.656 to 2.0 fixed it.

The GitHub Branch Source Plugin is probably what made the difference. I was 
using a Git (as opposed to GitHub) branch source before.

On Friday, 29 April 2016 15:51:58 UTC+10, Lionel Orellana wrote:
>
> Hi
>
> I have a proxy configured in my Jenkins settings (Manage Plugins -> 
> Advanced). 
>
> I'm pretty sure this is what makes freestyle jobs and Pipelines set the 
> proxy before connecting to github. 
>
> Here's the output from a Pipeline job:
>
>  > /opt/rh/devtoolset-2/root/usr/bin/git config --local credential.helper 
> store --file=/tmp/git7252640829815953814.credentials # timeout=10*Setting 
> http proxy: serverproxy:8080*
>
>  > /opt/rh/devtoolset-2/root/usr/bin/git -c core.askpass=true fetch --tags 
> --progress https://github.com//*.git 
> <https://github.com/afsadev/debt-agreement.git> 
> +refs/heads/*:refs/remotes/origin/*
>
>
> But when I try to run the indexing job in a Multibranch pipeline it fails 
> to connect to github. It seems to me it is not setting the proxy.
>
> FATAL: Failed to recompute children of Debt Agreement Service Pipeline
>
> hudson.plugins.git.GitException 
> <http://stacktrace.jenkins-ci.org/search?query=hudson.plugins.git.GitException>:
>  org.eclipse.jgit.api.errors.TransportException: 
> https://github.com/*/*.git 
> <https://github.com/afsadev/debt-agreement.git>: cannot open git-upload-pack
>   at 
> org.jenkinsci.plugins.gitclient.JGitAPIImpl.fetch(JGitAPIImpl.java:680) 
> <http://stacktrace.jenkins-ci.org/search/?query=org.jenkinsci.plugins.gitclient.JGitAPIImpl.fetch=method>
>   at 
> jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:174)
>  
> <http://stacktrace.jenkins-ci.org/search/?query=jenkins.plugins.git.AbstractGitSCMSource.retrieve=method>
>   at jenkins.scm.api.SCMSource.fetch(SCMSource.java:146) 
> <http://stacktrace.jenkins-ci.org/search/?query=jenkins.scm.api.SCMSource.fetch=method>
>   at 
> jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:296)
>  
> <http://stacktrace.jenkins-ci.org/search/?query=jenkins.branch.MultiBranchProject.computeChildren=method>
>   at 
> com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:151)
>  
> <http://stacktrace.jenkins-ci.org/search/?query=com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren=method>
>   at 
> com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:122)
>  
> <http://stacktrace.jenkins-ci.org/search/?query=com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run=method>
>   at hudson.model.ResourceController.execute(ResourceController.java:98) 
> <http://stacktrace.jenkins-ci.org/search/?query=hudson.model.ResourceController.execute=method>
>   at hudson.model.Executor.run(Executor.java:410) 
> <http://stacktrace.jenkins-ci.org/search/?query=hudson.model.Executor.run=method>
> Caused by: org.eclipse.jgit.api.errors.TransportException 
> <http://stacktrace.jenkins-ci.org/search?query=org.eclipse.jgit.api.errors.TransportException>:
>  https://github.com/**/***.git 
> <https://github.com/afsadev/debt-agreement.git>: cannot open git-upload-pack
>   at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:139) 
> <http://stacktrace.jenkins-ci.org/search/?query=org.eclipse.jgit.api.FetchCommand.call=method>
>   at 
> org.jenkinsci.plugins.gitclient.JGitAPIImpl.fetch(JGitAPIImpl.java:678) 
> <http://stacktrace.jenkins-ci.org/search/?query=org.jenkinsci.plugins.gitclient.JGitAPIImpl.fetch=method>
>   ... 7 more
> Caused by: org.eclipse.jgit.errors.TransportException 
> <http://stacktrace.jenkins-ci.org/search?query=org.eclipse.jgit.errors.TransportException>:
>  https://github.com/*/**.git 
> <https://github.com/afsadev/debt-agreement.git>: cannot open git-upload-pack
>   at 
> org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:524) 
> <http://stacktrace.jenkins-ci.org/search/?query=org.eclipse.jgit.transport.TransportHttp.connect=method>
>   at 
> org.eclipse.jgit.transport.TransportHttp.openFetch(TransportHttp.java:309) 
> <http://stacktrace.jenkins-ci.org/search/?query=org.eclipse.jgit.transport.TransportHttp.openFetch=method>
>   at 
> org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:136) 
> <http://stacktrace.jenkins-ci.org/search/?query=org.eclipse.jgit.transport.FetchProcess.executeImp=method>
>   at 
> org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:122) 
> <http://stacktrace.jenkins

Proxy for branch indexing in multibranch pipeline

2016-04-28 Thread Lionel Orellana
Hi

I have a proxy configured in my Jenkins settings (Manage Plugins -> 
Advanced). 

I'm pretty sure this is what makes freestyle jobs and Pipelines set the 
proxy before connecting to github. 

Here's the output from a Pipeline job:

 > /opt/rh/devtoolset-2/root/usr/bin/git config --local credential.helper store 
 > --file=/tmp/git7252640829815953814.credentials # timeout=10*Setting http 
 > proxy: serverproxy:8080*

 > /opt/rh/devtoolset-2/root/usr/bin/git -c core.askpass=true fetch --tags 
 > --progress https://github.com//*.git 
 >  
 > +refs/heads/*:refs/remotes/origin/*


But when I try to run the indexing job in a Multibranch pipeline it fails 
to connect to github. It seems to me it is not setting the proxy.

FATAL: Failed to recompute children of Debt Agreement Service Pipeline

hudson.plugins.git.GitException 
:
 org.eclipse.jgit.api.errors.TransportException: 
https://github.com/*/*.git 
: cannot open git-upload-pack
at 
org.jenkinsci.plugins.gitclient.JGitAPIImpl.fetch(JGitAPIImpl.java:680) 

at 
jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:174)
 

at jenkins.scm.api.SCMSource.fetch(SCMSource.java:146) 

at 
jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:296) 

at 
com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:151)
 

at 
com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:122)
 

at hudson.model.ResourceController.execute(ResourceController.java:98) 

at hudson.model.Executor.run(Executor.java:410) 

Caused by: org.eclipse.jgit.api.errors.TransportException 
:
 https://github.com/**/***.git 
: cannot open git-upload-pack
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:139) 

at 
org.jenkinsci.plugins.gitclient.JGitAPIImpl.fetch(JGitAPIImpl.java:678) 

... 7 more
Caused by: org.eclipse.jgit.errors.TransportException 
:
 https://github.com/*/**.git 
: cannot open git-upload-pack
at 
org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:524) 

at 
org.eclipse.jgit.transport.TransportHttp.openFetch(TransportHttp.java:309) 

at 
org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:136) 

at 
org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:122) 

at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1138) 

at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:130) 

... 8 more*Caused by: java.net.ConnectException 
: 
Connection timed out github.com
*   at org.eclipse.jgit.util.HttpSupport.response(HttpSupport.java:175) 

gitcredentials in Pipeline

2016-04-28 Thread Lionel Orellana
Hi 

I have a personal access token in my github account which I have added as a 
Credential in Jenkins. 

In freestyle jobs I can select the credential when configuring the git 
repository. This results in the token being used to configure 
gitcredentials when the job runs.

using .gitcredentials to set credentials
 > /opt/rh/devtoolset-2/root/usr/bin/git config --local credential.username 
 > * # timeout=10
 > /opt/rh/devtoolset-2/root/usr/bin/git config --local credential.helper store 
 > --file=/tmp/git8500404327159234501.credentials # timeout=10



How can I do this with the Pipeline git step? 

I tried the credentials-binding-plugin but didn't work.


node {   
   withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 
'cec6ad4c-a6c4-49ba-b7ba-95aace163002', passwordVariable: 'TOKEN', 
usernameVariable: 'USR']]) {
   git url: "https://${env.USR}:${env.TOKEN}@github.com/myuser/myrepo.git;
   }
}

[Pipeline] git > /opt/rh/devtoolset-2/root/usr/bin/git rev-parse 
--is-inside-work-tree # timeout=10
> Fetching changes from the remote Git repository
>  > /opt/rh/devtoolset-2/root/usr/bin/git config remote.origin.url 
> https://:@github.com/myuser/myrepo.git 
>  # timeout=10
> Fetching upstream changes from 
> https://@github.com/afsadev/debt-agreement.git
>  > /opt/rh/devtoolset-2/root/usr/bin/git --version # timeout=10
> Setting http proxy: serverproxy:8080
>  > /opt/rh/devtoolset-2/root/usr/bin/git -c core.askpass=true fetch --tags 
> --progress https://@github.com/ 
> myuser 
> /myrepo.git 
>  
> +refs/heads/*:refs/remotes/origin/*
> ERROR: Error fetching remote repo 'origin'hudson.plugins.git.GitException 
> :
>  Failed to fetch from https://@github.com/ 
> myuser 
> /myrepo.git 
> 
>   at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:810) 
> 
>   at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1066) 
> 
>   at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1097) 
> 
>   at 
> org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:109) 
> 
>   at 
> org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:83)
>  
> 
>   at 
> org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:73)
>  
> 
>   at 
> org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:49)
>  
> 
>   at hudson.security.ACL.impersonate(ACL.java:213) 
> 
>   at 
> org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:47)
>  
> 
>   at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) 
> 
>   at java.util.concurrent.FutureTask.run(FutureTask.java:262) 
> 
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>  
> 
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>  
> 
>   at java.lang.Thread.run(Thread.java:745) 
> 

Re: Access control in pipeline input step

2016-04-28 Thread Lionel Orellana
Great. Thanks.

On 28 April 2016 at 17:45, Daniel Beck <m...@beckweb.net> wrote:

>
> > On 28.04.2016, at 04:23, Lionel Orellana <lione...@gmail.com> wrote:
> >
> > How can I restrict who can actually approve a manual (i.e. input) step
> in a pipeline? If I have a "Deploy to PROD" step I only want people with a
> particular role to be able to approve. Am I going about it the wrong way?
> >
>
> 'input' accepts an optional parameter 'submitter' that is the group or
> user allowed to respond to the input request. If your role maps to a group
> in Jenkins, that's what you should be able to specify there.
>
>
> --
> 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/0iWKe6hQ-ek/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/E54FB9C5-A5DC-4927-BFDC-7194636B7B71%40beckweb.net
> .
> 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/CAO-n44OYkvnNawR5zJmB00NbxyUwT9vbHjMF43WX%2Bbcm5trmtQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Access control in pipeline input step

2016-04-27 Thread Lionel Orellana
Hi

How can I restrict who can actually approve a manual (i.e. input) step in a 
pipeline? If I have a "Deploy to PROD" step I only want people with a 
particular role to be able to approve. Am I going about it the wrong way?

Thanks

Lionel. 

-- 
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/e67e22f7-6c03-4821-b50b-2a21a3079ac5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins can't find existing artifacts

2016-04-26 Thread Lionel Orellana
Or **/logfiles/*

-- 
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/033fbba3-4ddb-4723-a4f6-13b1e0f1d313%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.