Add ability to setup CI_PIPELINE_IID value for next pipelines.

Problem to solve

When migrating from other CI solutions to Gitlab CI we usually already have build history with build numbers. And it would be great if we can set up Gitlab CI to start $CI_PIPELINE_IID counting from specific number.

Further details

It's easy to setup this manually with custom environment variable like

export BUILD_ID=$((CI_PIPELINE_IID + 11900))

But then its harder to match build (with resulting version like 3.3.1.11905) with pipeline (with IID 5).

Proposal

Add setting like Next pipeline IID which we can set to specific number (like 11900) and next pipeline will have this number as $CI_PIPELINE_IID. And all next pipelines iid will increment starting from selected number.

What does success look like, and how can we measure that?

(If no way to measure success, link to an issue that will implement a way to measure this)

Edited by 🤖 GitLab Bot 🤖