forked from gocd/go-cookbook
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
10 changed files
with
222 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,21 @@ | ||
default['gocd']['install_method'] = 'repository' | ||
default['gocd']['download']['baseurl'] = 'https://download.go.cd' | ||
if node['platform_family'] == 'windows' | ||
default['gocd']['install_method'] = 'package_file' | ||
else | ||
default['gocd']['install_method'] = 'repository' | ||
end | ||
default['gocd']['updates']['baseurl'] = 'https://update.go.cd/channels' | ||
|
||
default['gocd']['repository']['apt']['uri'] = node['gocd']['download']['baseurl'] | ||
default['gocd']['repository']['apt']['uri'] = 'https://download.go.cd' | ||
default['gocd']['repository']['apt']['components'] = [ '/' ] | ||
default['gocd']['repository']['apt']['distribution'] = '' | ||
default['gocd']['repository']['apt']['package_options'] = '' | ||
default['gocd']['repository']['apt']['keyserver'] = 'pgp.mit.edu' | ||
default['gocd']['repository']['apt']['key'] = '0xd8843f288816c449' | ||
|
||
default['gocd']['repository']['yum']['baseurl'] = node['gocd']['download']['baseurl'] | ||
default['gocd']['repository']['yum']['baseurl'] = 'https://download.go.cd' | ||
default['gocd']['repository']['yum']['gpgcheck'] = true | ||
default['gocd']['repository']['yum']['gpgkey'] = 'https://download.go.cd/GOCD-GPG-KEY.asc' | ||
|
||
case node['gocd']['install_method'] | ||
when 'repository' | ||
# version = nil so just pick latest available | ||
else | ||
default['gocd']['version'] = '16.2.1-3027' | ||
end | ||
|
||
version = node['gocd']['version'] | ||
os_dir = nil | ||
|
||
case node['platform_family'] | ||
when 'debian' | ||
default['gocd']['server']['package_file']['filename'] = "go-server-#{version}.deb" | ||
default['gocd']['agent']['package_file']['filename'] = "go-agent-#{version}.deb" | ||
default['gocd']['package_file']['baseurl'] = node['gocd']['download']['baseurl'] | ||
os_dir = 'deb' | ||
when 'rhel', 'fedora' | ||
default['gocd']['server']['package_file']['filename'] = "go-server-#{version}.noarch.rpm" | ||
default['gocd']['agent']['package_file']['filename'] = "go-agent-#{version}.noarch.rpm" | ||
default['gocd']['package_file']['baseurl'] = node['gocd']['download']['baseurl'] | ||
os_dir = 'rpm' | ||
when 'windows' | ||
default['gocd']['server']['package_file']['filename'] = "go-server-#{version}-setup.exe" | ||
default['gocd']['agent']['package_file']['filename'] = "go-agent-#{version}-setup.exe" | ||
default['gocd']['package_file']['baseurl'] = node['gocd']['download']['baseurl'] | ||
os_dir = 'win' | ||
end | ||
|
||
default['gocd']['server']['package_file']['path'] = | ||
File.join(Chef::Config[:file_cache_path], node['gocd']['server']['package_file']['filename']) | ||
default['gocd']['server']['package_file']['url'] = | ||
"#{node['gocd']['package_file']['baseurl']}/binaries/#{version}/#{os_dir}/#{node['gocd']['server']['package_file']['filename']}" | ||
default['gocd']['agent']['package_file']['path'] = | ||
File.join(Chef::Config[:file_cache_path], node['gocd']['agent']['package_file']['filename']) | ||
default['gocd']['agent']['package_file']['url'] = | ||
"#{node['gocd']['package_file']['baseurl']}/binaries/#{version}/#{os_dir}/#{node['gocd']['agent']['package_file']['filename']}" | ||
default['gocd']['package_file']['baseurl'] = nil # official - "https://download.go.cd/binaries" | ||
default['gocd']['agent']['package_file']['url'] = nil # official | ||
default['gocd']['server']['package_file']['url'] = nil # official |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,15 @@ | ||
remote_file node['gocd']['server']['package_file']['filename'] do | ||
path node['gocd']['server']['package_file']['path'] | ||
source node['gocd']['server']['package_file']['url'] | ||
package_path = File.join(Chef::Config[:file_cache_path],go_server_package_name) | ||
|
||
remote_file go_server_package_name do | ||
path package_path | ||
source go_server_package_url | ||
end | ||
|
||
opts = [] | ||
opts << '/S' | ||
opts << '/D=C:\GoServer' | ||
|
||
if defined?(Chef::Provider::Package::Windows) | ||
package 'Go Server' do | ||
source node['gocd']['server']['package_file']['path'] | ||
options opts.join(" ") | ||
end | ||
else | ||
windows_package 'Go Server' do | ||
source node['gocd']['server']['package_file']['path'] | ||
options opts.join(" ") | ||
end | ||
execute "install Go Server" do | ||
command "#{package_path} #{opts.join(' ')}" | ||
creates "C:\\GoServer" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.