Sha256: 5b47b6331e03a28426efdd6b895241b1fce6d6fba0e781186354e9ff42fe80d2

Contents?: true

Size: 1.94 KB

Versions: 19

Compression:

Stored size: 1.94 KB

Contents

# frozen_string_literal: true

require_relative "base"

module Datadog
  module CI
    module Ext
      module Environment
        module Providers
          # Bitrise: https://bitrise.io/
          # Environment variables docs: https://devcenter.bitrise.io/en/references/available-environment-variables.html
          class Bitrise < Base
            def self.handles?(env)
              env.key?("BITRISE_BUILD_SLUG")
            end

            def provider_name
              "bitrise"
            end

            def pipeline_id
              env["BITRISE_BUILD_SLUG"]
            end

            def pipeline_name
              env["BITRISE_TRIGGERED_WORKFLOW_ID"]
            end

            def pipeline_number
              env["BITRISE_BUILD_NUMBER"]
            end

            def pipeline_url
              env["BITRISE_BUILD_URL"]
            end

            def workspace_path
              env["BITRISE_SOURCE_DIR"]
            end

            def git_repository_url
              env["GIT_REPOSITORY_URL"]
            end

            def git_commit_sha
              env["BITRISE_GIT_COMMIT"] || env["GIT_CLONE_COMMIT_HASH"]
            end

            def git_branch
              env["BITRISEIO_GIT_BRANCH_DEST"] || env["BITRISE_GIT_BRANCH"]
            end

            def git_tag
              env["BITRISE_GIT_TAG"]
            end

            def git_commit_message
              env["BITRISE_GIT_MESSAGE"]
            end

            def git_commit_author_name
              env["GIT_CLONE_COMMIT_AUTHOR_NAME"]
            end

            def git_commit_author_email
              env["GIT_CLONE_COMMIT_AUTHOR_EMAIL"]
            end

            def git_commit_committer_name
              env["GIT_CLONE_COMMIT_COMMITER_NAME"]
            end

            def git_commit_committer_email
              env["GIT_CLONE_COMMIT_COMMITER_EMAIL"] || env["GIT_CLONE_COMMIT_COMMITER_NAME"]
            end
          end
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
datadog-ci-1.2.0 lib/datadog/ci/ext/environment/providers/bitrise.rb
datadog-ci-1.1.0 lib/datadog/ci/ext/environment/providers/bitrise.rb
datadog-ci-1.0.1 lib/datadog/ci/ext/environment/providers/bitrise.rb
datadog-ci-1.0.0 lib/datadog/ci/ext/environment/providers/bitrise.rb
datadog-ci-1.0.0.beta6 lib/datadog/ci/ext/environment/providers/bitrise.rb
datadog-ci-1.0.0.beta3 lib/datadog/ci/ext/environment/providers/bitrise.rb
datadog-ci-1.0.0.beta2 lib/datadog/ci/ext/environment/providers/bitrise.rb
datadog-ci-1.0.0.beta1 lib/datadog/ci/ext/environment/providers/bitrise.rb
datadog-ci-0.8.3 lib/datadog/ci/ext/environment/providers/bitrise.rb
datadog-ci-0.8.2 lib/datadog/ci/ext/environment/providers/bitrise.rb
datadog-ci-0.8.1 lib/datadog/ci/ext/environment/providers/bitrise.rb
datadog-ci-0.8.0 lib/datadog/ci/ext/environment/providers/bitrise.rb
datadog-ci-0.7.0 lib/datadog/ci/ext/environment/providers/bitrise.rb
datadog-ci-0.6.0 lib/datadog/ci/ext/environment/providers/bitrise.rb
datadog-ci-0.5.1 lib/datadog/ci/ext/environment/providers/bitrise.rb
datadog-ci-0.5.0 lib/datadog/ci/ext/environment/providers/bitrise.rb
datadog-ci-0.4.1 lib/datadog/ci/ext/environment/providers/bitrise.rb
datadog-ci-0.4.0 lib/datadog/ci/ext/environment/providers/bitrise.rb
datadog-ci-0.3.0 lib/datadog/ci/ext/environment/providers/bitrise.rb