-
Notifications
You must be signed in to change notification settings - Fork 653
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
[Question] How to access variables from Gitlab CI? #2409
Comments
The variables should be available as |
Maybe my Dockerfile is wrong?
|
Running |
I'm having the same problem in GitLab CI. I don't see how the |
Adding |
The way I solved this is based on https://stackoverflow.com/a/59686463/318317 I run the gitversion docker container in my gitlab ci script, and capture the output. In my case, I only want a single variable (FullSemVer), so I directly set the environment variable: script:
- GitVersion_FullSemVer=$(docker run --rm -v "$(pwd):/repo" gittools/gitversion:5.6.10 /repo /output json /showvariable FullSemVer)
- echo "${GitVersion_FullSemVer}" As an alternative, if you need more variables, you could save the output to a file and parse it later: script:
- docker run --rm -v "$(pwd):/repo" gittools/gitversion:5.6.10 /repo /output json > version,json
- cat version.json |
This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
I am building my asp.net core project in Gitlab CI and Docker using Gitversion as an MSBuild task. I can't seem to find the correct environment variable to access the version within the Gitlab pipeline. Any help would be much appreciated :)
This should be tagged as a question but I can't quite figure out how to do that, sorry :(
The text was updated successfully, but these errors were encountered: