class KnapsackPro::Config::CI::Semaphore2

Public Instance Methods

branch() click to toggle source
# File lib/knapsack_pro/config/ci/semaphore2.rb, line 25
def branch
  ENV['SEMAPHORE_GIT_BRANCH']
end
ci_provider() click to toggle source
# File lib/knapsack_pro/config/ci/semaphore2.rb, line 48
def ci_provider
  "Semaphore CI 2.0"
end
commit_hash() click to toggle source
# File lib/knapsack_pro/config/ci/semaphore2.rb, line 21
def commit_hash
  ENV['SEMAPHORE_GIT_SHA']
end
detected() click to toggle source
# File lib/knapsack_pro/config/ci/semaphore2.rb, line 39
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() click to toggle source
# File lib/knapsack_pro/config/ci/semaphore2.rb, line 44
def fixed_queue_split
  false
end
node_build_id() click to toggle source
# File lib/knapsack_pro/config/ci/semaphore2.rb, line 17
def node_build_id
  ENV['SEMAPHORE_WORKFLOW_ID']
end
node_index() click to toggle source
# File lib/knapsack_pro/config/ci/semaphore2.rb, line 12
def node_index
  index = ENV['SEMAPHORE_JOB_INDEX']
  index.to_i - 1 if index
end
node_total() click to toggle source
# File lib/knapsack_pro/config/ci/semaphore2.rb, line 8
def node_total
  ENV['SEMAPHORE_JOB_COUNT']
end
project_dir() click to toggle source
# File lib/knapsack_pro/config/ci/semaphore2.rb, line 29
def project_dir
  if ENV['HOME'] && ENV['SEMAPHORE_GIT_DIR']
    "#{ENV['HOME']}/#{ENV['SEMAPHORE_GIT_DIR']}"
  end
end
user_seat() click to toggle source
# File lib/knapsack_pro/config/ci/semaphore2.rb, line 35
def user_seat
  # not provided
end