Class: KnapsackPro::Config::CI::SnapCI

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

Instance Method Summary collapse

Instance Method Details

#branchObject

docs.snap-ci.com/environment-variables/ SNAP_BRANCH - the name of the git branch (not present on pull requests) SNAP_UPSTREAM_BRANCH - the upstream branch for which the pull request was opened



25
26
27
# File 'lib/knapsack_pro/config/ci/snap_ci.rb', line 25

def branch
  ENV['SNAP_BRANCH'] || ENV['SNAP_UPSTREAM_BRANCH']
end

#commit_hashObject



18
19
20
# File 'lib/knapsack_pro/config/ci/snap_ci.rb', line 18

def commit_hash
  ENV['SNAP_COMMIT']
end

#node_build_idObject



14
15
16
# File 'lib/knapsack_pro/config/ci/snap_ci.rb', line 14

def node_build_id
  ENV['SNAP_PIPELINE_COUNTER']
end

#node_indexObject



9
10
11
12
# File 'lib/knapsack_pro/config/ci/snap_ci.rb', line 9

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

#node_totalObject



5
6
7
# File 'lib/knapsack_pro/config/ci/snap_ci.rb', line 5

def node_total
  ENV['SNAP_WORKER_TOTAL']
end

#project_dirObject



29
30
31
# File 'lib/knapsack_pro/config/ci/snap_ci.rb', line 29

def project_dir
  ENV['SNAP_WORKING_DIR']
end