Skip to content

Commit

Permalink
deleted: files/default/node-config.sh
Browse files Browse the repository at this point in the history
	new file:   node.json.erb
	modified:   recipes/node.rb
  • Loading branch information
ya-urtow committed Oct 4, 2013
1 parent 3e0600b commit 390127b
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 92 deletions.
84 changes: 0 additions & 84 deletions files/default/node-config.sh

This file was deleted.

40 changes: 40 additions & 0 deletions node.json.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"capabilities":
[
{
"browserName": "firefox",
"version": "<%= @ffversion %>",
"maxInstances": <%= @ffmaxinstances %>,
"seleniumProtocol": "WebDriver",
"platform": "LINUX"
},
{
"browserName": "opera",
"version": "<%= @operaversion %>",
"maxInstances": <%= @operamaxinstances %>,
"seleniumProtocol": "WebDriver",
"platform": "LINUX"
},
{
"browserName": "chrome",
"version": "<%= @chromeversion %>",
"maxInstances": <%= @chromemaxinstances %>,
"seleniumProtocol": "WebDriver",
"platform": "LINUX"
},
{
"browserName": "htmlunit",
"version": "<%= @htmlunitversion %>",
"maxInstances": <%= @htmlunitmaxinstances %>,
"seleniumProtocol": "WebDriver",
"platform": "LINUX"
},
],
"configuration":
{
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"maxSession": 5,
"register": true,
"registerCycle": 5000
}
}
20 changes: 12 additions & 8 deletions recipes/node.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
include_recipe "selenium::default"
package "xvfb"

cookbook_file "/usr/local/bin/node-config.sh" do
source "node-config.sh"
owner "root"
mode "0755"
end

execute "/usr/local/bin/node-config.sh #{File.join(node['selenium']['server']['confpath'], 'node.json')}" do
action :run
template "/etc/selenium/node.json" do
source "node.json.erb"
mode 0644
variables ({
:ffversion => "#{node['selenium']['firefox']['version']}",
:ffmaxinstances => "#{node['selenium']['firefox']['maxInstances']}",
:operaversion => "#{node['selenium']['opera']['version']}",
:operamaxinstances => "#{node['selenium']['opera']['maxInstances']}",
:chromeversion => "#{node['selenium']['chrome']['version']}",
:chromemaxinstances => "#{node['selenium']['chrome']['maxInstances']}",
:htmlunitversion => "#{node['selenium']['htmlunit']['version']}",
:htmlunitmaxinstances => "#{node['selenium']['htmlunit']['maxInstances']}"})
end

template "/etc/init/selenium-node.conf" do
Expand Down

0 comments on commit 390127b

Please sign in to comment.