holman / ama

Ask @holman anything!
732 stars 278 forks source link

Multiple environments and git branches #769

Closed jmarcos-cano closed 8 years ago

jmarcos-cano commented 8 years ago

hello, we are currently struggling with this were we have:

  1. FeatureBranches : we are under scrum so each user story is a new branch, this usually matches local development environment
  2. dev branch: this usually reflects a DEV server with fake data, etc etc. we open a merge request to master if everything goes well at DEV servers.
  3. master branch : this reflects a user acceptance testing (UAT) environment and automated regression testing suite with the data just as in production.
  4. once everything goes well and the products accepts everything we can trigger a button to generate the STAGING infrastructure from master branch

however i do see a lot of problems with these approach and the first and more evident is that master is not always healthy because if FBranch-1 comes unhealhty and reaches master and FBranch-2 is healthy then we can not ship FBranch-2

so how you guys manage environments VS git branches?

PS: i guess that our first problem is the "cascade" approach from the git branching model

holman commented 8 years ago

i guess that our first problem is the "cascade" approach from the git branching model

Yeah, I kind of think that's the real problem, to be honest.

Part of what I advocate with deployment is to just make things as simple as possible. Having a setup where branches just go to production and, if it looks good, merging it to master is a lot easier to explain to the rest of your team compared to the setup you described here.

Granted, I don't know all of the full details behind what you're doing and why you're doing it, but it just seems a bit much. Your dev server, for example, probably doesn't need to exist (you can do the same thing with local development on the developer's machine). Your testing of the master branch should just be considered a CI role rather than another environment, probably. But again, it's hard to just do some drive-by comments without all of the context from working somewhere for months. :)

jmarcos-cano commented 8 years ago

yes I totally get that, but how do you deal with:

holman commented 8 years ago

multiple developers with their own FeatureBranches and all throwing their code to "a production like" environment. ?

Ideally you have a production that can handle multiple experimental branches at once, ranging from lasting minutes to hours to weeks.

also how do you define "if it looks good".

That's really the trick with any programming. :) Every org is different, and can come up with different idea of what's "good enough" to put into production.

how do you deal with compiled projects? do you do advice some artifactory? (is it the compile once part of your advice?)

I don't really have to deal with compiled projects, so I don't have much secret knowledge here, other than to mention packagecloud and to automate the whole process so no developer has to worry about it prior to deploying.