Class: KnapsackPro::Config::CI::Semaphore2
- Defined in:
- lib/knapsack_pro/config/ci/semaphore2.rb
Instance Method Summary collapse
- #branch ⇒ Object
- #commit_hash ⇒ Object
- #node_build_id ⇒ Object
- #node_index ⇒ Object
- #node_total ⇒ Object
- #project_dir ⇒ Object
Methods inherited from Base
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 |
#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 |