Reputation: 1600
The title pretty much says it all.
I want to be able to get the value below as an environment variable in my .gitlab-ci.yml
I tried both ${CI_PIPELINE_ID}
and ${CI_PIPELINE_IID}
but in the first case I got an incremental value and in the second I got a different value from the one displayed below.
Does anyone know how to?
Thanks in advance
Upvotes: 1
Views: 9024
Reputation: 6629
Try running the command printenv
in one of your jobs. It will print out all environment variables and their values. The correct variable you're looking for is CI_PIPELINE_ID
. Here's what I got:
CI_PIPELINE_ID=396845
CI_PIPELINE_IID=2726
Personally, I always use CI_PIPELINE_ID
.
Upvotes: 3