Sha256: d7ac12794dc5defeb08aed4f057e6a8829b4771c591072c4913a755e30e0ab5c

Contents?: true

Size: 1.66 KB

Versions: 14

Compression:

Stored size: 1.66 KB

Contents

# frozen_string_literal: true

require_relative "base"

module Datadog
  module CI
    module Ext
      module Environment
        module Providers
          # Buddy: https://buddy.works/
          # Environment variables docs: https://buddy.works/docs/pipelines/environment-variables
          class Buddy < Base
            def self.handles?(env)
              env.key?("BUDDY")
            end

            def provider_name
              Provider::BUDDYCI
            end

            def pipeline_id
              "#{env["BUDDY_PIPELINE_ID"]}/#{env["BUDDY_EXECUTION_ID"]}"
            end

            def pipeline_name
              env["BUDDY_PIPELINE_NAME"]
            end

            def pipeline_number
              env["BUDDY_EXECUTION_ID"]
            end

            def pipeline_url
              env["BUDDY_EXECUTION_URL"]
            end

            def workspace_path
              env["CI_WORKSPACE_PATH"]
            end

            def git_repository_url
              env["BUDDY_SCM_URL"]
            end

            def git_commit_sha
              env["BUDDY_EXECUTION_REVISION"]
            end

            def git_branch
              env["BUDDY_EXECUTION_BRANCH"]
            end

            def git_tag
              env["BUDDY_EXECUTION_TAG"]
            end

            def git_commit_message
              env["BUDDY_EXECUTION_REVISION_MESSAGE"]
            end

            def git_commit_committer_name
              env["BUDDY_EXECUTION_REVISION_COMMITTER_NAME"]
            end

            def git_commit_committer_email
              env["BUDDY_EXECUTION_REVISION_COMMITTER_EMAIL"]
            end
          end
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
datadog-ci-1.14.0 lib/datadog/ci/ext/environment/providers/buddy.rb
datadog-ci-1.13.0 lib/datadog/ci/ext/environment/providers/buddy.rb
datadog-ci-1.12.0 lib/datadog/ci/ext/environment/providers/buddy.rb
datadog-ci-1.11.0 lib/datadog/ci/ext/environment/providers/buddy.rb
datadog-ci-1.10.0 lib/datadog/ci/ext/environment/providers/buddy.rb
datadog-ci-1.9.0 lib/datadog/ci/ext/environment/providers/buddy.rb
datadog-ci-1.8.1 lib/datadog/ci/ext/environment/providers/buddy.rb
datadog-ci-1.8.0 lib/datadog/ci/ext/environment/providers/buddy.rb
datadog-ci-1.7.0 lib/datadog/ci/ext/environment/providers/buddy.rb
datadog-ci-1.6.0 lib/datadog/ci/ext/environment/providers/buddy.rb
datadog-ci-1.5.0 lib/datadog/ci/ext/environment/providers/buddy.rb
datadog-ci-1.4.1 lib/datadog/ci/ext/environment/providers/buddy.rb
datadog-ci-1.4.0 lib/datadog/ci/ext/environment/providers/buddy.rb
datadog-ci-1.3.0 lib/datadog/ci/ext/environment/providers/buddy.rb