I am using Gitlab with Auto DevOps on. I want to use auto devops but with some custom stages on. I have already written a custom stage and i want to skip production deployment stage. How can i do it
How do i skip production deployment in autodevops of gitlab
647 Views Asked by Imran At
2
There are 2 best solutions below
0
On
There is no documented way to skip Production deployment stage. The other stages can be disabled by adding a variable in the Settings -> CI/CD -> Variables section.
You can find the relevant documentation here: https://docs.gitlab.com/ee/topics/autodevops/customize.html#disable-jobs
Or you can enable staging and use a manual production job: https://docs.gitlab.com/ee/topics/autodevops/customize.html#deploy-policy-for-staging-and-production-environments
If you look into the
.gitlab-ci.ymlused in AutoDevOps, you can see what you can customize.The main file is here.
The file for the production deploy job is here.
Looking at the production job file, it seems you can disable the production deploy job with a variable, for example, if you manually set
CI_DEPLOY_FREEZEtotrue(or any value for that matter). You can, also, use a customstagesdefinition (ie, remove the stage calledproductionand add you custom deploy stage) or completely overwrite theproductionjob.These are just examples, you should investigate whatever fits best your use case.