diff --git a/readme.md b/readme.md
index ce13f7e5..f0ba6bd1 100644
--- a/readme.md
+++ b/readme.md
@@ -144,6 +144,7 @@ Supports:
* [MyGet](https://docs.myget.org/docs/reference/build-services#Available_Environment_Variables)
* [GitLab](https://docs.gitlab.com/ee/ci/variables/predefined_variables.html)
* [GoCD](https://docs.gocd.org/current/faq/dev_use_current_revision_in_build.html)
+ * [Bitbucket Pipelines](https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/#Default-variables)
There are also individual properties to check for each specific build system
@@ -161,8 +162,9 @@ var isMyGet = BuildServerDetector.IsMyGet;
var isGoDc = BuildServerDetector.IsGoDc;
var isDocker = BuildServerDetector.IsDocker;
var isAppVeyor = BuildServerDetector.IsAppVeyor;
+var isBitbucketPipelines = BuildServerDetector.IsBitbucketPipelines;
```
-snippet source | anchor
+snippet source | anchor
@@ -206,7 +208,7 @@ public async Task SetDetectedDoesNotLeakToOtherContexts()
await Assert.That(BuildServerDetector.Detected).IsEqualTo(parentValue);
}
```
-snippet source | anchor
+snippet source | anchor
diff --git a/readme.source.md b/readme.source.md
index 4fbb8b12..33e8a3a0 100644
--- a/readme.source.md
+++ b/readme.source.md
@@ -71,6 +71,7 @@ Supports:
* [MyGet](https://docs.myget.org/docs/reference/build-services#Available_Environment_Variables)
* [GitLab](https://docs.gitlab.com/ee/ci/variables/predefined_variables.html)
* [GoCD](https://docs.gocd.org/current/faq/dev_use_current_revision_in_build.html)
+ * [Bitbucket Pipelines](https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/#Default-variables)
There are also individual properties to check for each specific build system
diff --git a/src/DiffEngine.Tests/BuildServerDetectorTest.cs b/src/DiffEngine.Tests/BuildServerDetectorTest.cs
index 97152286..d89b778a 100644
--- a/src/DiffEngine.Tests/BuildServerDetectorTest.cs
+++ b/src/DiffEngine.Tests/BuildServerDetectorTest.cs
@@ -18,6 +18,7 @@ public void Props()
var isGoDc = BuildServerDetector.IsGoDc;
var isDocker = BuildServerDetector.IsDocker;
var isAppVeyor = BuildServerDetector.IsAppVeyor;
+ var isBitbucketPipelines = BuildServerDetector.IsBitbucketPipelines;
#endregion
diff --git a/src/DiffEngine/BuildServerDetector.cs b/src/DiffEngine/BuildServerDetector.cs
index c0ce9bb6..d0e92fd2 100644
--- a/src/DiffEngine/BuildServerDetector.cs
+++ b/src/DiffEngine/BuildServerDetector.cs
@@ -43,6 +43,10 @@ static BuildServerDetector()
// https://www.appveyor.com/docs/environment-variables/
IsAppVeyor = variables.Contains("APPVEYOR");
+ // Bitbucket Pipelines
+ // https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/#Default-variables
+ IsBitbucketPipelines = variables.Contains("BITBUCKET_BUILD_NUMBER");
+
IsWsl = variables.Contains("WSL_DISTRO_NAME");
// AzureDevops
@@ -62,7 +66,8 @@ static BuildServerDetector()
IsGoDc ||
IsDocker ||
IsWsl ||
- IsAppVeyor;
+ IsAppVeyor ||
+ IsBitbucketPipelines;
}
static bool detected;
@@ -83,6 +88,8 @@ static bool ValueEquals(IDictionary variables, string key, string value)
public static bool IsAppVeyor { get; }
+ public static bool IsBitbucketPipelines { get; }
+
public static bool IsTravis { get; }
public static bool IsDocker { get; }