module Polisher::KojiBuilder::ClassMethods

Public Instance Methods

build(args = {}) click to toggle source

Run a build against the specified target using the specified rpm

# File lib/polisher/targets/koji/builder.rb, line 14
def build(args = {})
  require 'awesome_spawn'
  require_cmd! build_cmd

  target  = args[:target] || build_tgt
  srpm    = args[:srpm]
  scratch = args[:scratch] ? '--scratch' : ''

  cmd = "#{build_cmd} build #{scratch} #{target} #{srpm}"
  result = AwesomeSpawn.run(cmd)
  url = parse_url(result.output)
  raise url if result.exit_status != 0
  url
end
parse_url(output) click to toggle source

Parse a koji build url from output

# File lib/polisher/targets/koji/builder.rb, line 30
def parse_url(output)
  task_info = output.lines.detect { |l| l =~ /Task info:.*/ }
  task_info ? task_info.split.last : ''
end