简体   繁体   中英

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. 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
  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:

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 .

A popular workflow is Git-Flow , also described here .

With Git-Flow, you work on a develop branch and feature branches to do your work. All of your releases are done from release branches and then merged into the master branch.

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. Once the prerelease has been tested, you can create a real release from that branch.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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