Re: FilePath in Jenkinsfile

2016-08-25 Thread Salvian Reynaldi
No need for recursion :) Actually I tried using new File() firstly, but Jenkins sandbox seems prevent calling to new File() (and new DateTime(), etc.) Moreover, as the docs for FilePath says: Unlike File , which always

Re: FilePath in Jenkinsfile

2016-08-25 Thread jerome
See this link for more file manipulation with groovy: http://grails.asia/groovy-file-examples -- 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+u

Re: FilePath in Jenkinsfile

2016-08-25 Thread jerome
Not sure if you need recursion or not but: new File(".").eachDir() { it -> println it.getAbsolutePath() } new File(".").eachFileRecurse() { it -> println it.getAbsolutePath() } I had many problem with iterator into JenkinsFile where only the first match ever get executed. But if your bash scri

Re: FilePath in Jenkinsfile

2016-08-24 Thread Salvian Reynaldi
P.S. I tried def currentChannel = env.build.workspace channel, and gets "No such property: build for class: groovy.lang.Binding" error any help towards the goal (list child directories) would be appreciated On Thursday, August 25, 2016 at 11:31:24 AM UTC+7, Salvian Reynaldi wrote: > > I had a b

FilePath in Jenkinsfile

2016-08-24 Thread Salvian Reynaldi
I had a bash script that push some directories to AWS S3 for dir in */ ; do "push.sh" "${dir::-1}" done assuming the current directory is X, the script will push ./a/ and ./b/ into s3://.../a/X and s3://.../b/X Now i'm trying to switch to Jenkinsfile. To traverse child directories (lik