Add golang cookbook

Needs updating of ark and git cookbooks
This commit is contained in:
2020-08-23 11:01:05 +02:00
parent 217ab471ce
commit 0005f9ab7d
55 changed files with 670 additions and 716 deletions

View File

@@ -1 +0,0 @@
~FC016

View File

@@ -2,6 +2,27 @@
This file is used to list changes made in each version of the ark cookbook.
## 5.0.0 (2020-01-02)
- Require Chef Infra Client 14+ and remove the need for the build_essential dependency - [@tas50](https://github.com/tas50)
- Use Ruby classes in resource properties - [@tas50](https://github.com/tas50)
- Simplify the platform check logic - [@tas50](https://github.com/tas50)
- Remove the .foocritic file - [@tas50](https://github.com/tas50)
- Remove long_description and recipe metadata - [@tas50](https://github.com/tas50)
- Expand testing - [@tas50](https://github.com/tas50)
- Remove Ubuntu 14.04 testing - [@tas50](https://github.com/tas50)
## 4.0.0 (2018-07-25)
- Support append_env_path property on Windows, which increases the minimum required Chef release to Chef 13.4
## 3.1.1 (2018-07-24)
- Remove ChefSpec matchers since these are autogenerated now
- Update specs to the latest platform versions
- Remove template out of defaults directory
- Remove dependency on the Windows cookbook
## 3.1.0 (2017-05-06)
- Ensure the dependencies get installed on Chef 13 Amazon Linux systems
@@ -12,7 +33,7 @@ This file is used to list changes made in each version of the ark cookbook.
- Rewrite of resource to custom resources.
- Remove EOL platforms from testing.
- Update zlib URL
-
-
## 2.2.1 (2016-12-16)
- Use Ohai root_group attribute to avoid trying to set the group to root on BSD/macOS.
- Add missing accessor for owner property

View File

@@ -1,15 +0,0 @@
<!-- This is a generated file. Please do not edit directly -->
# Maintainers
This file lists how this cookbook project is maintained. When making changes to the system, this file tells you who needs to review your patch - you need a review from an existing maintainer for the cookbook to provide a :+1: on your pull request. Additionally, you need to not receive a veto from a Lieutenant or the Project Lead.
Check out [How Cookbooks are Maintained](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD) for details on the process and how to become a maintainer or the project lead.
# Project Maintainer
* [Tim Smith](https://github.com/tas50)
# Maintainers
* [Jennifer Davis](https://github.com/sigje)
* [Tim Smith](https://github.com/tas50)
* [Thom May](https://github.com/thommay)

View File

@@ -25,7 +25,7 @@ The `ark` resource will:
By default, the ark will not run again if the `:path` is not empty. Ark provides many actions to accommodate different use cases, such as `:dump`, `:cherry_pick`, `:put`, and `:install_with_make`.
At this time ark only handles files available from URLs using the [remote_file](http://docs.chef.io/resource_remote_file.html) provider. It does handle local files using the `file://` protocol.
For remote files ark supports URLs using the [remote_file](http://docs.chef.io/resource_remote_file.html) resource. Local files are accessed with the `file://` syntax.
## Requirements
@@ -36,7 +36,7 @@ At this time ark only handles files available from URLs using the [remote_file](
- Fedora
- FreeBSD
- SmartOS
- Mac OS X
- macOS
- openSUSE / SUSE Linux Enterprises
- Windows
@@ -44,13 +44,11 @@ Should work on common Unix/Linux systems with typical userland utilities like ta
### Chef
- Chef 12.7+
- Chef 14+
### Cookbooks
- build-essential
- seven_zip
- windows
## Attributes
@@ -66,7 +64,7 @@ Customize the attributes to suit site specific conventions and defaults.
## Resources
- `ark` - does the extract/build/configure
- `ark` - does the extract/build/configure
### Actions

View File

@@ -58,7 +58,6 @@ module Ark
new_resource.path = defaults.path
new_resource.release_file = defaults.release_file
end
# rubocop:enable Metrics/AbcSize
def set_put_paths
new_resource.extension = defaults.extension

View File

@@ -1,44 +0,0 @@
if defined?(ChefSpec)
ChefSpec.define_matcher :ark
def install_ark(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:ark, :install, resource_name)
end
def dump_ark(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:ark, :dump, resource_name)
end
def cherry_pick_ark(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:ark, :cherry_pick, resource_name)
end
def put_ark(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:ark, :put, resource_name)
end
def install_with_make_ark(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:ark, :install_with_make, resource_name)
end
def configure_ark(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:ark, :configure, resource_name)
end
def setup_py_build_ark(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:ark, :setup_py_build, resource_name)
end
def setup_py_install_ark(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:ark, :setup_py_install, resource_name)
end
def setup_py_ark(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:ark, :setup_py, resource_name)
end
def unzip_ark(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:ark, :unzip, resource_name)
end
end

View File

@@ -25,9 +25,7 @@ module Ark
end
def sevenzip_command
if resource.strip_components <= 0
return sevenzip_command_builder(resource.path, 'x')
end
return sevenzip_command_builder(resource.path, 'x') if resource.strip_components <= 0
tmpdir = make_temp_directory.tr('/', '\\')
cmd = sevenzip_command_builder(tmpdir, 'x')

File diff suppressed because one or more lines are too long

16
cookbooks/ark/metadata.rb Normal file
View File

@@ -0,0 +1,16 @@
name 'ark'
maintainer 'Chef Software, Inc.'
maintainer_email 'cookbooks@chef.io'
license 'Apache-2.0'
description 'Provides a custom resource for installing runtime artifacts in a predictable fashion'
version '5.0.0'
%w(ubuntu debian redhat centos suse opensuse opensuseleap scientific oracle amazon windows mac_os_x smartos freebsd).each do |os|
supports os
end
depends 'seven_zip' # for windows os
source_url 'https://github.com/chef-cookbooks/ark'
issues_url 'https://github.com/chef-cookbooks/ark/issues'
chef_version '>= 14.0'

View File

@@ -18,6 +18,6 @@
# limitations under the License.
#
package node['ark']['package_dependencies'] unless %w(windows mac_os_x).include?(node['platform_family'])
package node['ark']['package_dependencies'] unless platform_family?('windows', 'mac_os_x')
include_recipe 'seven_zip' if node['platform_family'] == 'windows'
include_recipe 'seven_zip' if platform_family?('windows')

View File

@@ -83,8 +83,16 @@ action :install do
action :nothing
end
# usually on windows there is no central directory with executables where the applications are linked
unless node['platform_family'] == 'windows'
if platform_family?('windows')
# usually on windows there is no central directory with executables where the applications are linked
# so ignore has_binaries for now
# Add to PATH permanently on Windows if append_env_path
windows_path "#{new_resource.path}/bin" do
action :add
only_if { new_resource.append_env_path }
end
else
# symlink binaries
new_resource.has_binaries.each do |bin|
link ::File.join(new_resource.prefix_bin, ::File.basename(bin)) do