简体   繁体   English

Github发布周期的结构

[英]Github structuring for release cycles

I'm reasonably new to using Github and I don't think I'm trying to do the simplest thing so I could really do with some help. 我是使用Github的新手,我认为我没有尝试做最简单的事情,因此我确实可以提供一些帮助。 I think I'm almost there. 我想我快到了。

Here's what I'm trying to achieve. 这就是我想要实现的目标。

  1. I create a prerelease of my repo 我创建了我的仓库的预发行版
  2. Github sends webhook request notifying my server Github发送webhook请求通知我的服务器
  3. My server sees it's a prerelease, clones the repo and checks out the prerelease to a live test environment 我的服务器看到它是预发行版,克隆了存储库,然后将预发行版签出到实时测试环境
  4. Whilst that's being tested, I continue working and making commits 在测试的同时,我继续工作并进行提交
  5. When the test team is happy with the prerelease, I go back and make it a full release 当测试团队对预发布感到满意时,我回过头将其发布为完整版本

Here's how my Node Express server receives the webhook: 这是我的Node Express服务器接收Webhook的方式:

app.post("/", function(req, res){ 

  //event is not a release
  if (req.headers["x-github-event"] != "release") return;

  //push release to test or live server
  else if (req.body.release.prerelease) pushToDev(req);
  else if (!req.body.release.prerelease) pushToLive(req);

});

Everything for doing a prerelease is working fine. 进行预发行的一切工作正常。 I'm just not sure about a couple of things: 我只是不确定以下几点:

  1. How would I make a release from the same date as the prerelease after testing is complete? 测试完成后,我将如何从与预发行版本相同的日期开始发行? This would then push that version to my live server. 然后,将那个版本推送到我的实时服务器上。
  2. Is this a bad structure generally? 通常这是不好的结构吗? Do I need to be using branches? 我需要使用分支吗? I haven't really go my head around that yet so any help with this would be appreciated. 我还没有真正解决这个问题,因此对此提供的任何帮助将不胜感激。

Yes, you should consider using branches - this is a common scenario, and there are some good solutions for this. 是的,您应该考虑使用分支-这是常见的情况,为此有一些好的解决方案。

Atlassian has a pretty good overview of possible workflows here, comparing different branching workflows . Atlassian 在这里对可能的工作流程进行了很好的概述,比较了不同的分支工作流程

A popular workflow is Git-Flow , also described here . 流行的工作流程是Git-Flow ,也在此处介绍。

With Git-Flow, you work on a develop branch and feature branches to do your work. 使用Git-Flow,您可以在develop分支和功能分支上工作。 All of your releases are done from release branches and then merged into the master branch. 您的所有发行都是从发行分支完成的,然后合并到master分支中。

So in your case, your prerelease could be done in a release branch (or even in master), while you continue to work in develop to make additional changes. 因此,在您的情况下,可以在发行分支(甚至在母版中)进行预发行,同时继续进行develop以进行其他更改。 Once the prerelease has been tested, you can create a real release from that branch. 一旦测试了预发行版,就可以从该分支创建真实的发行版。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM