Class: KnapsackPro::Config::CI::Semaphore

Inherits:
Base
  • Object
show all
Defined in:
lib/knapsack_pro/config/ci/semaphore.rb

Overview

Semaphore Classic is deprecated semaphoreci.com/blog/semaphore-classic-deprecation

Instance Method Summary collapse

Methods inherited from Base

#node_retry_count, #user_seat

Instance Method Details

#branchObject



24
25
26
# File 'lib/knapsack_pro/config/ci/semaphore.rb', line 24

def branch
  ENV['BRANCH_NAME']
end

#ci_providerObject



40
41
42
# File 'lib/knapsack_pro/config/ci/semaphore.rb', line 40

def ci_provider
  "Semaphore CI 1.0"
end

#commit_hashObject



20
21
22
# File 'lib/knapsack_pro/config/ci/semaphore.rb', line 20

def commit_hash
  ENV['REVISION']
end

#detectedObject



32
33
34
# File 'lib/knapsack_pro/config/ci/semaphore.rb', line 32

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

#fixed_queue_splitObject



36
37
38
# File 'lib/knapsack_pro/config/ci/semaphore.rb', line 36

def fixed_queue_split
  false
end

#node_build_idObject



16
17
18
# File 'lib/knapsack_pro/config/ci/semaphore.rb', line 16

def node_build_id
  ENV['SEMAPHORE_BUILD_NUMBER']
end

#node_indexObject



11
12
13
14
# File 'lib/knapsack_pro/config/ci/semaphore.rb', line 11

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

#node_totalObject



7
8
9
# File 'lib/knapsack_pro/config/ci/semaphore.rb', line 7

def node_total
  ENV['SEMAPHORE_THREAD_COUNT']
end

#project_dirObject



28
29
30
# File 'lib/knapsack_pro/config/ci/semaphore.rb', line 28

def project_dir
  ENV['SEMAPHORE_PROJECT_DIR']
end