MrDuk
MrDuk

Reputation: 18342

GitLab: How can I require a manual step for only production?

I would like to have a pipeline that requires manual approval for production but auto deploys everywhere else. So the pipeline stages for non-prod would just be build -> deploy and for production it would be build -> review -> deploy, so basically the review stage is only for production.

In the UI, I imagine the pipeline would look something like:

build        review        deploy
-----        -------       -------

prod ------> review ------> deploy-prod
dev  ---------------------> deploy-dev

Is this possible?

Upvotes: 0

Views: 151

Answers (1)

arved
arved

Reputation: 4594

Conditional stages can be defined with the only keyword. See https://docs.gitlab.com/ee/ci/yaml/#onlyexcept-basic

For Variables use something like:

review:
  only:
    variables:
      - $CI_ENV_VAR =~ /some value/

or for tags:

review:
   only:
      - tags

Upvotes: 1

Related Questions