Skip to content

Commit c127cd6

Browse files
committed
#108: add atlassian bamboo as cloud build
1 parent f009baa commit c127cd6

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
namespace Nerdbank.GitVersioning.CloudBuildServices
2+
{
3+
using System;
4+
using System.Collections.Generic;
5+
using System.IO;
6+
7+
/// <summary>
8+
///
9+
/// </summary>
10+
/// <remarks>
11+
/// The Bamboo-specific properties referenced here are documented here:
12+
/// https://confluence.atlassian.com/bamboo/bamboo-variables-289277087.html
13+
/// </remarks>
14+
internal class AtlassianBamboo : ICloudBuild
15+
{
16+
public bool IsPullRequest => false;
17+
18+
public string BuildingTag => null;
19+
20+
public string BuildingBranch => CloudBuild.ShouldStartWith(Environment.GetEnvironmentVariable("bamboo.planRepository.branch"), "refs/heads/");
21+
22+
public string BuildingRef => this.BuildingBranch;
23+
24+
public string GitCommitId => Environment.GetEnvironmentVariable("bamboo.planRepository.revision");
25+
26+
public bool IsApplicable => !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("bamboo.buildKey"));
27+
28+
public IReadOnlyDictionary<string, string> SetCloudBuildNumber(string buildNumber, TextWriter stdout, TextWriter stderr)
29+
{
30+
return new Dictionary<string, string>();
31+
}
32+
33+
public IReadOnlyDictionary<string, string> SetCloudBuildVariable(string name, string value, TextWriter stdout, TextWriter stderr)
34+
{
35+
return new Dictionary<string, string>();
36+
}
37+
}
38+
}

0 commit comments

Comments
 (0)