lib/jenkins/builder/app.rb in jenkins-builder-0.1.0 vs lib/jenkins/builder/app.rb in jenkins-builder-0.1.1

- old
+ new

@@ -54,13 +54,13 @@ INFO puts "Password: #{@secret.password}" if options[:password] end - def create_alias(name, job) + def create_alias(name, command) @config.aliases ||= {} - @config.aliases[name] = job + @config.aliases[name] = command @config.save! end def delete_alias(name) if @config.aliases.nil? || @config.aliases.empty? @@ -70,15 +70,21 @@ @config.aliases.delete(name) @config.save! end def list_aliases - p @config.aliases + @config.aliases.each do |k, v| + puts "`%s' is alias for `%s'" % [k, v] + end end def build_each(jobs) - jobs.each { |job| build(job) } + if @options[:failfast] + jobs.find { |job| build(job).nil? } + else + jobs.each { |job| build(job) } + end end def build(job) job_name, branch = job.split(':') latest_build_no = @client.job.get_current_build_number(job_name) @@ -140,9 +146,11 @@ if msg =~ /SUCCESS/ puts pastel.green.bold(msg) else puts pastel.red.bold(msg) end + + msg =~ /SUCCESS/ end private def validate_os!