【问题标题】:Git workflow from local to bitbucket/github hub to live webserverGit 工作流程从本地到 bitbucket/github hub 到实时网络服务器
【发布时间】:2013-11-20 16:50:25
【问题描述】:

我想设置一个工作流程,可以将本地更改推送到 Bitbucket 或 Github(但最好是前者),然后更新托管在我的 Lamp VPS 服务器上的实时站点。这可能吗?我记得前段时间与一个具有类似设置但使用 Github 的团队合作。

Joe Maller http://joemaller.com/990/a-web-focused-git-workflow/ 的一篇文章描述了一种类似的方法,其中集线器是同一网络服务器上的另一个目录。

【问题讨论】:

    标签: git github hosting lamp bitbucket


    【解决方案1】:

    这种推送后操作是托管的:

    在这两种情况下,这些钩子都会生成一个 POST 钩子,通过其 API 将有效负载传递给您的第三方网络应用程序。
    您的第三方应用程序负责接收和转换有效负载。

    这意味着您的 Lamp VPS 服务器需要有一个能够解释所述有效负载的侦听器。
    您可以通过执行git pull 来查看管理部署in this article 的脚本示例:

         // Make sure we're in the right directory
          exec('cd '.$this->_directory, $output);
          $this->log('Changing working directory... '.implode(' ', $output));
    
          // Discard any changes to tracked files since our last deploy
          exec('git reset --hard HEAD', $output);
          $this->log('Reseting repository... '.implode(' ', $output));
    
          // Update the local repository
          exec('git pull '.$this->_remote.' '.$this->_branch, $output);
          $this->log('Pulling in changes... '.implode(' ', $output));
    

    【讨论】:

      猜你喜欢
      • 2012-10-25
      • 1970-01-01
      • 2014-12-18
      • 2017-07-30
      • 1970-01-01
      • 2020-10-29
      • 1970-01-01
      • 2016-07-26
      • 1970-01-01
      相关资源
      最近更新 更多