Re: Problem with docker agent (declarative syntax)

2017-02-10 Thread Bartłomiej Kruczyk
Thanks for your reply, it's not yet documented but I found issue which 
asserted that this feature is implemented.
Christopher's solution works.

W dniu piątek, 10 lutego 2017 10:39:49 UTC+1 użytkownik R Tyler Croy 
napisał:
>
> (replies inline) 
>
> On Thu, 09 Feb 2017, Bart??omiej Kruczyk wrote: 
>
> > Hi, I have problem with setting docker agent type for my pipeline. 
> > 
> > Although something like this works: 
> > 
> > 
> > agent { 
> > docker 'myimage' 
> > 
> > } 
> > 
> > 
> > This does not: 
> > 
> > 
> > agent { 
> > docker { 
> > image: 'myimage' 
> > 
> > registry: 'localhost:5000' 
> > 
> > } 
> > } 
>
>
> As far as I am aware, there is no supported "registry" value inside that 
> `docker` block. 
>
>
> See also https://jenkins.io/doc/book/pipeline/syntax/#agent 
>
>
>
> - R. Tyler Croy 
>
> -- 
>  Code:  
>   Chatter:  
>  xmpp: rty...@jabber.org  
>
>   % gpg --keyserver keys.gnupg.net --recv-key 1426C7DC3F51E16F 
> -- 
>

-- 
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/e4134c0a-fb70-453e-9a53-e47a7762d507%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problem with docker agent (declarative syntax)

2017-02-10 Thread Bartłomiej Kruczyk
That worked like a charm. I had found issue 
https://issues.jenkins-ci.org/browse/JENKINS-39684, and source file you are 
referring but I didn't known what declarative syntax expression it should 
be.
Thank you!

W dniu piątek, 10 lutego 2017 13:02:33 UTC+1 użytkownik Christopher Orr 
napisał:
>
> Quick correction:
>
> On Fri, 10 Feb 2017, at 12:36, Christopher Orr wrote:
>
> Hi there,
>
> On Thu, 9 Feb 2017, at 13:38, Bartłomiej Kruczyk wrote:
>
> agent {
> docker {
> image: 'myimage'
>
> registry: 'localhost:5000'
>
> }
> } 
>
>
> A couple of points:
>
> 1. The syntax documentation is wrong at the moment: you should not add a 
> colon after the key
> 2. The key you're looking for is "registryUrl"
>
> Source: 
> https://github.com/jenkinsci/pipeline-model-definition-plugin/blob/3222d5a/pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/agent/AbstractDockerAgent.java#L33-L37
>
> For example:
> agent {
>   docker {
> image 'foo'
> registryUrl 'registry.example.com'
>   }
> }
>
>
> The 'registryUrl' value needs to be a proper URI, e.g. '
> https://registry.hub.docker.com'
>
> -Chris
>

-- 
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/0dfb81c8-8b07-4d4c-9d11-f02b925a7e6d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problem with docker agent (declarative syntax)

2017-02-10 Thread Christopher Orr
Hi there,



On Thu, 9 Feb 2017, at 13:38, Bartłomiej Kruczyk wrote:

> agent {
> docker {
> image: 'myimage'

> registry: 'localhost:5000'



> }
> }
> 





A couple of points:



1. The syntax documentation is wrong at the moment: you should not add a
   colon after the key
2. The key you're looking for is "registryUrl"



Source: 
https://github.com/jenkinsci/pipeline-model-definition-plugin/blob/3222d5a/pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/agent/AbstractDockerAgent.java#L33-L37


For example:

agent {

  docker {

image 'foo'

registryUrl 'registry.example.com'

  }

}



Regards,

Chris




-- 
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/1486726573.373537.876691200.05BF2406%40webmail.messagingengine.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problem with docker agent (declarative syntax)

2017-02-10 Thread R. Tyler Croy
(replies inline)

On Thu, 09 Feb 2017, Bart??omiej Kruczyk wrote:

> Hi, I have problem with setting docker agent type for my pipeline.
> 
> Although something like this works:
> 
> 
> agent {
> docker 'myimage'
> 
> }
> 
> 
> This does not:
> 
> 
> agent {
> docker {
> image: 'myimage'
> 
> registry: 'localhost:5000'
> 
> }
> }


As far as I am aware, there is no supported "registry" value inside that
`docker` block.


See also https://jenkins.io/doc/book/pipeline/syntax/#agent



- R. Tyler Croy

--
 Code: 
  Chatter: 
 xmpp: rty...@jabber.org

  % gpg --keyserver keys.gnupg.net --recv-key 1426C7DC3F51E16F
--

-- 
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/20170210093934.GC26439%40blackberry.coupleofllamas.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: Digital signature


Problem with docker agent (declarative syntax)

2017-02-09 Thread Bartłomiej Kruczyk
Hi, I have problem with setting docker agent type for my pipeline.

Although something like this works:


agent {
docker 'myimage'

}


This does not:


agent {
docker {
image: 'myimage'

registry: 'localhost:5000'

}
}


As I'm getting error: 


org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
WorkflowScript: 3: Expected to find someKey "someValue" @ line 3, column 12.
   docker {
  ^

WorkflowScript: 3: Missing required parameter for agent type "docker": image @ 
line 3, column 5.
   docker {
   ^

2 errors

at 
org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310)
at 
org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1073)
at 
org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:591)
at 
org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:569)
at 
org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:546)
at 
groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
at 
org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:67)
at 
org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:429)
at 
org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:392)
at 
org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:221)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
Finished: FAILURE

How I make it work?

-- 
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/b01854b3-e9e2-49ba-ab4e-9b20bd8200dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.