Sha256: 9eacef245db923f645e8fbe21d39efad8e8aba6a1b4407f4020e2118d26f561c

Contents?: true

Size: 1.51 KB

Versions: 33

Compression:

Stored size: 1.51 KB

Contents

# frozen_string_literal: true

require_relative "base"
require_relative "../../git"

module Datadog
  module CI
    module Ext
      module Environment
        module Providers
          # Parses user defined git data from the environment variables
          # User documentation: https://docs.datadoghq.com/continuous_integration/troubleshooting/#data-appears-in-test-runs-but-not-tests
          class UserDefinedTags < Base
            def git_repository_url
              env[Git::ENV_REPOSITORY_URL]
            end

            def git_commit_sha
              env[Git::ENV_COMMIT_SHA]
            end

            def git_branch
              env[Git::ENV_BRANCH]
            end

            def git_tag
              env[Git::ENV_TAG]
            end

            def git_commit_message
              env[Git::ENV_COMMIT_MESSAGE]
            end

            def git_commit_author_name
              env[Git::ENV_COMMIT_AUTHOR_NAME]
            end

            def git_commit_author_email
              env[Git::ENV_COMMIT_AUTHOR_EMAIL]
            end

            def git_commit_author_date
              env[Git::ENV_COMMIT_AUTHOR_DATE]
            end

            def git_commit_committer_name
              env[Git::ENV_COMMIT_COMMITTER_NAME]
            end

            def git_commit_committer_email
              env[Git::ENV_COMMIT_COMMITTER_EMAIL]
            end

            def git_commit_committer_date
              env[Git::ENV_COMMIT_COMMITTER_DATE]
            end
          end
        end
      end
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
datadog-ci-1.11.0 lib/datadog/ci/ext/environment/providers/user_defined_tags.rb
datadog-ci-1.10.0 lib/datadog/ci/ext/environment/providers/user_defined_tags.rb
datadog-ci-1.9.0 lib/datadog/ci/ext/environment/providers/user_defined_tags.rb
datadog-ci-1.8.1 lib/datadog/ci/ext/environment/providers/user_defined_tags.rb
datadog-ci-1.8.0 lib/datadog/ci/ext/environment/providers/user_defined_tags.rb
datadog-ci-1.7.0 lib/datadog/ci/ext/environment/providers/user_defined_tags.rb
datadog-ci-1.6.0 lib/datadog/ci/ext/environment/providers/user_defined_tags.rb
datadog-ci-1.5.0 lib/datadog/ci/ext/environment/providers/user_defined_tags.rb
datadog-ci-1.4.1 lib/datadog/ci/ext/environment/providers/user_defined_tags.rb
datadog-ci-1.4.0 lib/datadog/ci/ext/environment/providers/user_defined_tags.rb
datadog-ci-1.3.0 lib/datadog/ci/ext/environment/providers/user_defined_tags.rb
datadog-ci-1.2.0 lib/datadog/ci/ext/environment/providers/user_defined_tags.rb
datadog-ci-1.1.0 lib/datadog/ci/ext/environment/providers/user_defined_tags.rb
datadog-ci-1.0.1 lib/datadog/ci/ext/environment/providers/user_defined_tags.rb
datadog-ci-1.0.0 lib/datadog/ci/ext/environment/providers/user_defined_tags.rb
datadog-ci-1.0.0.beta6 lib/datadog/ci/ext/environment/providers/user_defined_tags.rb
datadog-ci-1.0.0.beta3 lib/datadog/ci/ext/environment/providers/user_defined_tags.rb
datadog-ci-1.0.0.beta2 lib/datadog/ci/ext/environment/providers/user_defined_tags.rb
datadog-ci-1.0.0.beta1 lib/datadog/ci/ext/environment/providers/user_defined_tags.rb
datadog-ci-0.8.3 lib/datadog/ci/ext/environment/providers/user_defined_tags.rb