Skip to content

Commit

Permalink
Merge pull request #13 from enxebre/defaul-url
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Hoblitt committed May 31, 2014
2 parents d43f99c + 51e71cb commit c500ad7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 3 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@
ensure => present,
}

$jar_name = "selenium-server-standalone-${version}.jar"
$jar_name = "selenium-server-standalone-${version}.jar"
$path_version = regsubst($version, '^(\d+\.\d+)\.\d+$', '\1')

if $url {
$jar_url = $url
} else {
$jar_url = "https://selenium.googlecode.com/files/${jar_name}"
$jar_url = "https://selenium-release.storage.googleapis.com/${path_version}/${jar_name}"
}

File {
Expand Down
8 changes: 7 additions & 1 deletion spec/classes/selenium_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
p.merge!(params)
end

# The new download URL has the major.minor version as a path component but
# excludes the .patch. Eg.
# https://selenium-release.storage.googleapis.com/<major>.<minor>/selenium-server-standalone-<major>.<minor>.<patch>.jar

path_version = p[:version].match(/^(\d+\.\d+)\./)[1]

it do
should contain_user(p[:user]).with_gid(p[:group])
should contain_group(p[:group])
Expand Down Expand Up @@ -46,7 +52,7 @@
'target' => "#{p[:install_root]}/log",
})
should contain_wget__fetch('selenium-server-standalone').with({
'source' => "https://selenium.googlecode.com/files/selenium-server-standalone-#{p[:version]}.jar",
'source' => "https://selenium-release.storage.googleapis.com/#{path_version}/selenium-server-standalone-#{p[:version]}.jar",
'destination' => "#{p[:install_root]}/jars/selenium-server-standalone-#{p[:version]}.jar",
'timeout' => p[:download_timeout],
'execuser' => p[:user],
Expand Down

0 comments on commit c500ad7

Please sign in to comment.