构建过程中的条件标准选择Nuget软件包
我们的构建环境是VSTS管道,我们的开发环境是视觉工作室。
我们正在使用开发分支(或特征分支),并且有一个主分支(主分支)。 随着代码越来越稳定,不需要太多调试,我们现在愿意将项目分为Nuget软件包。
只要我们在开发或功能分支中,我们就希望生成并使用-alpha Nuget软件包来测试和使用最新代码。 但是,一旦我们向主分支提取请求,我们就希望使用稳定的Nuget软件包。 当然,无需手动转到Nuget Package Manager并在委托之前更新每个Nuget软件包;
换句话说,开发分支机构中的每个项目都应使用每个Nuget软件包的-alpha版本自动构建,并且Master分支的构建应与稳定版本的软件包一起构建。 我们如何创建VST管道来实现这一目标
Our build environment is VSTS pipeline and our development environment is visual studio.
We are using dev branches (or feature branches) and we have a main branch (master branch).
As piece of code are getting stable and don't need much debug, We are now willing to split our projects into nuget packages.
As long as we are in dev or feature branch, we want to generate and use the -alpha nuget package to test and use the latest code.
But as soon as we are doing a pull request to the master branch, we want to use the stable nuget package.
Of course, without having to manually go to the nuget package manager and update every nuget package before committing;
Said differently, every project in a dev branch should automatically build with the -alpha version of each nuget package and the build of the master branch should be with the stable version of the package.
How can we create a vsts pipeline to achieve this
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以添加一个任务(PowerShell或Batch)来修改Nuget.config或项目文件以使用条件更新软件包版本。
You could add a task (powershell or batch) to modify the nuget.config or the project file to update the package version with condition.
您创建两个(构建)管道:
我个人对YAML的稳定Nuget软件包的触发,但是在经典的管道编辑器中,您可以轻松添加任务。每个管道都应该大致看起来像这样:
更多详细信息:
You create two (build) pipelines:
I personally don't have much experience with YAML, yet, but in the classic pipeline editor you can easily add tasks. Each pipeline should roughly be looking like this:
Some more details: