Class: Datadog::CI::Ext::Environment::Providers::AwsCodePipeline

Inherits:
Base
  • Object
show all
Defined in:
lib/datadog/ci/ext/environment/providers/aws_code_pipeline.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_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, #git_commit_sha, #git_repository_url, #git_tag, #initialize, #job_name, #job_url, #node_labels, #node_name, #pipeline_name, #pipeline_number, #pipeline_url, #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/aws_code_pipeline.rb', line 15

def self.handles?(env)
  !env["CODEBUILD_INITIATOR"].nil? && env["CODEBUILD_INITIATOR"].start_with?("codepipeline")
end

Instance Method Details

#ci_env_varsObject



27
28
29
30
31
32
33
# File 'lib/datadog/ci/ext/environment/providers/aws_code_pipeline.rb', line 27

def ci_env_vars
  {
    "CODEBUILD_BUILD_ARN" => env["CODEBUILD_BUILD_ARN"],
    "DD_PIPELINE_EXECUTION_ID" => env["DD_PIPELINE_EXECUTION_ID"],
    "DD_ACTION_EXECUTION_ID" => env["DD_ACTION_EXECUTION_ID"]
  }.to_json
end

#pipeline_idObject



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

def pipeline_id
  env["DD_PIPELINE_EXECUTION_ID"]
end

#provider_nameObject



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

def provider_name
  Provider::AWS
end