Skip to content

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

Description

@arihannu

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).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions