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

Better Bitbucket support for gitversion /output buildserver for Powershell #3831

Closed
arihannu opened this issue Dec 13, 2023 · 3 comments · Fixed by #3833
Closed

Better Bitbucket support for gitversion /output buildserver for Powershell #3831

arihannu opened this issue Dec 13, 2023 · 3 comments · Fixed by #3833

Comments

@arihannu
Copy link

Is your improvement request related to a problem? Please describe.
We are using GitVersion in Windows environment, in Bitbucket Pipelines runner. The problem is that the gitversion /output buildserver output file gitversion.properties is in bash format, and since Windows Bitbucket Pipelines runner runs using Powershell, it is more difficult to "source" the variables from that file.

Detailed Description

gitversion /output buildserver, when run in Bitbucket Pipelines (Windows) Powershell runner, should output, not gitversion.properties for bash, but instead for Powershell, maybe it'll be then a .ps1 file, that Powershell can then "source".
Currently, we are reading gitversion.properties file, regex'n the export lines and then reading the key/value pair to a Powershell variable. This is cumbersome.

Possible Implementation

https://github.com/GitTools/GitVersion/blob/c704b65c52e3abfc2e2aabec900781e7a2218b15/src/GitVersion.BuildAgents/Agents/BitBucketPipelines.cs#L39C25-L39C25

Here "export" is added for each key/value pair line, since it's only meant for bash.

Output also a file that can be "sourced" in Powershell (I think in Powershell, it's just a "dot" (.) operation).

@asbjornu
Copy link
Member

If you're able to implement this in a way that is also compatible with Bash, it will be merged for sure! 👍🏼

@arturcic
Copy link
Member

Closed by #3833

@arturcic arturcic added this to the 6.x milestone Dec 14, 2023
@arturcic arturcic modified the milestones: 6.x, 6.0.0-beta.5 Jan 9, 2024
@arturcic
Copy link
Member

arturcic commented Jan 9, 2024

🎉 This issue has been resolved in version 6.0.0-beta.5 🎉
The release is available on:

Your GitReleaseManager bot 📦🚀

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

Successfully merging a pull request may close this issue.

3 participants