Re: Pass in a parameter/property specified by Jenkins job, not user

2018-08-25 Thread Qiang
Is the only purpose of the parameter/property to differentiate between the 
devtest/oat/prod? 
If that's the case, can you use ${env.JOB_NAME} ?


On Friday, August 24, 2018 at 10:47:14 AM UTC-5, Adam Hardy wrote:
>
> Hi 
>
> I'd like my Jenkins multi-branch and pipeline jobs to pass in a 
> pre-defined parameter or property to the build script in the git repo 
> specified. 
>
> This isn't for user input. I'm trying to improve the capabilities of a 
> microservices-oriented CD pipeline I inherited.
>
> I want to set up more or less the same job 3 times for each app / git 
> repo: once for devtest, once for oat and once for prod. 
>
> I'll use it to extract a set of configuration parameters from a yaml file 
> in the repo, which will specify stuff like deployment namespace, app, 
> version, docker registry url, credential id etc. 
>
> At the moment, I can only see how I can change the git repo details or ask 
> the user the input. 
>
> Thanks
> Adam
>
>
>
>

-- 
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/d332622d-7bdd-477e-87de-f1d7fd886f8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: JNLP java.nio.channels.ClosedChannelException with kubernetes-plugin

2018-08-25 Thread Mark Waite
Does the pod template meet the Kubernetes plugin constraints
 mentioned in
readme? Specifically, is ttyEnabled and is there a long-running process
that will allow the pod to continue running until the job completes?

On Sat, Aug 25, 2018 at 4:58 PM  wrote:

> I'm using Kubernetes plugin 1.12.3
>
> The plugin works well, but whenever the agent does streams the log to the
> master, it causes a connection exception as follows.
> To reproduce, simply create a free style job, restrict to run on the
> kubernetes pod, and add a step to sleep for 300 seconds.
>
>
> FATAL: command execution failed
> java.nio.channels.ClosedChannelException
>   at 
> org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154)
>   at 
> org.jenkinsci.remoting.protocol.impl.NIONetworkLayer.ready(NIONetworkLayer.java:142)
>   at org.jenkinsci.remoting.protocol.IOHub$OnReady.run(IOHub.java:795)
>   at 
> jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
>   at 
> jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>   at java.lang.Thread.run(Thread.java:748)
> Caused: java.io.IOException: Backing channel 'JNLP4-connect connection from 
> ip-192-168-247-3.us-west-2.compute.internal/192.168.247.3:23684' is 
> disconnected.
>   at 
> hudson.remoting.RemoteInvocationHandler.channelOrFail(RemoteInvocationHandler.java:214)
>   at 
> hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:283)
>   at com.sun.proxy.$Proxy110.isAlive(Unknown Source)
>   at hudson.Launcher$RemoteLauncher$ProcImpl.isAlive(Launcher.java:1137)
>   at hudson.Launcher$RemoteLauncher$ProcImpl.join(Launcher.java:1129)
>   at hudson.tasks.CommandInterpreter.join(CommandInterpreter.java:155)
>   at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:109)
>   at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
>   at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
>   at 
> hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
>   at hudson.model.Build$BuildExecution.build(Build.java:206)
>   at hudson.model.Build$BuildExecution.doRun(Build.java:163)
>   at 
> hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
>   at hudson.model.Run.execute(Run.java:1798)
>   at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
>   at hudson.model.ResourceController.execute(ResourceController.java:97)
>   at hudson.model.Executor.run(Executor.java:429)
> FATAL: Unable to delete script file /tmp/jenkins5788393309854271460.sh
> java.nio.channels.ClosedChannelException
>   at 
> org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154)
>   at 
> org.jenkinsci.remoting.protocol.impl.NIONetworkLayer.ready(NIONetworkLayer.java:142)
>   at org.jenkinsci.remoting.protocol.IOHub$OnReady.run(IOHub.java:795)
>   at 
> jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
>   at 
> jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>   at java.lang.Thread.run(Thread.java:748)
> Caused: hudson.remoting.ChannelClosedException: Channel "unknown": Remote 
> call on JNLP4-connect connection from 
> ip-192-168-247-3.us-west-2.compute.internal/192.168.247.3:23684 failed. The 
> channel is closing down or has closed down
>   at hudson.remoting.Channel.call(Channel.java:948)
>   at hudson.FilePath.act(FilePath.java:1036)
>   at hudson.FilePath.act(FilePath.java:1025)
>   at hudson.FilePath.delete(FilePath.java:1511)
>   at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:123)
>   at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
>   at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
>   at 
> hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
>   at hudson.model.Build$BuildExecution.build(Build.java:206)
>   at hudson.model.Build$BuildExecution.doRun(Build.java:163)
>   at 
> hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
>   at hudson.model.Run.execute(Run.java:1798)
>   at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
>   at hudson.model.ResourceController.execute(ResourceController.java:97)
>   at hudson.model.Executor.run(Executor.java:429)
> Build step 

JNLP java.nio.channels.ClosedChannelException with kubernetes-plugin

2018-08-25 Thread fabio . douek
I'm using Kubernetes plugin 1.12.3

The plugin works well, but whenever the agent does streams the log to the 
master, it causes a connection exception as follows.
To reproduce, simply create a free style job, restrict to run on the 
kubernetes pod, and add a step to sleep for 300 seconds.


FATAL: command execution failed
java.nio.channels.ClosedChannelException
at 
org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154)
at 
org.jenkinsci.remoting.protocol.impl.NIONetworkLayer.ready(NIONetworkLayer.java:142)
at org.jenkinsci.remoting.protocol.IOHub$OnReady.run(IOHub.java:795)
at 
jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at 
jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused: java.io.IOException: Backing channel 'JNLP4-connect connection from 
ip-192-168-247-3.us-west-2.compute.internal/192.168.247.3:23684' is 
disconnected.
at 
hudson.remoting.RemoteInvocationHandler.channelOrFail(RemoteInvocationHandler.java:214)
at 
hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:283)
at com.sun.proxy.$Proxy110.isAlive(Unknown Source)
at hudson.Launcher$RemoteLauncher$ProcImpl.isAlive(Launcher.java:1137)
at hudson.Launcher$RemoteLauncher$ProcImpl.join(Launcher.java:1129)
at hudson.tasks.CommandInterpreter.join(CommandInterpreter.java:155)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:109)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
at hudson.model.Build$BuildExecution.build(Build.java:206)
at hudson.model.Build$BuildExecution.doRun(Build.java:163)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
at hudson.model.Run.execute(Run.java:1798)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
FATAL: Unable to delete script file /tmp/jenkins5788393309854271460.sh
java.nio.channels.ClosedChannelException
at 
org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154)
at 
org.jenkinsci.remoting.protocol.impl.NIONetworkLayer.ready(NIONetworkLayer.java:142)
at org.jenkinsci.remoting.protocol.IOHub$OnReady.run(IOHub.java:795)
at 
jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at 
jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused: hudson.remoting.ChannelClosedException: Channel "unknown": Remote call 
on JNLP4-connect connection from 
ip-192-168-247-3.us-west-2.compute.internal/192.168.247.3:23684 failed. The 
channel is closing down or has closed down
at hudson.remoting.Channel.call(Channel.java:948)
at hudson.FilePath.act(FilePath.java:1036)
at hudson.FilePath.act(FilePath.java:1025)
at hudson.FilePath.delete(FilePath.java:1511)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:123)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
at hudson.model.Build$BuildExecution.build(Build.java:206)
at hudson.model.Build$BuildExecution.doRun(Build.java:163)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
at hudson.model.Run.execute(Run.java:1798)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Build step 'Execute shell' marked build as 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 

Re: [CONCURRENT BUILDS] Run on master, run on slave and then sit in queue

2018-08-25 Thread Daniel Butler
If you set the number of executors on both master and slave to 1 that will
restrict the number of builds to one per node put a third into the queue.

Regards
Daniel

On Fri, 24 Aug 2018, 12:58 Nati Mirauta,  wrote:

> Hello,
>
> I would like to know if there is a way to run a job on master once and
> after another build request, instead of having the job stay in queue I
> would want the job to run on slave and then after it runs both on master
> and on slave, after the next build request it will have to sit in queue.
> For example I have JOB1, I build it and it runs on 'master', I build it
> again and JOB1 will run in parallel on 'slave', if I build it again while
> it's already running on 'master' and 'slave', the job will have to sit in
> queue.
>
> I have tried using the Throttle Concurrent Builds Plugin available for
> Jenkins but I do not know exactly how to use it in a scripted pipeline.
> Only thing I know how to do is make a job run concurrently on 'master 'or
> 'slave' (two runs - both or master or both on slave) with a single build
> using throttle(). I have to implement this functionality in a pipeline (no
> plug-in checkboxes) so it will make working with git easier. Can Jenkins
> support this functionality?, if yes, is it possible to implement it in a
> scripted pipeline? I am VERY new to Jenkins, I searched the internet but I
> can't find anything. I greatly appreciate any kind of help/tip, any
> documentation that can help me achieve this functionality.
>
> Thank-you 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/265011e8-83fa-4a93-b127-85f3ae17cda6%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/CAO37hbiQ96XsWMVbxcDxxPsqgaNqL1sfieQg%3DvSvG%2BdCT93s6Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.