This article is a mirror article of machine translation, please click here to jump to the original article.

View: 2868|Reply: 0

Azure DevOps (9) Configure different compilation patterns based on code branches

[Copy link]
Posted on 8/17/2023 7:47:30 PM | | | |
Requirements: A Git project has multiple branches, such as master, uat, qa, dev, etc., and the pipeline azure-pipelines.yml file content is the sameSet the buildConfiguration variable valueFor example: master branch release mode, uat branch uat mode, qa, dev branch debug mode, etc.

Review:

Azure DevOps (viii) Compiles ASP.NET MVC projects using Pipelines Build
https://www.itsvse.com/thread-10635-1-1.html

Azure DevOps (VII) creates an additional agent pool
https://www.itsvse.com/thread-10634-1-1.html

Azure DevOps 2020 (VI) Upgrade NuGet tools
https://www.itsvse.com/thread-9382-1-1.html

Azure DevOps 2020 (V) Automate the release of NUGET packages using Pipelines
https://www.itsvse.com/thread-9381-1-1.html

Azure DevOps 2020 (IV) Compiled jobs using Pipelines
https://www.itsvse.com/thread-9378-1-1.html

Azure DevOps 2020 (II) Azure DevOps Server Express 2020 RC2 installation tutorial
https://www.itsvse.com/thread-9375-1-1.html

Azure DevOps 2020 (III) limits search (ES) memory footprint
https://www.itsvse.com/thread-9371-1-1.html

Azure DevOps 2020 (1) First Introduction to Microsoft Azure DevOps (TFS)
https://www.itsvse.com/thread-9239-1-1.html

Meet Azure DevOps
https://www.itsvse.com/thread-8078-1-1.html


Option 1:

In the variables configuration, the code is as follows:


As shown in the following figure:



Option 2:

Set the default variable value to release mode, and then modify the value according to the branch name, the code is as follows:





Finally, the code is as follows:

reference

Using predefined variables:The hyperlink login is visible.
Expression:The hyperlink login is visible.




Previous:Compare Tailscale, ZeroTier, WireGuard, OmniEdge, and Ngrok for geo-networking solutions
Next:The Docker container is based on aspnet:6.0 to install the ping tool
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com