Class: Environments::Gitlab

Inherits:
Object
  • Object
show all
Defined in:
lib/flakyci_rspec/environments/gitlab.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.is_gitlab?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/flakyci_rspec/environments/gitlab.rb', line 29

def self.is_gitlab?()
  ENV["CI_COMMIT_SHA"] != nil
end

Instance Method Details

#build_idObject



21
22
23
# File 'lib/flakyci_rspec/environments/gitlab.rb', line 21

def build_id() 
  ENV["CI_PIPELINE_ID"]
end

#build_nameObject



25
26
27
# File 'lib/flakyci_rspec/environments/gitlab.rb', line 25

def build_name() 
  ENV["CI_JOB_NAME"]
end

#get_infosObject



3
4
5
6
7
8
9
10
11
# File 'lib/flakyci_rspec/environments/gitlab.rb', line 3

def get_infos() 
  {
    sha: sha(),
    build_id: build_id(),
    ref: get_ref(),
    build_name: build_name(),
    env_name: "gitlab"
  }
end

#get_refObject



17
18
19
# File 'lib/flakyci_rspec/environments/gitlab.rb', line 17

def get_ref() 
  ENV["CI_COMMIT_REF_NAME"]
end

#shaObject



13
14
15
# File 'lib/flakyci_rspec/environments/gitlab.rb', line 13

def sha() 
  ENV["CI_COMMIT_SHA"]
end