Re: why is the groovy code failing in jenkins?

2016-04-22 Thread Daniel Beck

> On 22.04.2016, at 17:03, ok999  wrote:
> 
> Is this issue intermittent by any chance ? I thought i got it working 
> yesterday (the looping part) thanks to stackoverflow but it wont perform the 
> loop today (on a friday!!!) 

No. However, there was a version of the 'Pipeline: Groovy' plugin (2.0) in 
which this was fixed, unfortunately this resulted in more severe problems, so 
it had to be reverted in 2.1.

https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Groovy+Plugin

-- 
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/8406392A-7709-444B-BBF1-E40A94EA6782%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.


Re: why is the groovy code failing in jenkins?

2016-04-22 Thread ok999
Is this issue intermittent by any chance ? I thought i got it working 
yesterday (the looping part) thanks to stackoverflow but it wont perform 
the loop today (on a friday!!!) 


node('windows') {
checkout([$class: 'GitSCM', branches: [[name: '*/master']], 
doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], 
userRemoteConfigs: [[credentialsId: 'cca9c557-65b8-4c72-9176-f78d91c22907', 
url: 'g...@github.com:RocketScienceProjects/testrobocopy.git']]])

def paths = ['folder1', 'folder2', 'folder3']
def dirs = ['dst1', 'dst2', 'dst3']
   [paths, dirs].transpose().each { pd ->
 def path = pd[0]
 def dir = pd[1]
  bat "xcopy %cd%\\${path} C:\\${dir} /E /Y /V"
  bat "(robocopy %cd%\\${path} C:\\${dir}\\temp lab.conf) ^& IF 
%ERRORLEVEL% LEQ 7 exit 0"
}
 }


PS: please dont worry abt the batch commands, they doesnt make sense. i am 
just trying to get the loop rolling :)



On Thursday, April 21, 2016 at 3:33:45 PM UTC-5, ok999 wrote:
>
> This a very basic test code for the pipleine job
>
>
> node('windows') {
> checkout([$class: 'GitSCM', branches: [[name: '*/master']], 
> doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], 
> userRemoteConfigs: [[credentialsId: 'cca9c557-65b8-4c72-9176-f78d', url: 
> 'g...@github.com:SomeProjects/trobocopy.git']]])
>
>
> def pathMap = ['folder1':'dst1', 'folder2':'dst2', 'folder3':'dst3', 
> 'folder4':'dst4'] 
>   pathMap.each { path, dir -> 
>bat "xcopy %cd%${path} C:\\${dir} /E /Y /V" 
>  }
> }
>
>
> The jenkins console shows 
>
> [Pipeline] End of Pipelinejava.io.NotSerializableException: 
> java.util.LinkedHashMap$Entry
>   at 
> org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:860)
>   at 
> org.jboss.marshalling.river.BlockMarshaller.doWriteObject(BlockMarshaller.java:65)
>   at 
> org.jboss.marshalling.river.BlockMarshaller.writeObject(BlockMarshaller.java:56)
>   at 
> org.jboss.marshalling.MarshallerObjectOutputStream.writeObjectOverride(MarshallerObjectOutputStream.java:50)
>   at 
> org.jboss.marshalling.river.RiverObjectOutputStream.writeObjectOverride(RiverObjectOutputStream.java:179)
>   at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:343)
>   at java.util.HashMap.writeObject(HashMap.java:1129)
>   at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
>   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>   at java.lang.reflect.Method.invoke(Method.java:606)
>
>
>
>
> Caused by: an exception which occurred:
>   in field locals
>   in field parent
>   in field capture
>   in field def
>   in field closures
>   in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@4d0c20da
> Finished: 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/b847fd7d-f861-402f-b3d0-2f44198d182e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: why is the groovy code failing in jenkins?

2016-04-21 Thread Patrick Wolf
There is a well known problem with .each in Pipeline right now that Kohsuke
is working on. There are many comments here:

https://issues.jenkins-ci.org/browse/JENKINS-26481

On Thu, Apr 21, 2016 at 1:33 PM, ok999  wrote:

> This a very basic test code for the pipleine job
>
>
> node('windows') {
> checkout([$class: 'GitSCM', branches: [[name: '*/master']],
> doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [],
> userRemoteConfigs: [[credentialsId: 'cca9c557-65b8-4c72-9176-f78d', url:
> 'g...@github.com:SomeProjects/trobocopy.git']]])
>
>
> def pathMap = ['folder1':'dst1', 'folder2':'dst2', 'folder3':'dst3',
> 'folder4':'dst4']
>   pathMap.each { path, dir ->
>bat "xcopy %cd%${path} C:\\${dir} /E /Y /V"
>  }
> }
>
>
> The jenkins console shows
>
> [Pipeline] End of Pipelinejava.io.NotSerializableException: 
> java.util.LinkedHashMap$Entry
>   at 
> org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:860)
>   at 
> org.jboss.marshalling.river.BlockMarshaller.doWriteObject(BlockMarshaller.java:65)
>   at 
> org.jboss.marshalling.river.BlockMarshaller.writeObject(BlockMarshaller.java:56)
>   at 
> org.jboss.marshalling.MarshallerObjectOutputStream.writeObjectOverride(MarshallerObjectOutputStream.java:50)
>   at 
> org.jboss.marshalling.river.RiverObjectOutputStream.writeObjectOverride(RiverObjectOutputStream.java:179)
>   at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:343)
>   at java.util.HashMap.writeObject(HashMap.java:1129)
>   at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
>   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>   at java.lang.reflect.Method.invoke(Method.java:606)
>
>
>
>
> Caused by: an exception which occurred:
>   in field locals
>   in field parent
>   in field capture
>   in field def
>   in field closures
>   in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@4d0c20da
> Finished: 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/cbe33a56-beab-414f-9302-8044e1e1a8f4%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Patrick Wolf
Sr. Product Manager
CloudBees

-- 
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/CAGDV0P-nfgZcokq84CL-4oCXjv1fzHb9BCNB6y0Pv6wtxUeKdw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


why is the groovy code failing in jenkins?

2016-04-21 Thread ok999
This a very basic test code for the pipleine job


node('windows') {
checkout([$class: 'GitSCM', branches: [[name: '*/master']], 
doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], 
userRemoteConfigs: [[credentialsId: 'cca9c557-65b8-4c72-9176-f78d', url: 
'g...@github.com:SomeProjects/trobocopy.git']]])


def pathMap = ['folder1':'dst1', 'folder2':'dst2', 'folder3':'dst3', 
'folder4':'dst4'] 
  pathMap.each { path, dir -> 
   bat "xcopy %cd%${path} C:\\${dir} /E /Y /V" 
 }
}


The jenkins console shows 

[Pipeline] End of Pipelinejava.io.NotSerializableException: 
java.util.LinkedHashMap$Entry
at 
org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:860)
at 
org.jboss.marshalling.river.BlockMarshaller.doWriteObject(BlockMarshaller.java:65)
at 
org.jboss.marshalling.river.BlockMarshaller.writeObject(BlockMarshaller.java:56)
at 
org.jboss.marshalling.MarshallerObjectOutputStream.writeObjectOverride(MarshallerObjectOutputStream.java:50)
at 
org.jboss.marshalling.river.RiverObjectOutputStream.writeObjectOverride(RiverObjectOutputStream.java:179)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:343)
at java.util.HashMap.writeObject(HashMap.java:1129)
at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)




Caused by: an exception which occurred:
in field locals
in field parent
in field capture
in field def
in field closures
in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@4d0c20da
Finished: 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/cbe33a56-beab-414f-9302-8044e1e1a8f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.