I am trying to do a poc of jenkins pipeline as code. I am using the Github organization folder plugin to scan Github orgs and create jobs per branch. Is there a way to explicitly define the names for the pipeline jobs that get from Jenkinsfile? I also want to add some descriptions for the jobs.
相关问题
- Jenkins - cmd is not recognized
- When using Nokogiri, how do you suppress the inser
- Where Jenkins stores plugin configuration
- Multi-branch configuration with externally-defined
- How to start pm2 website using jenkins on AWS ubun
相关文章
- dotnet restore还原nuget包时无法加载 https://api.nuget.org/
- jenkins在window集群环境中如何部署自动化发布?
- jenkins + Publish over FTP 自动部署前端React项目
- jenkins自定打包部署React前端项目遇到的问题。
- Best way to manage docker containers with supervis
- Access BitBucket payload data in Jenkins pipeline
- Jenkins Not Outputting Junit Report Info From File
- Intermittent “SVNException: svn: E175002: Connecti
You need to use
currentBuild
like below. Thenode
part is importantEdit: Above one renames build where as Original question is about renaming jobs. Following script in pipeline will do that(this requires appropriate permissions)
I tried to used code snippet from accepted answer to describe my Jenkins pipeline in Jenkinsfile. I had to wrap code snippet into function with
@NonCPS
annotation and use def for item variable. I have placed code snippet in root of Jenkinsfile, not in node section.I'm late to the party on this one, but this question forced me in the #jenkins chat where I spent most of my day today. I would like to thank @tang^ from that chat for helping solve this in a graceful way for my situation.
To set the JOB description and JOB display name for a child in a multi-branch DECLARATIVE pipeline use the following steps block in a stage:
This will require that you approve the individual script calls through the Jenkins sandbox approval method, but it was far simpler than anything else I'd found across the web about renaming the actual children of the parent pipeline. The last thing to note is that this should work in a Jenkinsfile where you can use the environment variables to manipulate the job items being set.