简体   繁体   中英

VSTS build number for build definition

I have a few branches in my git repo eg master for production, dev for development, qa for testing, etc.

Each branch has it's own build definition, like app-dev, app-qa, app-prod, etc.

I'd like to include build number as a part of artifact name, eg 0.3.0-SNAPSHOT. 53 for development or 0.2.0-RC. 12 for testing.

Obviously each build definition's number should be unique.

Is it possible?

使用此处记录的$(Rev:.r)令牌: 内部编号格式

Use the predefined Build.BuildID variable. In your example, your build number definition would look like the following:

  • 0.3.0-SnapShot.${Build.BuildId}
  • 0.2.0-RC.${Build.BuildId}

All of the predefined variables are available in the Build Variables documentation

More information about Build Number formats can be found Here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM