Skip to content

Commit 300fbaa

Browse files
authored
Merge pull request #2209 from shoop/patch-1
Add example Powershell for Bamboo Windows build hosts
2 parents 9622f33 + c5c4929 commit 300fbaa

File tree

1 file changed

+12
-1
lines changed
  • docs/input/docs/build-server-support/build-server

1 file changed

+12
-1
lines changed

docs/input/docs/build-server-support/build-server/bamboo.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@ Title: Bamboo
55

66
If you use Bamboo then you will have to use GitVersion from the command line, as
77
there is no actively supported app. You can use the "Inject Bamboo Variables"
8-
task to read the GitVersion output back into Bamboo. Below is a Linux example
8+
task to read the GitVersion output back into Bamboo. Below are two examples
99
using the [.NET Core GitVersion global tool](https://www.nuget.org/packages/GitVersion.Tool/).
1010

1111
## Example
1212

13+
The first script can be run on a Linux build host, the second script can be run on
14+
a Windows build host using Powershell. The build only needs one of the two.
15+
1316
### Task: Script
1417

1518
**Script body**
@@ -19,6 +22,14 @@ using the [.NET Core GitVersion global tool](https://www.nuget.org/packages/GitV
1922
sed -i '1d;26d;s/ //;s/"//g;s/,//;s/:/=/' gitversion.txt
2023
```
2124

25+
### Task: Script
26+
27+
**Script body**
28+
29+
```powershell
30+
(dotnet gitversion | ConvertFrom-Json).PSObject.Properties | ForEach-Object { Write-Output "$($_.Name)=$($_.Value)" } | Out-File -Encoding UTF8 -FilePath gitversion.txt
31+
```
32+
2233
### Task: Inject Bamboo variables Configuration
2334

2435
**Required Properties**

0 commit comments

Comments
 (0)