Hi Martin. Yes that is quite confusing. Well for one, I used the "env" to mean the key in a closure that ends up in config, which is slightly naughty, given there is already an env global - so probably shouldn't do what I did ;)
I am not sure why it wouldn't work like that - if you use double quotes, then I think it would use string interpolation to expand it (perhaps there is a missing call to the token expander). checkout scm - that is for when it is multibranch - that will only work if you are running the job form a Jenkinsfile On Saturday, March 12, 2016 at 6:56:51 AM UTC+11, Martin d'Anjou wrote: > > Hi Michael, > > I played with the plugin quite a bit. I am very enthusiastic about this > plugin, because it gives me a way to manage the pipeline script development > as if it were a regular plugin (code, test, version and release), while > being much easier to write than a regular plugin. > > I do not plan to use the mini simpleBuild DSL as is, but I plan to use its > base class PipelineDSLGlobal and build a different core with it. I do not > plan on using the Jenkinsfile aspect yet, because I have multiple CD/CI > pipelines per branch in my projects, and only one Jenkinsfile is supported > currently. > > One thing I was trying to do was to acess the "env" and the build > parameters from inside the simpleBuild Closure. I changed "env" to "map" in > the source (so "env" would not be hidden), and I attempted the following: > simpleBuild { > ... > map = [url: "http://host/path/${PARAM}/${env.BUILD_NUMBER}"] > ... > } > > I tried various ways of setting the closure delegate (see it on my github > fork > <https://github.com/martinda/simple-build-for-pipeline-plugin/blob/feature/access-env-and-build-params/src/main/resources/dsl/simpleBuild.groovy#L45-L73>) > > but the alternative I tried results in not being able to resolve the "scm" > in "checkout scm". If I use ${this.env.BUILD_NUMBER}, then it works, but I > would feel more comfortable using your code if I understood why > ${env.BUILD_NUMBER} cannot be resolved. The Closure owner is a > WorkflowScript after all, and it should have "env". > > Thanks, > Martin > > On Wednesday, February 24, 2016 at 9:42:41 PM UTC-5, Michael Neale wrote: >> >> Hey I thought some may be interested in this Pipeline DSL enhancement (ie >> a plugin that enhances Jenkins pipeline) which is installable as a plugin: >> https://wiki.jenkins-ci.org/display/JENKINS/Simple+Build+For+Pipeline+Plugin >> - interested in thoughts/feedback (you use it where you would use a >> Jenkinsfile or pipeline script). >> >> -- 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/1e3c85b1-b228-4c3b-bdf8-c7533ecbe358%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.