Class: Environments::Local

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

Instance Method Summary collapse

Instance Method Details

#build_idObject



23
24
25
# File 'lib/flakyci_rspec/environments/local.rb', line 23

def build_id
  Time.now.to_i.to_s
end

#build_nameObject



27
28
29
# File 'lib/flakyci_rspec/environments/local.rb', line 27

def build_name
  'local'
end

#get_infosObject



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

def get_infos
  {
    sha: sha,
    build_id: build_id,
    ref: get_ref,
    build_name: build_name,
    env_name: 'local'
  }
end

#get_refObject



19
20
21
# File 'lib/flakyci_rspec/environments/local.rb', line 19

def get_ref
  `git rev-parse --abbrev-ref HEAD`.strip!
end

#shaObject



15
16
17
# File 'lib/flakyci_rspec/environments/local.rb', line 15

def sha
  `git rev-parse --short HEAD`.strip!
end