Class: Datadog::CI::Ext::Environment::Providers::Appveyor

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

Overview

Appveyor: www.appveyor.com/ Environment variables docs: www.appveyor.com/docs/environment-variables/

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_committer_date, #git_commit_committer_email, #git_commit_committer_name, #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/appveyor.rb', line 13

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

Instance Method Details

#git_branchObject



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

def git_branch
  return nil unless github_repo_provider?

  env["APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH"] || env["APPVEYOR_REPO_BRANCH"]
end

#git_commit_author_emailObject



73
74
75
# File 'lib/datadog/ci/ext/environment/providers/appveyor.rb', line 73

def git_commit_author_email
  env["APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL"]
end

#git_commit_author_nameObject



69
70
71
# File 'lib/datadog/ci/ext/environment/providers/appveyor.rb', line 69

def git_commit_author_name
  env["APPVEYOR_REPO_COMMIT_AUTHOR"]
end

#git_commit_messageObject



77
78
79
80
81
82
83
84
# File 'lib/datadog/ci/ext/environment/providers/appveyor.rb', line 77

def git_commit_message
  commit_message = env["APPVEYOR_REPO_COMMIT_MESSAGE"]
  if commit_message
    extended = env["APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED"]
    commit_message = "#{commit_message}\n#{extended}" if extended
  end
  commit_message
end

#git_commit_shaObject



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

def git_commit_sha
  return nil unless github_repo_provider?

  env["APPVEYOR_REPO_COMMIT"]
end

#git_repository_urlObject



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

def git_repository_url
  return nil unless github_repo_provider?

  "https://github.com/#{env["APPVEYOR_REPO_NAME"]}.git"
end

#git_tagObject



63
64
65
66
67
# File 'lib/datadog/ci/ext/environment/providers/appveyor.rb', line 63

def git_tag
  return nil unless github_repo_provider?

  env["APPVEYOR_REPO_TAG_NAME"]
end

#job_urlObject



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

def job_url
  url
end

#pipeline_idObject



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

def pipeline_id
  env["APPVEYOR_BUILD_ID"]
end

#pipeline_nameObject



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

def pipeline_name
  env["APPVEYOR_REPO_NAME"]
end

#pipeline_numberObject



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

def pipeline_number
  env["APPVEYOR_BUILD_NUMBER"]
end

#pipeline_urlObject



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

def pipeline_url
  url
end

#provider_nameObject



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

def provider_name
  Provider::APPVEYOR
end

#workspace_pathObject



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

def workspace_path
  env["APPVEYOR_BUILD_FOLDER"]
end