Class: KnapsackPro::Config::CI::SnapCI
- Defined in:
- lib/knapsack_pro/config/ci/snap_ci.rb
Instance Method Summary collapse
-
#branch ⇒ Object
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.
- #commit_hash ⇒ Object
- #node_build_id ⇒ Object
- #node_index ⇒ Object
- #node_total ⇒ Object
- #project_dir ⇒ Object
Instance Method Details
#branch ⇒ Object
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_hash ⇒ Object
18 19 20 |
# File 'lib/knapsack_pro/config/ci/snap_ci.rb', line 18 def commit_hash ENV['SNAP_COMMIT'] end |
#node_build_id ⇒ Object
14 15 16 |
# File 'lib/knapsack_pro/config/ci/snap_ci.rb', line 14 def node_build_id ENV['SNAP_PIPELINE_COUNTER'] end |
#node_index ⇒ Object
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_total ⇒ Object
5 6 7 |
# File 'lib/knapsack_pro/config/ci/snap_ci.rb', line 5 def node_total ENV['SNAP_WORKER_TOTAL'] end |
#project_dir ⇒ Object
29 30 31 |
# File 'lib/knapsack_pro/config/ci/snap_ci.rb', line 29 def project_dir ENV['SNAP_WORKING_DIR'] end |