Class: KnapsackPro::Config::CI::Semaphore2
- Inherits:
-
Base
- Object
- Base
- KnapsackPro::Config::CI::Semaphore2
show all
- Defined in:
- lib/knapsack_pro/config/ci/semaphore2.rb
Instance Method Summary
collapse
Methods inherited from Base
#node_retry_count, #user_seat
Instance Method Details
#branch ⇒ Object
23
24
25
|
# File 'lib/knapsack_pro/config/ci/semaphore2.rb', line 23
def branch
ENV['SEMAPHORE_GIT_BRANCH']
end
|
#commit_hash ⇒ Object
19
20
21
|
# File 'lib/knapsack_pro/config/ci/semaphore2.rb', line 19
def commit_hash
ENV['SEMAPHORE_GIT_SHA']
end
|
#detected ⇒ Object
33
34
35
36
|
# File 'lib/knapsack_pro/config/ci/semaphore2.rb', line 33
def detected
ENV.key?('SEMAPHORE') && ENV.key?('SEMAPHORE_WORKFLOW_ID') ? self.class : nil
end
|
#fixed_queue_split ⇒ Object
38
39
40
|
# File 'lib/knapsack_pro/config/ci/semaphore2.rb', line 38
def fixed_queue_split
false
end
|
#node_build_id ⇒ Object
15
16
17
|
# File 'lib/knapsack_pro/config/ci/semaphore2.rb', line 15
def node_build_id
ENV['SEMAPHORE_WORKFLOW_ID']
end
|
#node_index ⇒ Object
10
11
12
13
|
# File 'lib/knapsack_pro/config/ci/semaphore2.rb', line 10
def node_index
index = ENV['SEMAPHORE_JOB_INDEX']
index.to_i - 1 if index
end
|
#node_total ⇒ Object
6
7
8
|
# File 'lib/knapsack_pro/config/ci/semaphore2.rb', line 6
def node_total
ENV['SEMAPHORE_JOB_COUNT']
end
|
#project_dir ⇒ Object
27
28
29
30
31
|
# File 'lib/knapsack_pro/config/ci/semaphore2.rb', line 27
def project_dir
if ENV['HOME'] && ENV['SEMAPHORE_GIT_DIR']
"#{ENV['HOME']}/#{ENV['SEMAPHORE_GIT_DIR']}"
end
end
|