Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ object CommitUUIDProvider extends LogSupport {
ArgoCDProvider,
AWSCodeBuildProvider,
AzurePipelinesProvider,
BitbucketCloudProvider,
BitriseCIProvider,
BuildkiteCIProvider,
CircleCIProvider,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.codacy.rules.commituuid.providers

import com.codacy.model.configuration.CommitUUID
import com.codacy.rules.commituuid.CommitUUIDProvider

/** Bitbucket Cloud Pipeline provider */
object BitbucketCloudProvider extends CommitUUIDProvider {
val name: String = "Bitbucket Cloud Pipeline"

override def validateEnvironment(environment: Map[String, String]): Boolean = {
// CI is a bit generic and could be used by other CI Providers as well
// Check on Bitbucket Build Number as well
environment.contains("CI") && environment.contains("BITBUCKET_BUILD_NUMBER")
}

override def getValidCommitUUID(environment: Map[String, String]): Either[String, CommitUUID] =
parseEnvironmentVariable(environment.get("BITBUCKET_COMMIT"))
}