- Download the latest version from Atlassian Marketplace
- View the Source Code
- Report a bug or request a feature
GitVersion for Bamboo is a plugin which integrates GitVersion with Atlassian Bamboo. This gives you a couple benefits over using the tool directly in your build scripts:
- Every GitVersion generated value is persisted in the Bamboo build metadata and can be used at any point in the build.
- Seamlessly transfers a version number from the build to a deployment, enabling you to use the version number for your releases without relying on Bamboo build number.
- If you have builds on multiple platforms, you can use GitVersion to generate a version number on a Windows build agent and the value is available to your MacOS and Linux build agents.
Quick Start
- Install GitVersion on your build agent(s).
choco install gitversion.portable
- Install the GitVersion plugin on your Bamboo master.
- From the Bamboo Administration page, select System Capabilities and click the “Detect Capabilities” button.
- In a Bamboo plan, edit your tasks and insert the GitVersion task after your Source Code Checkout task.
- Optionally configure the task to only extract specific GitVersion variables, or pass additional command-line arguments. For example, if you are building a .NET project, you may want to pass
/UpdateAssemblyInfo
to automatically stamp your assemblies with the generated version. - Run a build and when it completes, go to the results of the job which contains the GitVersion task. On the Metadata tab you will see all the new variables available to you to use.
Version Deployments
- In your deployment project, edit the Release Versioning
- Enter the GitVersion variable you would like to use: ${bamboo.GitVersion.SemVer} or 1.0.0.${bamboo.GitVersion.BuildMetadata}
- Create a new release and verify that it is using your new versioning scheme.
Use GitVersion with Linux/Mac Builds
- Add a Windows build agent to your Bamboo installation
- Install GitVersion on the agent
- Add GitVersion as a capability to the agent in Bamboo
- In your plan, add a job which calls the GitVersion task
Now when Bamboo executes your plan, it will first run that job on the Windows agent, generating a number and saving the metadata in the plan results. Your plan then continues executing as normal on the other build agents. Subsequent jobs and deployments can then access the GitVersion variables.