I have a report file I’m generating, and I would like to be able to add the current build number to that file within a Jenkins job. Is there an environment variable or plugin I can use to get at the current build number?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
BUILD_NUMBERis the current build number. You can use it in the command you execute for the job, or just use it in the script your job executes.See the Jenkins documentation for the full list of available environment variables. The list is also available from within your Jenkins instance at http://hostname/jenkins/env-vars.html.