Class: Datadog::CI::Ext::Environment::Providers::Bitbucket

Inherits:
Base
  • Object
show all
Defined in:
lib/datadog/ci/ext/environment/providers/bitbucket.rb

Overview

Instance Attribute Summary

Attributes inherited from Base

#env

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#additional_tags, #ci_env_vars, #git_branch_or_tag, #git_commit_author_date, #git_commit_author_email, #git_commit_author_name, #git_commit_committer_date, #git_commit_committer_email, #git_commit_committer_name, #git_commit_message, #initialize, #job_name, #node_labels, #node_name, #stage_name

Constructor Details

This class inherits a constructor from Datadog::CI::Ext::Environment::Providers::Base

Class Method Details

.handles?(env) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/datadog/ci/ext/environment/providers/bitbucket.rb', line 13

def self.handles?(env)
  env.key?("BITBUCKET_COMMIT")
end

Instance Method Details

#git_branchObject



54
55
56
# File 'lib/datadog/ci/ext/environment/providers/bitbucket.rb', line 54

def git_branch
  env["BITBUCKET_BRANCH"]
end

#git_commit_shaObject



50
51
52
# File 'lib/datadog/ci/ext/environment/providers/bitbucket.rb', line 50

def git_commit_sha
  env["BITBUCKET_COMMIT"]
end

#git_repository_urlObject



46
47
48
# File 'lib/datadog/ci/ext/environment/providers/bitbucket.rb', line 46

def git_repository_url
  env["BITBUCKET_GIT_SSH_ORIGIN"] || env["BITBUCKET_GIT_HTTP_ORIGIN"]
end

#git_tagObject



58
59
60
# File 'lib/datadog/ci/ext/environment/providers/bitbucket.rb', line 58

def git_tag
  env["BITBUCKET_TAG"]
end

#job_urlObject



38
39
40
# File 'lib/datadog/ci/ext/environment/providers/bitbucket.rb', line 38

def job_url
  url
end

#pipeline_idObject



22
23
24
# File 'lib/datadog/ci/ext/environment/providers/bitbucket.rb', line 22

def pipeline_id
  env["BITBUCKET_PIPELINE_UUID"]&.tr("{}", "")
end

#pipeline_nameObject



26
27
28
# File 'lib/datadog/ci/ext/environment/providers/bitbucket.rb', line 26

def pipeline_name
  env["BITBUCKET_REPO_FULL_NAME"]
end

#pipeline_numberObject



30
31
32
# File 'lib/datadog/ci/ext/environment/providers/bitbucket.rb', line 30

def pipeline_number
  env["BITBUCKET_BUILD_NUMBER"]
end

#pipeline_urlObject



34
35
36
# File 'lib/datadog/ci/ext/environment/providers/bitbucket.rb', line 34

def pipeline_url
  url
end

#provider_nameObject

overridden methods



18
19
20
# File 'lib/datadog/ci/ext/environment/providers/bitbucket.rb', line 18

def provider_name
  Provider::BITBUCKET
end

#workspace_pathObject



42
43
44
# File 'lib/datadog/ci/ext/environment/providers/bitbucket.rb', line 42

def workspace_path
  env["BITBUCKET_CLONE_DIR"]
end