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

How to access variables in release task #6

Open
SeeUnsharp opened this issue Jun 22, 2018 · 1 comment
Open

How to access variables in release task #6

SeeUnsharp opened this issue Jun 22, 2018 · 1 comment

Comments

@SeeUnsharp
Copy link

Hi, there is no wiki and I can't find information in web how to use this task. I managed to add jsons in my artifact and the json also has all my values. My question is how do I access my variables in a release task (for example I have a Powershell inline task where I need GitVersion.MajorMinorPatch)?

This is how my GitVersion JSON looks like:

[ { "Name": "GITVERSION_LEGACYSEMVERPADDED", "Value": "1.2.0-alpha0001" }, { "Name": "GITVERSION_PRERELEASETAG", "Value": "alpha.1" }, { "Name": "GITVERSION_PRERELEASENUMBER", "Value": "1" }, { "Name": "GITVERSION_INFORMATIONALVERSION", "Value": "1.2.0-alpha.1+Branch.develop.Sha.be0465c06880dfea1b6a67cf83a975496b70bde3" }, { "Name": "GITVERSION_NUGETPRERELEASETAGV2", "Value": "alpha0001" }, { "Name": "GITVERSION_NUGETVERSIONV2", "Value": "1.2.0-alpha0001" }, { "Name": "GITVERSION_MAJOR", "Value": "1" }, { "Name": "GITVERSION_PRERELEASELABEL", "Value": "alpha" }, { "Name": "GITVERSION_SHA", "Value": "be0465c06880dfea1b6a67cf83a975496b70bde3" }, { "Name": "GITVERSION_LEGACYSEMVER", "Value": "1.2.0-alpha1" }, { "Name": "GITVERSION_NUGETVERSION", "Value": "1.2.0-alpha0001" }, { "Name": "GITVERSION_BUILDMETADATA", "Value": "" }, { "Name": "GITVERSION_FULLBUILDMETADATA", "Value": "Branch.develop.Sha.be0465c06880dfea1b6a67cf83a975496b70bde3" }, { "Name": "GITVERSION_MAJORMINORPATCH", "Value": "1.2.0" }, { "Name": "GITVERSION_COMMITSSINCEVERSIONSOURCEPADDED", "Value": "0001" }, { "Name": "GITVERSION_VERSION", "Value": "4.0.0-beta0012" }, { "Name": "GITVERSION_FULLSEMVER", "Value": "1.2.0-alpha.1" }, { "Name": "GITVERSION_COMMITDATE", "Value": "2018-06-22" }, { "Name": "GITVERSION_PATCH", "Value": "0" }, { "Name": "GITVERSION_ASSEMBLYSEMFILEVER", "Value": "1.2.0.0" }, { "Name": "GITVERSION_PRERELEASETAGWITHDASH", "Value": "-alpha.1" }, { "Name": "GITVERSION_BUILDMETADATAPADDED", "Value": "" }, { "Name": "GITVERSION_NUGETPRERELEASETAG", "Value": "alpha0001" }, { "Name": "GITVERSION_COMMITSSINCEVERSIONSOURCE", "Value": "1" }, { "Name": "GITVERSION_ASSEMBLYSEMVER", "Value": "1.2.0.0" }, { "Name": "GITVERSION_BRANCHNAME", "Value": "develop" }, { "Name": "GITVERSION_SEMVER", "Value": "1.2.0-alpha.1" }, { "Name": "GITVERSION_MINOR", "Value": "2" } ]

@SeeUnsharp
Copy link
Author

Nevermind. It's too easy I guess :D

Just use $(GITVERSION_MAJORMINORPATCH) for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant