Teamcity 9:如何将git short hash添加到程序集信息修补程序中 [英] Teamcity 9: How to add git short hash into assembly info patcher

查看:123
本文介绍了Teamcity 9:如何将git short hash添加到程序集信息修补程序中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用程序集信息修补器来创建一个类似于以下版本的数字:

1.2.3.1a3c19e



其中最后一位是git short hash。



我试过使用powershell脚本构建步骤来创建短散列(因为我无法找到变量有它),并将其添加到系统变量,但此构建步骤似乎在程序集信息修补程序后运行,所以没有多大用处。 解决方案

如果您想将其写入Assembly Info字段,可以完成,但它需要单独的生成配置来生成生成编号。这一步的唯一目的是创建附有散列的内部版本号。

1。创建构建配置以生成短散列





2。添加一个步骤来生成散列





3。添加一个参数来存储散列



4。添加第二个构建配置并向第一个构建添加依赖项 $ b



5。您现在可以在相关步骤中使用参数





6。此时,您可以在装配信息修补程序中使用它





另一种方法是使用VCS标签构建功能将构建编号写回Git。 b



希望这有助于。


I'm trying to use assembly info patcher to create a version number something like:

1.2.3.1a3c19e

where the last bit is the git short hash.

I've tried using a powershell script build step to create the short hash (as I cant find a variable that has it) and adding this to a system variable but this build step appears to run after assembly info patcher, so isn't much use.

解决方案

If you want to write this to the Assembly Info field it can be done, but it requires a separate build configuration to generate the build number. The sole purpose of this step is to create the build number that has the hash appended to it.

1. Create a build configuration to generate the short hash

2. Add a step to generate the hash

3. Add a parameter to store the hash

4. Add a second build configuration and add a dependency to the first one

5. You can now consume the parameter in the dependent step

6. At this point you can use it in the assembly info patcher

The alternative to this is to write your build number back to Git using the VCS labeling build feature.

Hope this helps.

这篇关于Teamcity 9:如何将git short hash添加到程序集信息修补程序中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆