Set build number for Jenkins workflow (pipeline) builds

后端 未结 5 1299
野趣味
野趣味 2021-02-05 09:57

I am migrating jenkins-workflow job to new template based workflow job. Because the build number is used as part of the version of build artifacts the workflow produces I have

5条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-05 10:25

    Unfortunately the methods listed above didn't work for me when using folders. I resorted to the following in the Jenkins script console:

    job = Jenkins.getInstance().getItemByFullName("BSKAzureConversion-Jobs/master", Job.class)
    job.nextBuildNumber = 92
    job.save()
    

提交回复
热议问题