我知道这个问题是在一年前here提出的,并且有一个手动答案,但我想知道是否可以使用类似git describe
的内容来获取最新的标签然后使用而不是之前给出的更手动的方法?
答案 0 :(得分:1)
正如我在“How to get latest tag name?”中提到的那样,使用git describe
就可以获得最后一个标记:
git describe --abbrev=0 # shows only annotated tags.
git describe --abbrev=0 --tags # includes lightweight (non-annotated) tags.
如果TeamCity可以调用设置用于第二个作业的Source Control parameters的属性的第一个作业,则可以将该属性与最新标记一起用作构建的值。