它是一个很好的做法,使标签在Git中对每个部署构建? [英] Is it a good practice to make a tag in git for every deployment build?

查看:147
本文介绍了它是一个很好的做法,使标签在Git中对每个部署构建?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚从Subversion转换到Git的。 Subversion的集中式架构赋予了它,我用来建立到变化日志我们基于Web的应用程序可以很容易地登录并查看哪个版本是任何给定的服务器上运行一个有意义的版本​​号。 Git不会有一个友好的版本号。而我已经看到了它建议您从 git的状态 Git标签输出解析的东西。

我不相信我们会一直使用客户友好的名称为我们的分支机构(有时我们称他们为个人客户谁不希望他们使用我们的宣传系统的事实)。所以我想我可以有构建产生这样 2012-11-21_08-40-23 A邮戳/时间戳标记和使用的方式我以前用的颠覆版本号。构建只会产生此标记,并添加它,当我们建立部署war文件到Git,所以任何部署到任何服务器会生成一个标记。

目前,我们部署到每隔几天,集成每月几次测试(突发),以及生产每两个月。


解决方案

  

而我已经看到了它建议您解析来自git的地位或Git标签的输出的东西。


这是丑陋的建议。真丑和跛脚。 混帐形容这里规则或多或少,阅读的男人的git描述会有很多更有效,比状态标记日志或3-RD-方随时可以使用脚本

不便。这样做任何修改好的命名的伎俩(你可以标记只有部分变更,不是的每发表的)

git的描述 - 长--tags --matchSUBSTRING-OF-CLIENT_TAGFAMILY *'

I just switched from Subversion to Git. Subversion's centralized architecture gives it a meaningful revision number that I used to build into the change-log for our web-based application to make it easy to log in and see which version is running on any given server. Git doesn't have a friendly build number. Rather I've seen it suggested that you parse something from the output of git status or git tags.

I'm not convinced we will always use customer-friendly names for our branches (sometimes we name them for an individual customer who doesn't want the fact that they use our system publicized). So I'm thinking I could have the build generate a datestamp/timestamp tag like 2012-11-21_08-40-23 and use that the way I used to use the Subversion revision number. The build would only generate this tag and add it to Git when we build a war file for deployment, so any deploy to any server would generate a tag.

Currently we deploy to test every few days, integration a few times a month (in bursts), and production every couple months.

解决方案

Rather I've seen it suggested that you parse something from the output of git status or git tags.

It was ugly suggestions. Really ugly and lame. git describe rule here more or less, reading man git describe will be a lot more useful, than status or tag or log or 3-rd-party ready-to-use scripts

Smth. like this do the trick of good naming of any revision (and you can tag only some changeset, not every published)

git describe --tags --long --match 'SUBSTRING-OF-CLIENT_TAGFAMILY*'

这篇关于它是一个很好的做法,使标签在Git中对每个部署构建?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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