Class: KnapsackPro::Config::CI::GitlabCI
- Defined in:
- lib/knapsack_pro/config/ci/gitlab_ci.rb
Instance Method Summary collapse
- #branch ⇒ Object
- #commit_hash ⇒ 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
27 28 29 30 |
# File 'lib/knapsack_pro/config/ci/gitlab_ci.rb', line 27 def branch ENV['CI_COMMIT_REF_NAME'] || # Gitlab Release 9.0+ ENV['CI_BUILD_REF_NAME'] # Gitlab Release 8.x end |
#commit_hash ⇒ Object
22 23 24 25 |
# File 'lib/knapsack_pro/config/ci/gitlab_ci.rb', line 22 def commit_hash ENV['CI_COMMIT_SHA'] || # Gitlab Release 9.0+ ENV['CI_BUILD_REF'] # Gitlab Release 8.x end |
#node_build_id ⇒ Object
17 18 19 20 |
# File 'lib/knapsack_pro/config/ci/gitlab_ci.rb', line 17 def node_build_id ENV['CI_PIPELINE_ID'] || # Gitlab Release 9.0+ ENV['CI_BUILD_ID'] # Gitlab Release 8.x end |
#node_index ⇒ Object
10 11 12 13 14 15 |
# File 'lib/knapsack_pro/config/ci/gitlab_ci.rb', line 10 def node_index return unless ENV['GITLAB_CI'] # GitLab 11.5 index = ENV['CI_NODE_INDEX'] index.to_i - 1 if index end |
#node_total ⇒ Object
6 7 8 |
# File 'lib/knapsack_pro/config/ci/gitlab_ci.rb', line 6 def node_total ENV['CI_NODE_TOTAL'] end |
#project_dir ⇒ Object
32 33 34 |
# File 'lib/knapsack_pro/config/ci/gitlab_ci.rb', line 32 def project_dir ENV['CI_PROJECT_DIR'] end |
#user_seat ⇒ Object
36 37 38 39 |
# File 'lib/knapsack_pro/config/ci/gitlab_ci.rb', line 36 def user_seat ENV['GITLAB_USER_NAME'] || # Gitlab Release 10.0 ENV['GITLAB_USER_EMAIL'] # Gitlab Release 8.12 end |