GitVersion icon indicating copy to clipboard operation
GitVersion copied to clipboard

gitversion.properties is not being generated by BitBucket Pipelines build agent

Open davidkeaveny opened this issue 3 years ago • 1 comments

The new integration support for Atlassian's BitBucket Pipelines CI/CD system is not working as expected.

Expected Behavior

GitVersion should detect that it is running on BitBucket Pipelines (by the presence of the BITBUCKET_WORKSPACE environment variable), calculate the version numbers, and write them to the file gitversion.properties, which can then be exported by Pipelines as an artifact to be shared with the rest of the pipeline.

Actual Behavior

The gitversion.properties file is not being generated. I can see from the output of /diag that the build agent is correctly calculating the expected version, it's just not being written to file.

I've attached the log file; looking at it, I can not see any of the output from the void WriteIntegration(Action<string>?, VersionVariables, bool) method in src/GitVersion.Core/BuildAgents/BitBucketPipelines.cs in the logs.

Possible Fix

As a workaround, I can write a single variable from GitVersion to an output file e.g.

- echo export GITVERSION_FULLSEMVER=`dotnet-gitversion /diag /output json /showvariable FullSemVer` >> gitversion.properties

Steps to Reproduce

The YAML for the Pipelines set up is:

image: mcr.microsoft.com/dotnet/sdk:6.0

clone:
  depth: full

pipelines:
  default:
    - step:
        name: Version
        script:
          - export PATH="$PATH:/root/.dotnet/tools"
          - dotnet tool install --global GitVersion.Tool --version 5.*
          - dotnet-gitversion /diag /buildserver /verbosity:Diagnostic /l gvlog.txt
        artifacts:
          - gitversion.properties

davidkeaveny avatar Apr 15 '22 00:04 davidkeaveny

gvlog.txt

davidkeaveny avatar Apr 15 '22 00:04 davidkeaveny

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.

github-actions[bot] avatar Mar 05 '23 11:03 github-actions[bot]

This issue was closed because it has been stalled for 30 days with no activity. Thank you for your contributions

github-actions[bot] avatar Apr 05 '23 11:04 github-actions[bot]