Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
source_url 'https://github.com/cvent/proget-cookbook'
issues_url 'https://github.com/cvent/proget-cookbook/issues'
version '0.2.0'
version '0.2.1'

supports 'windows'

depends 'iis'
depends 'windows'

chef_version '>= 12.6.0' if respond_to?(:chef_version)
license 'Apache-2.0'
16 changes: 8 additions & 8 deletions resources/server.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

property :name, String, name_property: true
property :resource_name, String, name_property: true
property :version, String, required: true
property :package_version, String, default: lazy { strip_patch_version(version) }
property :checksum, String
Expand Down Expand Up @@ -58,23 +58,23 @@
package_cache_dir = Chef::FileCache.create_cache_path('package')
package 'ProGet' do # ~FC009
action :install
source proget_url(install_sql_express, package_version)
source proget_url(new_resource.install_sql_express, new_resource.package_version)
checksum new_resource.checksum if new_resource.checksum
remote_file_attributes name: ::File.join(package_cache_dir, "proget-#{package_version}.exe")
remote_file_attributes name: ::File.join(package_cache_dir, "proget-#{new_resource.package_version}.exe")
version new_resource.version
installer_type :custom
options args.join(' ')
notifies :run, "ruby_block[#{new_resource.name} install failure]", :immediately
notifies :run, "ruby_block[wait for #{new_resource.name}]", :immediately
notifies :run, "ruby_block[#{new_resource.resource_name} install failure]", :immediately
notifies :run, "ruby_block[wait for #{new_resource.resource_name}]", :immediately
end if args

ruby_block "#{new_resource.name} install failure" do
ruby_block "#{new_resource.resource_name} install failure" do
action :nothing
block { raise 'Installation of Proget failed' }
not_if { current_version == new_resource.version }
end

ruby_block "wait for #{new_resource.name}" do
ruby_block "wait for #{new_resource.resource_name}" do
action :nothing
block do
require 'net/http'
Expand All @@ -88,7 +88,7 @@
end

until test_server.call
Chef::Log.info "Waiting for #{new_resource.name} to be up"
Chef::Log.info "Waiting for #{new_resource.resource_name} to be up"
sleep 2
end
end
Expand Down