No commit activity in last 3 years
No release in over 3 years
Itamae plugin to install golang with goenv
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

>= 1.7
>= 10.0

Runtime

>= 1.2
 Project Readme

Itamae::Plugin::Recipe::Goenv

Itamae plugin to install golang with goenv

Installation

Add this line to your application's Gemfile:

gem 'itamae-plugin-recipe-goenv'

And then execute:

$ bundle

Or install it yourself as:

$ gem install itamae-plugin-recipe-goenv

Usage

System wide installation

Install goenv to /usr/local/goenv or some shared path

Recipe

# your recipe
include_recipe "goenv::system"

Node

Use this with itamae -y node.yml

# node.yml
goenv:
  global:
    1.7.4
  versions:
    - 1.7.4
    - 1.6.3
    - 1.5.4

  # goenv install dir, optional (default: /usr/local/goenv)
  goenv_root: "/path/to/goenv"

  # specify scheme to use in git clone, optional (default: git)
  scheme: https

  # Create /usr/local/goenv/cache, optional (default: false)
  # See: https://github.com/syndbg/goenv/tree/bae243f3771731897aafb152126976653cb8213c/plugins/go-build#package-download-caching
  cache: true

.bashrc

Recommend to append this to .bashrc in your server.

export GOENV_ROOT=/usr/local/goenv
export PATH="${GOENV_ROOT}/bin:${PATH}"
eval "$(goenv init -)"

Installation for a user

Install goenv to ~#{node[:goenv][:user]}/.goenv

Recipe

# your recipe
include_recipe "goenv::user"

Node

Use this with itamae -y node.yml

# node.yml
goenv:
  user: civitaspo
  global:
    1.7.4
  versions:
    - 1.7.4
    - 1.6.3
    - 1.5.4

  # specify scheme to use in git clone, optional (default: git)
  scheme: https

  # Create ~/.goenv/cache, optional (default: false)
  # See: https://github.com/syndbg/goenv/tree/bae243f3771731897aafb152126976653cb8213c/plugins/go-build#package-download-caching
  cache: true

Example

$ cd example
$ vagrant up
$ bundle exec itamae ssh --vagrant -y node.yml recipe.rb

MItamae

This plugin can be used for MItamae too. Put this repository under ./plugins as git submodule.

node.reverse_merge!(
  goenv: {
    user: 'civitaspo',
    global: '1.7.4',
    versions: %w[
      1.7.4
      1.6.3
      1.5.4
    ],
  }
)

include_recipe "goenv::user"

License

MIT License