Skip to content

Commit

Permalink
moved configuration of hudson_slave into attributes/default.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
drnic committed Oct 28, 2010
1 parent 8d3d26b commit 5ae4113
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
4 changes: 3 additions & 1 deletion Gemfile.lock
Expand Up @@ -34,6 +34,7 @@ GEM
erubis (2.6.6)
abstract (>= 1.0.0)
i18n (0.4.2)
kgio (1.3.1)
mail (2.2.9)
activesupport (>= 2.3.6)
i18n (~> 0.4.1)
Expand Down Expand Up @@ -65,7 +66,8 @@ GEM
treetop (1.4.8)
polyglot (>= 0.3.1)
tzinfo (0.3.23)
unicorn (1.1.4)
unicorn (2.0.0)
kgio (~> 1.3.1)
rack

PLATFORMS
Expand Down
10 changes: 10 additions & 0 deletions cookbooks/hudson_master/attributes/default.rb
@@ -0,0 +1,10 @@
hudson({
:master => {
:host => "ec2-174-129-24-134.compute-1.amazonaws.com",
:port => 80
},
:gem => {
:install => "hudson --pre",
:version => "hudson-0.3.0.beta.9"
}
})
8 changes: 1 addition & 7 deletions cookbooks/hudson_slave/recipes/default.rb
Expand Up @@ -11,13 +11,6 @@
# * Only add the slaves and nodes if they aren't already on the master

# Config - move to attributes
node[:hudson] ||= Hash.new
node[:hudson][:master] ||= Hash.new
node[:hudson][:master][:host] = "ec2-174-129-24-134.compute-1.amazonaws.com"
node[:hudson][:master][:port] = 80
node[:hudson][:gem] ||= Hash.new
node[:hudson][:gem][:install] = "hudson --pre"
node[:hudson][:gem][:version] = "hudson-0.3.0.beta.6"

env_name = node[:environment][:name]

Expand Down Expand Up @@ -74,6 +67,7 @@
if Hudson::Api.create_job(app_name, job_config, :override => true)
build_url = "#{Hudson::Api.base_uri}/job/#{app_name}/build"
node[:hudson][:applications] << { :name => app_name, :success => true, :build_url => build_url }
Hudson::Api.build_job(app_name)
else
node[:hudson][:applications] << { :name => app_name, :success => false }
end
Expand Down

0 comments on commit 5ae4113

Please sign in to comment.