'How to use GITLAB feature flag to run jobs of same stage sequentially in CI yml file
In my project I want to run jobs of the same stage sequentially due to Hardware dependency. The different stages are:
stages:
- build
- build install
- test
In the test stage I would like to run tests sequentially instead of the general parallel execution. According to the merge request mentioned here the flag Feature.enable(:ci_same_stage_job_needs) can be used to let needs consider a job from the same stage as dependency.
I am facing an issue in declaring this flag in the CI. Is it possible to use this flag in the CI job ? Am I using it wrong ? If it is possible, where and how should I use it ?
Thanks.
Solution 1:[1]
From the issue you linked, this feature has been merged into the master branch, but hasn't been released. The latest available version is 14.1.3, and according to the issue this functionality and feature flag will be released in 14.2.
Solution 2:[2]
A feature flag can be enable by a Gitlab Adiminstrator:
https://docs.gitlab.com/ee/administration/feature_flags.html
For Omnibus installations:
sudo gitlab-rails console
For installations from the source:
sudo -u git -H bundle exec rails console -e production
To enable a feature, run:
Feature.enable(:<feature flag>)
In your case:
Feature.enable(:ci_same_stage_job_needs)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Adam Marshall |
| Solution 2 | Emmanuel Iturbide |
