Ideal flow for deploying multiple times a day


#1

I know this question is not specifically related to CircleCI, but we’re moving to CircleCI 2.0 and I’d appreciate if someone could give me insights on how to improve our current CI flow in order to make it easier to deploy things faster and multiple times a day.

Here’s how our current flow works today:

  • We have two stable branches: master and develop
  • We create feature branches (from the develop branch) in order to develop new features
  • Whenever a feature branch is complete, we create a Pull Request to merge it back into develop branch
  • Every PR merged or commit done in develop branch is automatically deployed to our staging environment
  • We test the feature in our staging environment
  • After test is complete, we create a new PR to merge develop branch into master branch
  • Every PR merged or commit done in master branch is automatically deployed to our production environment

This works, but there are some problems I can see with this approach:

  • We always need to create 2 PRs, 1 to merge into develop branch and 1 to merge into master branch
  • If we find problems when testing in staging environment, we can’t deploy other unrelated features until these problems are fixed, as the unstable code is already merged into develop branch.

We already have pretty good test coverage, but we can’t skip testing in staging environment yet.

What changes do you suggest in this CI flow in order to allow faster deploys to production?


#2

Good question; have the same setup as you… curious to see if people can improve a better workflow.

I have one more problem with this approach: when a merge with dev happened, and all tests pass, if you immediately merge again with master, the latest commit is the same one, and my jobs don’t run again. The job is only run once for each commit. This causes the deployment job to not run for my production environment, since it was already run when deploying to staging for that same commit.

Also curious, when you deploy do you re-create your deployment artifact/build? Or did you save your build somewhere prior to testing?


#3

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.