Sha256: 43d78685f86815748011a21263ffc2f5ccf5ea659550ce09e939fdbdfc97969b

Contents?: true

Size: 803 Bytes

Versions: 2

Compression:

Stored size: 803 Bytes

Contents

module KnapsackPro
  module Config
    module CI
      class Semaphore < Base
        def node_total
          ENV['SEMAPHORE_THREAD_COUNT']
        end

        def node_index
          index = ENV['SEMAPHORE_CURRENT_THREAD']
          index.to_i - 1 if index
        end

        def node_build_id
          ENV['SEMAPHORE_BUILD_NUMBER']
        end

        def commit_hash
          ENV['REVISION']
        end

        def branch
          ENV['BRANCH_NAME']
        end

        def project_dir
          ENV['SEMAPHORE_PROJECT_DIR']
        end

        def detected
          ENV.key?('SEMAPHORE_BUILD_NUMBER') ? self.class : nil
        end

        def fixed_queue_split
          false
        end

        def ci_provider
          "Semaphore CI 1.0"
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
knapsack_pro-5.4.1 lib/knapsack_pro/config/ci/semaphore.rb
knapsack_pro-5.4.0 lib/knapsack_pro/config/ci/semaphore.rb