How do i skip production deployment in autodevops of gitlab

651 Views Asked by At

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

2

There are 2 best solutions below

0
On

If you look into the .gitlab-ci.yml used 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_FREEZE to true (or any value for that matter). You can, also, use a custom stages definition (ie, remove the stage called production and add you custom deploy stage) or completely overwrite the production job.

These are just examples, you should investigate whatever fits best your use case.

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