寻找一种方式自动化"凹凸版"使用Git流 [英] Looking for a way automate the "bump version" with git flow

查看:133
本文介绍了寻找一种方式自动化"凹凸版"使用Git流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经用了几个月的混帐流,它一直非常好。我想自动化凸点版操作。

I have been using git flow for a couple of months and it has worked very well. I would like to automate the "bump version" operation.

该项目是PHP和footer.php有一个令牌与当前版本的标签来代替。我确信,使用Git日志和PHP文件的所有部分awk'ing应该工作了,但我相信有人这样做过......

The project is PHP and the footer.php has a token to replace with the current release tag. I am certain that with some awk'ing of git log and the PHP file everything should work out, but I assume someone has done this before...

任何想法?

推荐答案

您可以使用的semver宝石,增加了一个文件 .semver 来的混帐回购协议的根源。 语义版本号是具有结构化/一致/有意义的版本​​号的建议,创业板只是更容易实现。

You could use the semver gem, which adds a file .semver to the root of your git repo. Semantic version numbers are a recommendation for having structured/consistent/meaningful version numbers, the gem just makes it easy to implement.

因此​​,所有你需要做的就是添加:

So, all you'd need to do is add:

semver inc major|minor|patch

到您的工作流程(手动或脚本),以便.semver被释放时更新。

into your workflow (manually or scripted) so that the .semver gets updated during a release.

如果您不想依赖红宝石做,semver是pretty简单,所以有点SED实验可能会产生一个有效的解决方案。

If you don't want the ruby dependency, semver is pretty simple, so a bit of sed experimentation will likely yield a working solution.

这篇关于寻找一种方式自动化"凹凸版"使用Git流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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