Class: Environments::Codeship

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.is_codeship?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/flakyci_rspec/environments/codeship.rb', line 30

def self.is_codeship?()
  ENV["CI_NAME"] == "codeship"
end

Instance Method Details

#build_idObject



22
23
24
# File 'lib/flakyci_rspec/environments/codeship.rb', line 22

def build_id() 
  ENV["CI_BUILD_NUMBER"]
end

#build_nameObject



26
27
28
# File 'lib/flakyci_rspec/environments/codeship.rb', line 26

def build_name() 
  ENV["CI_NAME"]
end

#get_infosObject



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

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

#get_refObject



18
19
20
# File 'lib/flakyci_rspec/environments/codeship.rb', line 18

def get_ref() 
  ENV["CI_BRANCH"]
end

#shaObject



14
15
16
# File 'lib/flakyci_rspec/environments/codeship.rb', line 14

def sha() 
  ENV["CI_COMMIT_ID"]
end