Class: Datadog::CI::Ext::Environment::Providers::Codefresh

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

Overview

Instance Attribute Summary

Attributes inherited from Base

#env

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#additional_tags, #git_branch, #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, #git_commit_sha, #git_repository_url, #git_tag, #initialize, #job_url, #node_labels, #node_name, #pipeline_number, #stage_name, #workspace_path

Constructor Details

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

Class Method Details

.handles?(env) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/datadog/ci/ext/environment/providers/codefresh.rb', line 15

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

Instance Method Details

#ci_env_varsObject



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

def ci_env_vars
  {
    "CF_BUILD_ID" => env["CF_BUILD_ID"]
  }.to_json
end

#git_branch_or_tagObject



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

def git_branch_or_tag
  env["CF_BRANCH"]
end

#job_nameObject



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

def job_name
  env["CF_STEP_NAME"]
end

#pipeline_idObject



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

def pipeline_id
  env["CF_BUILD_ID"]
end

#pipeline_nameObject



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

def pipeline_name
  env["CF_PIPELINE_NAME"]
end

#pipeline_urlObject



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

def pipeline_url
  env["CF_BUILD_URL"]
end

#provider_nameObject



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

def provider_name
  Provider::CODEFRESH
end