Class: KnapsackPro::Config::CI::GitlabCI
- Defined in:
- lib/knapsack_pro/config/ci/gitlab_ci.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
29 30 31 32 |
# File 'lib/knapsack_pro/config/ci/gitlab_ci.rb', line 29 def branch ENV['CI_COMMIT_REF_NAME'] || # Gitlab Release 9.0+ ENV['CI_BUILD_REF_NAME'] # Gitlab Release 8.x end |
#ci_provider ⇒ Object
51 52 53 |
# File 'lib/knapsack_pro/config/ci/gitlab_ci.rb', line 51 def ci_provider "Gitlab CI" end |
#commit_hash ⇒ Object
24 25 26 27 |
# File 'lib/knapsack_pro/config/ci/gitlab_ci.rb', line 24 def commit_hash ENV['CI_COMMIT_SHA'] || # Gitlab Release 9.0+ ENV['CI_BUILD_REF'] # Gitlab Release 8.x end |
#detected ⇒ Object
43 44 45 |
# File 'lib/knapsack_pro/config/ci/gitlab_ci.rb', line 43 def detected ENV.key?('GITLAB_CI') ? self.class : nil end |
#fixed_queue_split ⇒ Object
47 48 49 |
# File 'lib/knapsack_pro/config/ci/gitlab_ci.rb', line 47 def fixed_queue_split true end |
#node_build_id ⇒ Object
19 20 21 22 |
# File 'lib/knapsack_pro/config/ci/gitlab_ci.rb', line 19 def node_build_id ENV['CI_PIPELINE_ID'] || # Gitlab Release 9.0+ ENV['CI_BUILD_ID'] # Gitlab Release 8.x end |
#node_index ⇒ Object
12 13 14 15 16 17 |
# File 'lib/knapsack_pro/config/ci/gitlab_ci.rb', line 12 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
8 9 10 |
# File 'lib/knapsack_pro/config/ci/gitlab_ci.rb', line 8 def node_total ENV['CI_NODE_TOTAL'] end |
#project_dir ⇒ Object
34 35 36 |
# File 'lib/knapsack_pro/config/ci/gitlab_ci.rb', line 34 def project_dir ENV['CI_PROJECT_DIR'] end |
#user_seat ⇒ Object
38 39 40 41 |
# File 'lib/knapsack_pro/config/ci/gitlab_ci.rb', line 38 def user_seat ENV['GITLAB_USER_NAME'] || # Gitlab Release 10.0 ENV['GITLAB_USER_EMAIL'] # Gitlab Release 8.12 end |