Class: KnapsackPro::Config::CI::Semaphore2
- Defined in:
- lib/knapsack_pro/config/ci/semaphore2.rb
Instance Method Summary collapse
- #branch ⇒ Object
- #ci_provider ⇒ Object
- #commit_hash ⇒ Object
- #detected ⇒ Object
- #fixed_queue_split ⇒ Object
- #node_build_id ⇒ Object
- #node_index ⇒ Object
- #node_total ⇒ Object
- #project_dir ⇒ Object
- #user_seat ⇒ 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 |
#ci_provider ⇒ Object
46 47 48 |
# File 'lib/knapsack_pro/config/ci/semaphore2.rb', line 46 def ci_provider "Semaphore CI 2.0" 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
37 38 39 40 |
# File 'lib/knapsack_pro/config/ci/semaphore2.rb', line 37 def detected # check 2 keys to be sure we are using Semaphore 2.0 ENV.key?('SEMAPHORE') && ENV.key?('SEMAPHORE_WORKFLOW_ID') ? self.class : nil end |
#fixed_queue_split ⇒ Object
42 43 44 |
# File 'lib/knapsack_pro/config/ci/semaphore2.rb', line 42 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 |
#user_seat ⇒ Object
33 34 35 |
# File 'lib/knapsack_pro/config/ci/semaphore2.rb', line 33 def user_seat # not provided end |