- TechOps Examples
- Posts
- Gitflow Branching Strategy for Multi Account Environments
Gitflow Branching Strategy for Multi Account Environments
Good day. It's Monday, Sep. 9, and in this issue, we're covering:
Gitflow Branching Strategy for Multi Account Environments
AWS extending Zone Group construct to Availability Zones
GitHub Actions Vulnerable to Typosquatting, Exposing Developers to Hidden Malicious Code
Beginner’s Guide to OpenTelemetry
Playing Around with AWS-Vault
Deploying a microservices application using Helm on Kubernetes
You share. We listen. As always, send us feedback at [email protected]
Use Case
Gitflow Branching Strategy for Multi Account Environments
Managing complex software deployments across multiple accounts involves more than just merging code. You need clear separation between environments like sandbox, develop, test, staging, and production.
The branching strategy should keep development teams aligned across environments, letting them work on features, bug fixes, releases, and hotfixes without affecting each other's work or disrupting production stability.
This is where Gitflow branching strategy helps, making sure code moves through the right stages, reducing risks and allowing smooth deployments.
Architecture Overview:
Ref: AWS Prespective Guidance
Here’s the simplified breakdown of the flow depicting the movement of code through various environments and approval stages from development to production.
1. Develop code on the feature/*
branch in the Sandbox account.
2. Merge to sandbox/*
branch and Deploy to Sandbox from sandbox/*
branch for testing.
3. Create merge request for feature/*
branch to merge into the develop
branch.
4. Build and deploy from develop
branch to the Develop environment.
5. Merge feature/*
to release/*
branch after development.
6. Build, publish artifacts, and deploy from release/*
branch.
7. Deploy with gated approval to Test environment.
8. Deploy with gated approval to Stage environment.
9. Deploy with gated approval to Production environment.
10. Merge release/*
to main
for final production deployment.
Accounts Overview:
Sandbox/Develop Accounts: Feature development and testing are isolated in feature branches. Developers can work on feature branches, manually deploy, and test their changes. Once done, the code is merged into the
develop
branch.Test/Stage Accounts: Here, more controlled environments come into play. Code from the
develop
branch undergoes further testing, and the release process begins with therelease/*
branch. Once features are ready for production, they go through staged deployments with gated approvals to avoid premature release.Production Account: The final, stable code gets merged into the
main
branch. Hotfixes, if necessary, are handled with a dedicatedhotfix/*
branch to address urgent issues without impacting ongoing development.
Things to Consider:
Automation Pipelines: Ensure that pipelines are automated for each environment, from build to deployment, to avoid manual errors. Use CI/CD tools to manage this based on branch updates (e.g., only deploy to test when a branch merges to
develop
).Branch Naming Conventions: Enforce a strict naming convention for branches (e.g.,
feature/*
,release/*
,hotfix/*
) so everyone knows their purpose.Collaboration Guidelines: Establish clear guidelines for when and how to merge branches. For example, Pull requests (PRs) should require reviews, and certain branches (e.g.,
main
andrelease/*
) should have protected status to prevent accidental changes.Testing Strategies: Implement a robust testing strategy at every stage. Code in feature branches should be unit tested, while integration and end-to-end testing should happen at the
release/*
ordevelop
stages.
Final Thoughts: The success of Gitflow branching strategy in multi-account cloud setups depends on defined stages, proper gating, and isolated workstreams, which make the code stable, well-tested, and ready for deployment without causing outages.
p.s. I am on twitter (X) now - Your support would mean a lot ✋
Drop by to Say Hello and Smash that ‘Follow’ Button !!
Tool Of The Day
AWS-Mine AWS honey token manager
Trends & Updates
Resources & Tutorials
Picture Of The Day
Did someone forward this email to you? Sign up here