SomoKRoceS
SomoKRoceS

Reputation: 3043

Run pipeline stages when only the predecessor stage is completed - gitlabci

I ran into this situation:

I have 3 stages in a gitlab-ci pipeline:

The first stage is intended to trigger and run automatically on change of master branch.

The second stage will run only after manual approval, using when: manual.

Now, I want the third stage to run automatically after the second stage is completed.

The only thing I found out that could make sense is when: on_success, which is the default value. But I don't get the desired outcome since the third stage run right after the first stage is completed (while the second stage hasn't been manually approved yet).

How can I achieve that condition (stage 3 will be triggered only by stage 2 completion)?

Upvotes: 0

Views: 2826

Answers (1)

Sergio Tanaka
Sergio Tanaka

Reputation: 1435

This behavior happens because your manual job (the second stage) don't have allow_failure: false value

The manual jobs on gitlab ci has allow_failure: true as default https://docs.gitlab.com/ee/ci/yaml/#allow_failure

If you set the value as false, the gitlab ci will not continue until this job finishes with success

Upvotes: 1

Related Questions