【发布时间】:2015-10-22 01:40:48
【问题描述】:
我们有一个 staging 和 live,我们想根据作者或开发者发送的提交消息更新一个 staging 和 live 服务器的工作副本
例子
如果我们只想在 staging 中提交,我们将只提交文件并有这样的提交消息“更改 index.php 代码 [staging]”,然后如果我们更新 staging 文件夹或服务器上的工作副本执行类似“更改 index.php 代码 [staging][live]”的提交消息,然后将更新登台和实时服务器。
这是我到目前为止所做的 在 post_commit 我添加了这一行
svn update --quiet --trust-server-cert --non-interactive --username xxxxxx --password xxxxxx /var/www/staging
我们想要在代码中做的是
if commit-message contains "[staging]"
svn update --quiet --trust-server-cert --non-interactive --username xxxxxx --password xxxxxx /var/www/staging
if commit-message contains "[live]"
svn update --quiet --trust-server-cert --non-interactive --username xxxxxx --password xxxxxx /var/www/live
这可能吗?
【问题讨论】: