Add ID variable that spans current pipeline and child pipelines (and their child pipelines, etc)

Problem to solve

I need to create a consistent file name that is unique for each CI build. The CI build runs in a pipeline that spawns child pipelines. These child pipelines need to be able to reference the file.

The file is a manifest of staticfiles to be used by the final release.

Multiple manifests can be used at the same time as the application deploys.

So if the file name is of the form "static.manifest", it will override the current version as it is deploying and cause problems.

So, an improvement is a static manifest filename of the form: "static.${CI_PIPELINE_ID}.manifest"

However, now the child pipelines have different ids so this does not work. So, there should be some sort of variable like, CI_SPANNING_PIPELINE_ID that is the same for the parent pipeline and all child pipelines.

Intended users

Developers

Edited by g