Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitLab CI: No such variable CI_BUILD_ID #2290

Closed
ytyukhnin opened this issue Apr 12, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@ytyukhnin
Copy link

commented Apr 12, 2019

Description

According to the official documentation there is no such variable CI_BUILD_ID on the list of the GitLab CI variables: https://docs.gitlab.com/ee/ci/variables/

But Fake is providing a following function

namespace Fake.Core
...
module BuildServer =
...
let gitlabCIBuildNumber = if isGitlabCI then Environment.environVar "CI_BUILD_ID" else ""

Which as the result is always returning an empty string while running on a GitLab CI.

Repro steps

Call a BuildServer.gitlabCIBuildNumber function while running at a GitLab CI runner.

Expected behavior

The function should be instead looking for a variable CI_PIPELINE_ID which defines a pipeline id.

Known workarounds

Use Environment.environVar "CI_PIPELINE_ID" directly.

@ytyukhnin ytyukhnin changed the title GitLab CO: No such variable CI_BUILD_ID GitLab CI: No such variable CI_BUILD_ID Apr 12, 2019

@matthid

This comment has been minimized.

Copy link
Collaborator

commented Apr 12, 2019

Hm, I always thought I just copied from the docs. Did this stuff change? Do we need to check the old one for backwards compat or old on-premise instances?

@ytyukhnin

This comment has been minimized.

Copy link
Author

commented Apr 12, 2019

Well, we started to use GitLab only few months ago, but I did some search on the Internet, and it seems they renamed CI_BUILD_ID into CI_PIPELINE_ID about a year ago. So I think it's better to keep it backwards compatible.

@matthid matthid closed this in 2b0f907 Apr 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.