Class: Datadog::CI::Ext::Environment::Providers::LocalGit

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

Overview

As a fallback we try to fetch git information from the local git repository

Instance Attribute Summary

Attributes inherited from Base

#env

Instance Method Summary collapse

Methods inherited from Base

#additional_tags, #ci_env_vars, #git_branch_or_tag, handles?, #initialize, #job_name, #job_url, #node_labels, #node_name, #pipeline_id, #pipeline_name, #pipeline_number, #pipeline_url, #provider_name, #stage_name

Constructor Details

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

Instance Method Details

#git_branchObject



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

def git_branch
  CI::Git::LocalRepository.git_branch
end

#git_commit_author_dateObject



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

def git_commit_author_date
  author.date
end

#git_commit_author_emailObject



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

def git_commit_author_email
  author.email
end

#git_commit_author_nameObject



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

def git_commit_author_name
  author.name
end

#git_commit_committer_dateObject



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

def git_commit_committer_date
  committer.date
end

#git_commit_committer_emailObject



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

def git_commit_committer_email
  committer.email
end

#git_commit_committer_nameObject



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

def git_commit_committer_name
  committer.name
end

#git_commit_messageObject



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

def git_commit_message
  CI::Git::LocalRepository.git_commit_message
end

#git_commit_shaObject



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

def git_commit_sha
  CI::Git::LocalRepository.git_commit_sha
end

#git_repository_urlObject



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

def git_repository_url
  CI::Git::LocalRepository.git_repository_url
end

#git_tagObject



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

def git_tag
  CI::Git::LocalRepository.git_tag
end

#workspace_pathObject



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

def workspace_path
  CI::Git::LocalRepository.git_root
end