Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Improve the Kraken! #2

Merged
merged 4 commits into from

2 participants

Michael Kohl Andreas Tiefenthaler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 11, 2012
  1. Michael Kohl

    Clean up

    citizen428 authored
Commits on Jul 12, 2012
  1. Michael Kohl
  2. Michael Kohl

    Fix dependencies

    citizen428 authored
  3. Michael Kohl

    Fix flapping spec

    citizen428 authored
This page is out of date. Refresh to see the latest.
4 kraken-build.gemspec
View
@@ -17,9 +17,7 @@ Gem::Specification.new do |gem|
gem.add_development_dependency "rspec"
- gem.add_dependency "rake"
+ gem.add_development_dependency "rake"
gem.add_dependency "httparty"
- gem.add_dependency "nokogiri"
# Other attributes omitted
-
end
9 lib/kraken-build.rb
View
@@ -6,13 +6,10 @@
require "kraken-build/jenkins-api.rb"
require "kraken-build/github-api.rb"
-
-
module KrakenBuild
-
def self.set_config(options = {})
@config = options
- @repository = options[:repository]
+ @repository = @config[:repository]
@github = GithubApi.new(@config)
@jenkins = JenkinsApi.new(@config)
@jobs = []
@@ -22,7 +19,7 @@ def self.set_config(options = {})
end
def self.get_jenkins_branches
- @jenkins.get_jobs.map{ |job| job =~ /^#{@repository}\.(.*)$/ && $1 }.compact
+ @jenkins.get_jobs.map { |job| job =~ /^#{@repository}\.(.*)$/ && $1 }.compact
end
def self.get_github_branches
@@ -41,14 +38,12 @@ def self.run
@jenkins.build_job(job_name)
end
-
remove = compute_jobs_to_remove
remove.map do |job|
job_name = "#{@repository}.#{job}"
puts "removing => #{job_name}"
@jenkins.remove_job(job_name)
end
-
end
def self.compute_jobs_to_create
14 spec/lib/jenkins_api_spec.rb
View
@@ -4,15 +4,11 @@
context "configurations" do
before(:each) do
- api = JenkinsApi.new
+ JenkinsApi.instance_variable_set(:@default_options, {})
end
- it "uses no basic_auth when username and password are not prived" do
- pending("flapping")
- asd = {:user_name => nil, :password =>"nil"}
- api = asd
- api = JenkinsApi.new(asd)
-
+ it "uses no basic_auth when username and password are not prived" do
+ api = JenkinsApi.new
api.class.default_options[:basic_auth].should be(nil)
end
@@ -20,8 +16,8 @@
options = {:username => 'user', :password => 'password'}
api = JenkinsApi.new(options)
- api.class.default_options[:basic_auth][:username] == options[:username].should
- api.class.default_options[:basic_auth][:password] == options[:password].should
+ api.class.default_options[:basic_auth][:username].should == options[:username]
+ api.class.default_options[:basic_auth][:password].should == options[:password]
end
it "uses a port when provided" do
Something went wrong with that request. Please try again.