Code Monkey home page Code Monkey logo

golang's Introduction

Golang (Go) Cookbook

Cookbook Version CI State OpenCollective OpenCollective License

Description

Chef cookbook for the Go programming language.

Requirements

Platform

  • Ubuntu >= 18.04
  • Debian >= 8
  • CentOS >= 7

Usage

golang::default

Include golang in your node's run_list:

{
  "name":"my_node",
  "run_list": [
    "recipe[golang]"
  ]
}

golang::packages

To install Go packages using node attributes add the packages to the ['golang']['packages'] attribute:

{
  "name":"my_node",
  "golang": {
    "packages": [
      "github.com/go-check/check"
    ]
  },
  "run_list": [
    "recipe[golang]"
  ]
}

Contributors

This project exists thanks to all the people who contribute.

Backers

Thank you to all our backers!

https://opencollective.com/sous-chefs#backers

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website.

https://opencollective.com/sous-chefs/sponsor/0/website https://opencollective.com/sous-chefs/sponsor/1/website https://opencollective.com/sous-chefs/sponsor/2/website https://opencollective.com/sous-chefs/sponsor/3/website https://opencollective.com/sous-chefs/sponsor/4/website https://opencollective.com/sous-chefs/sponsor/5/website https://opencollective.com/sous-chefs/sponsor/6/website https://opencollective.com/sous-chefs/sponsor/7/website https://opencollective.com/sous-chefs/sponsor/8/website https://opencollective.com/sous-chefs/sponsor/9/website

golang's People

Contributors

axelrtgs avatar buth avatar craftzdog avatar crowdmatt avatar damacus avatar detjensrobert avatar grimm26 avatar iramello avatar jdstuart avatar jeffbyrnes avatar kitchen-porter avatar leejones avatar markgibbons avatar martinbohman avatar mburns avatar melekes avatar namtzigla avatar ngerakines avatar nox73 avatar petere avatar pseudomuto avatar ramereth avatar remh avatar renovate[bot] avatar rollbrettler avatar rottenbytes avatar sliim avatar spion06 avatar xorima avatar xorimabot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

golang's Issues

create /var/chef/cache directory if missing

When running vagrant provision with the chef-golang recipe, it complains that the /var/chef/cache directory does not exist:

[2013-09-14T21:22:44+00:00] FATAL: Chef::Exceptions::EnclosingDirectoryDoesNotExist: remote_file[/var/chef/cache/go1.0.3.linux-amd64.tar.gz] (golang::install line 14) had an error: Chef::Exceptions::EnclosingDirectoryDoesNotExist: Parent directory /var/chef/cache does not exist.

Here's the longer stacktrace:

Generated at Sat Sep 14 21:30:13 +0000 2013
Chef::Exceptions::EnclosingDirectoryDoesNotExist: remote_file[/var/chef/cache/go1.0.3.linux-amd64.tar.gz] (golang::install line 13) had an error: Chef::Exceptions::EnclosingDirectoryDoesNotExist: Parent directory /var/chef/cache does not exist.
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/mixin/why_run.rb:248:in `run'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/mixin/why_run.rb:329:in `run'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/mixin/why_run.rb:328:in `each'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/mixin/why_run.rb:328:in `run'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider.rb:132:in `process_resource_requirements'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider.rb:109:in `run_action'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource.rb:593:in `run_action'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/runner.rb:49:in `run_action'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/runner.rb:81:in `converge'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/runner.rb:81:in `each'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/runner.rb:81:in `converge'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection.rb:94:in `execute_each_resource'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection.rb:92:in `execute_each_resource'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/runner.rb:80:in `converge'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/client.rb:378:in `converge'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/client.rb:420:in `do_run'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/client.rb:176:in `run'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/application/solo.rb:230:in `run_application'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/application/solo.rb:218:in `loop'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/application/solo.rb:218:in `run_application'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/application.rb:70:in `run'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/chef-solo:25
/opt/vagrant_ruby/bin/chef-solo:19:in `load'

Go version is old

Is there a plan to upgrade to 1.2.2? If yes, should I help ? If no, what's the reason :)?

node['golang']['scm'] not passed to golang resource

๐Ÿ‘ป Brief Description

There's an attribute for node['golang']['scm'] but setting it to false does not result in git and mercurial being installed.

๐Ÿฅž Cookbook version

4.1.0

๐Ÿ‘ฉโ€๐Ÿณ Chef-Infra Version

15.15.0

๐ŸŽฉ Platform details

Operating system distribution and release version. Cloud provider if running in the cloud.

Steps To Reproduce

Steps to reproduce the behavior:

node.default['golang']['scm'] = false
include_recipe 'golang'

๐Ÿš“ Expected behavior

Git and Mercurial are not installed.

Thanks folks!

Deprecate Recipes

๐Ÿ—ฃ๏ธ Foreword

Thank for taking the time to fill this feature request fully. Without it we may not be able to , and the issue may be closed without resolution.

๐Ÿ™ Problem Statement

Application & system cookbooks, should follow the Sous-Chefs standards and use custom resources, and library helpers to install and configure software. This cookbook still uses attributes and recipes.

โ” Possible Solution

  1. Introduce custom resources that are wrapped by the current recipes.
  2. Add a warning to the recipes to use the custom resources directly
  3. Deprecate/remove the current recipes

โคด๏ธ Describe alternatives you've considered

Leave it as it is.

โž• Additional context

Add any other context about the problem here. e.g. related issues or existing pull requests.

Vagrant Repo/Directory Name

There's not much you can do about this besides changing the meta name to chef-golang... but.. If the meta name does not match the directory name while using Vagrant, Chef complains that the template file does not exist in template/default/golang.sh.erb (it looks in /golang/templates/default/ for some reason)

This can be easily fixed by simply renaming the directory after cloning, but it's an annoying bug to have to troubleshoot and I bet I'm not the only one who's had to do so. Perhaps adding a warning in the README would suffice.

Setup for Sous-Chefs

Cookbook needs setting up for sous

  • metadata
  • terraform (admin)
  • standard files (bot)
  • cookstyle (bot)
  • labels standardise (bot)
  • github actions
  • circleci (admin)
  • rebase the files used

Chef 17 support

๐Ÿ—ฃ๏ธ Foreword

Thank for taking the time to fill this feature request fully. Without it we may not be able to , and the issue may be closed without resolution.

:person_frowning: Problem Statement

Currently has depends 'ark', '~> 5.0'
Ark has updates in 6.0 to support Chef 17
Request is to support Chef 17

โ” Possible Solution

Allow ark 6.x

โคด๏ธ Describe alternatives you've considered

n/a

โž• Additional context

n/a

Supermarket versions

golang on Supermarket has only versions upto 1.7.0.
chef-golang on Supermarket is even older at 1.0.1 (2013)

I was wondering if it's possible to push v3 that's currently the latest on this repo to Supermarket and if it already is, where is it?

Thanks!!!

Go 1.2rc5 not updated to 1.2

I used this cookbook to install Go 1.2rc5 by overriding the necessary attributes. Now I changed these attributes to update to Go 1.2, but the update did not happen.

I think the problem is the not_if attribute of the remote_file resource in the default recipe. It is not very exact, so version 1.2 also matches 1.2rc5 and the new archive will not be downloaded.

go 1.1.2 not updated to 1.2

this is due to matching against

 not_if "#{node['go']['install_dir']}/go/bin/go version | grep #{node['go']['version']}"

Add a test to verify that the install_dir property of the default resource actually works.

๐Ÿ—ฃ๏ธ Foreword

Thank for taking the time to fill this feature request fully. Without it we may not be able to , and the issue may be closed without resolution.

:person_frowning: Problem Statement

We are missing a test for the install_dir property of the default resource.

โ” Possible Solution

A clear and concise description of what you want to happen.

โคด๏ธ Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

โž• Additional context

Add any other context about the problem here. e.g. related issues or existing pull requests.

source_url not backwards compatible

This commit f3a80b5 is not backwards compatible with Chef 11.10. The following happens:

Fetching 'golang' from https://github.com/NOX73/chef-golang.git (at master)
STDERR: The following error occurred while reading the cookbook `golang':
Ridley::Errors::FromFileParserError: Could not parse `/tmp/d20161006-11381-rcpqw8/metadata.rb': undefined method `source_url' for #<Ridley::Chef::Cookbook::Metadata:0x007f8acd0f1798>

Issues on other repos regarding this:
chef/chef#2937
https://github.com/agileorbit-cookbooks/java/issues/240

setting owner and group to non-root makes golang::packages fail

golang::packages tries to cache the package in the chef client cache directory, which is only writable by root:

      Recipe: golang::packages
         * golang_package[github.com/etsy/hound/cmds/...] action install
           * bash[Installing package github.com/etsy/hound/cmds/...] action run

             ================================================================================
             Error executing action `run` on resource 'bash[Installing package github.com/etsy/hound/cmds/...]'
             ================================================================================

             Mixlib::ShellOut::ShellCommandFailed
             ------------------------------------
             Expected process to exit with [0], but received '141'
             ---- Begin output of "bash"  "/tmp/chef-script20160620-579-420w5l" ----
             STDOUT:
             STDERR: /tmp/chef-script20160620-579-420w5l: line 1: /tmp/kitchen/cache/github.com-etsy-hound-cmds-...: Permission denied
             ---- End output of "bash"  "/tmp/chef-script20160620-579-420w5l" ----
             Ran "bash"  "/tmp/chef-script20160620-579-420w5l" returned 141

             Cookbook Trace:
             ---------------
             /tmp/kitchen/cache/cookbooks/golang/providers/package.rb:14:in `block in class_from_file'

             Resource Declaration:
             ---------------------
             # In /tmp/kitchen/cache/cookbooks/golang/providers/package.rb

        5:   bash "Installing package #{new_resource.name}" do
        6:     code "#{node['go']['install_dir']}/go/bin/go get -v #{new_resource.name} 2> >(grep -v '(download)$' > #{tmp_file_path})"
....

The cache file needs to be created with the correct ownership.

HTML formatting on Supermarket

The README.md includes HTML formatting which is being displayed on the Supermarket.

Fix this by using only markdown in the README file. Are there other places where you require this HTML formatting?

golang_cookbook_-_chef_supermarket

Cannot install a package at a certain tag

๐Ÿ‘ป Brief Description

when I specify a package @ a tag, it complains " go: cannot use path@version syntax in GOPATH mode"

๐Ÿฅž Cookbook version

v3.0.1

๐Ÿ‘ฉโ€๐Ÿณ Chef-Infra Version

13.10.0

๐ŸŽฉ Platform details

ubuntu 18.04

Steps To Reproduce

Steps to reproduce the behavior:

  1. put something like 'github.com/etsy/hound/cmds/[email protected]' into node.default['golang']['packages']
  2. run the cookbook.

๐Ÿš“ Expected behavior

get, build, install the binary

โž• Additional context

Add any other context about the problem here. e.g. related issues or existing pull requests.

Readme

Old repo and attributes names (golang vs. chef-golang) in Readme

Packages installation not working starting golang 1.18

๐Ÿ—ฃ๏ธ Foreword

๐Ÿ‘ป Brief Description

When using the go 1.18 version, the package installation is no longer working because packages cannot be installed globally using go get leading to this error message:

         go: go.mod file not found in current directory or any parent directory.
    	'go get' is no longer supported outside a module.
    	To build and install a command, use 'go install' with a version,
    	like 'go install example.com/cmd@latest'
    	For more information, see https://golang.org/doc/go-get-install-deprecation
    	or run 'go help get' or 'go help install'.

๐Ÿฅž Cookbook version

version is 5.3.2 but this will fail in any version

๐Ÿ‘ฉโ€๐Ÿณ Chef-Infra Version

chef version is 17.9.46 but this is not related.

๐ŸŽฉ Platform details

Operating system distribution and release version. Cloud provider if running in the cloud.

Steps To Reproduce

Steps to reproduce the behavior:

with a recipe using this cookbook:

  • specify go 1.18 or above (in my case 1.18.1)
  • specify a package to be installed using the node_attributes (in my case golangcilint)
  • run chef on the instance and see the error message

๐Ÿš“ Expected behavior

I expect the package that I specified in node attributes being installed globally without failure

โž• Additional context

I'm trying to make a pr to fix this issue, however I'm kind of a noob in ruby/chef so I might have questions :)

Update supermarket source url

๐Ÿ—ฃ๏ธ Foreword

https://supermarket.chef.io/cookbooks/golang -> View Source goes to https://github.com/NOX73/golang

๐Ÿ‘ป Brief Description

https://github.com/NOX73/golang is gone

๐Ÿฅž Cookbook version

3.0.0

Steps To Reproduce

Steps to reproduce the behavior:

  1. Go to https://supermarket.chef.io/cookbooks/golang
  2. Click on View Source
  3. 404 not found

๐Ÿš“ Expected behavior

Going to https://github.com/sous-chefs/golang

โž• Additional context

Looking at the changelog, it seems the repo from NOX73 was first renamed to chef-golang

Now that the metadata is up to date in v3.0.0, could you reset / update the source_url used by https://supermarket.chef.io/cookbooks/golang ?

Thanks

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • sous-chefs/.github 3.1.1
  • actions/checkout v4
  • actionshub/chef-install 3.0.0
  • actionshub/test-kitchen 3.0.0
.github/workflows/stale.yml
  • actions/stale v9

  • Check this box to trigger a request for Renovate to run again on this repository

Add Github contributor

Hi, I'd like to help maintain this cookbook and merge pending PRs. I've started using this at work and would rather maintain my fixes in a canonical place and not maintain a fork.

@NOX73 thoughts?

  • Github collaborator
  • Supermarket collaborator (?) to upload new releases

Cheers!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.