检查 post 提交消息以更新登台和实时服务器

Check post commit message to update staging and live server

我们有一个暂存和实时服务器,我们想根据作者或开发人员发送的提交消息更新暂存和实时服务器的工作副本

例子

如果我们只想在暂存中提交,我们将只提交文件并有这样的提交消息 "Change index.php code [staging]" 然后如果我们提交,暂存文件夹或服务器上的工作副本将被更新像这样的消息 "Change index.php code [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

这可能吗?

Is this possible?

是的,这是可能的。但是你想问"How to do it?"