07: Deploy to prod¶
After you've tested your deployment in lab, it's time to promote your deployment to prod.
You're "promoting" to prod¶
This is an important concept of SOFA deployments:
- Deploying to lab is "hard work" – the CI/CD is building Docker images, running static checks like
tsc
or ESLint, storing the Docker image to an internal registry, etc. This typically takes minutes. - Deploying to prod is a much simpler event – you just instruct the infrastructure to use one of the previously built Docker images. It typically takes seconds.
How to deploy to prod manually¶
Run
sofa deploy --prod
This will promote the current lab version to prod.
How to deploy to prod automatically¶
You can configure the CI/CD to deploy to prod automatically by editing the sofa.json
file:
{
"mergeToMasterAlsoPromotesToProd": true
}
Merging to master will now do two things:
- Build the lab environment
- If the previous step was successful, it will also update the production deployment
🎉 Congratulations, you now know a lot about SOFA and how to deploy Shoptet Premium shops. You'll find more specific docs in the "Guides" section or feel free to reach out!