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

Set Build Variables As Environment Variables #47

Open
sheldonhull opened this issue Jan 22, 2019 · 2 comments
Open

Set Build Variables As Environment Variables #47

sheldonhull opened this issue Jan 22, 2019 · 2 comments

Comments

@sheldonhull
Copy link

When packaging a nuget package, I'm allowing the version number to be set. I would like the full path for this nupkg file that is created with a version number to be set as an build variable so it's accessible in further steps like Push. Right now I'm not seeing any mention of setting variables, so I'm not able to specific the exact package name to push on a separate push step.

@gep13
Copy link
Member

gep13 commented Jan 22, 2019

@sheldonhull off the top of my head, I am not sure how this would be possible. Can you help with providing some detailed steps, perhaps with some screenshots, of how you are doing this with the NuGet Task, and I can look into how this can be achieved within the Chocolatey Task as well.

@sheldonhull
Copy link
Author

When you create the package, get the package name get-childitem or something like that if it's not an output from the pack command. Then use VSO command to set as variable that is available in next tasks.

This exact syntax should work:

Write-Host "##vso[task.setvariable variable=ChocoPackageName;]$NupkgFullPath"

Further documentation

Hopefully that helps. I got around this by using folder, but this would still be a nice enhancement.

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

2 participants