-
-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
032cbc6
commit 0568520
Showing
3 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/NerdBank.GitVersioning/CloudBuildServices/BitbucketCloud.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright (c) .NET Foundation and Contributors. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
namespace Nerdbank.GitVersioning.CloudBuildServices; | ||
|
||
/// <summary> | ||
/// Cloud build handling for Bitbucket Cloud. | ||
/// </summary> | ||
/// <remarks> | ||
/// The Bitbucket-specific properties referenced here are <see href="https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/">documented here</see>. | ||
/// </remarks> | ||
public class BitbucketCloud : ICloudBuild | ||
{ | ||
/// <inheritdoc /> | ||
public bool IsApplicable => !string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("BITBUCKET_PIPELINE_UUID")) && | ||
!string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("BITBUCKET_STEP_UUID")) && | ||
!string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("BITBUCKET_STEP_TRIGGERER_UUID")); | ||
|
||
/// <inheritdoc /> | ||
public bool IsPullRequest => !string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("BITBUCKET_PR_ID")); | ||
|
||
/// <inheritdoc /> | ||
public string BuildingBranch => Environment.GetEnvironmentVariable("BITBUCKET_BRANCH"); | ||
|
||
/// <inheritdoc /> | ||
public string BuildingTag => Environment.GetEnvironmentVariable("BITBUCKET_TAG"); | ||
|
||
/// <inheritdoc /> | ||
public string GitCommitId => Environment.GetEnvironmentVariable("BITBUCKET_COMMIT"); | ||
|
||
/// <inheritdoc /> | ||
public IReadOnlyDictionary<string, string> SetCloudBuildNumber(string buildNumber, TextWriter stdout, TextWriter stderr) | ||
{ | ||
return new Dictionary<string, string>(); | ||
} | ||
|
||
/// <inheritdoc /> | ||
public IReadOnlyDictionary<string, string> SetCloudBuildVariable(string name, string value, TextWriter stdout, TextWriter stderr) | ||
{ | ||
return new Dictionary<string, string>(); | ||
} | ||
} |