Class: Codescout::Runner::Build

Inherits:
Object
  • Object
show all
Defined in:
lib/codescout/runner/build.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(service_url, push_token) ⇒ Build

Returns a new instance of Build.



6
7
8
9
10
11
12
# File 'lib/codescout/runner/build.rb', line 6

def initialize(service_url, push_token)
  @shell       = Codescout::Runner::Shell.new
  @client      = Codescout::Runner::Client.new(service_url)
  @push_token  = push_token
  @clone_path  = "/tmp/#{@push_token}"
  @output_path = "#{@clone_path}/codescout.json"
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



3
4
5
# File 'lib/codescout/runner/build.rb', line 3

def client
  @client
end

#clone_pathObject (readonly)

Returns the value of attribute clone_path.



4
5
6
# File 'lib/codescout/runner/build.rb', line 4

def clone_path
  @clone_path
end

#output_pathObject (readonly)

Returns the value of attribute output_path.



4
5
6
# File 'lib/codescout/runner/build.rb', line 4

def output_path
  @output_path
end

#pushObject (readonly)

Returns the value of attribute push.



3
4
5
# File 'lib/codescout/runner/build.rb', line 3

def push
  @push
end

#push_tokenObject (readonly)

Returns the value of attribute push_token.



3
4
5
# File 'lib/codescout/runner/build.rb', line 3

def push_token
  @push_token
end

Instance Method Details

#runObject



14
15
16
17
18
19
20
21
22
# File 'lib/codescout/runner/build.rb', line 14

def run
  cleanup
  fetch_push
  setup_ssh_keys
  clone_repository
  checkout_commit
  generate_report
  submit_report
end