Best Practices for Moving an API from Staging to Production
Asked by
camera obscura project
I'm looking for insight into how to transition a tested API from staging to production. My current method involves creating a new pull request from staging to production, merging it, and then triggering the production pipeline to build and deploy automatically. However, I'm exploring alternatives such as moving the built image directly to production with a new tag. I'd love to hear about your approaches and any improvements you might suggest for mine!
Answers
If you want some manual control, you can use the promote button in your CI/CD pipeline to manage deployments. But I recommend automating the process so that any build that passes testing gets automatically deployed to production. Just like in staging, the same build artifacts should be the ones that go live in production, ensuring consistency in your deployments.
Reply to this answer
There's a key issue with merging and deploying something different from what you've tested. Ideally, you want to push the exact artifacts you tested in staging directly to production to avoid unexpected issues. It's crucial that what was validated in staging reflects exactly what goes live.
Reply to this answer
Add your answer
Answers are reviewed before publication.
PUBLIC COMMENT: What if a manual testing phase is needed by the product team? They might require a full staging deployment for a set period before we decide to promote to production.