promisedlandt / asdf

Chef cookbook for asdf version manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

asdf Cookbook

Cookbook Version Build Status

Installs and configures asdf extendable version manager.

Requirements

  • Chef 14.3+

Platforms

The following platforms are supported and tested with Test Kitchen:

  • Amazon Linux 2+
  • CentOS 7+
  • Debian 8+
  • Fedora 27+
  • Ubuntu 16.04+

Other Debian and RHEL family distributions are assumed to work.

Dependencies

  • ark

Usage

Place a dependency on the asdf cookbook in your cookbook's metadata.rb

depends 'asdf'

Examples are provided in test/cookbooks/test/recipes.

A asdf_user_install is required so that asdf is installed. See Resources below.

Testing

For more details look at the TESTING.md.

Resources

asdf_package

Installs, uninstalls and sets global an asdf package. See Package Dependencies below.

asdf_package 'name' do
  live_stream               [TrueClass, FalseClass]
  package                   String
  user                      String
  version                   String
end

Actions

This resource has the following actions:

  • :install Default
  • :global
  • :uninstall

Properties

This resource has the following properties:

  • live_stream Whether or not to output verbose stream. Defaults to false.
  • package Which package to install. Defaults to name.
  • user Which user to run asdf code as.
  • version Which package version to install. Required.

asdf_plugin

Installs, updates or removes an asdf plugin.

asdf_plugin 'name' do
  git_url                   String
  live_stream               [TrueClass, FalseClass]
  user                      String
end

Actions

This resource has the following actions:

  • :add Default
  • :update
  • :remove

Properties

This resource has the following properties:

  • git_url Git url to checkout plugin from.
  • live_stream Whether or not to output verbose stream. Defaults to false.
  • user Which user to run asdf code as.

asdf_script

Runs an asdf aware script.

asdf_script 'name' do
  code                      String
  environment               Hash
  live_stream               [TrueClass, FalseClass]
  path                      String
  returns                   Array
  timeout                   [Integer, Float]
  user                      String
end

Actions

This resource has the following actions:

  • :run Default

Properties

This resource has the following properties:

  • code asdf command to run. Default name.
  • environment Environment variables to run script.
  • live_stream Whether or not to output verbose stream. Defaults to false.
  • path Additional path to include in environment path.
  • returns Expected return code. Defaults to [0].
  • timeout Amount of time (in seconds) a command is to wait before timing out. Defaults to 3600.
  • user Which user to run asdf code as.

asdf_user_install

Installs asdf to the user path, making asdf only available to that user.

asdf_user_install 'name' do
  git_url                   String
  git_ref                   String
  update_asdf               [TrueClass, FalseClass]
  legacy_version_file       [TrueClass, FalseClass]
end

Actions

This resource has the following actions:

  • :install Default

Properties

This resource has the following properties:

  • git_ref Git reference to checkout.
  • git_url Git url to checkout asdf from. Defaults to https://github.com/asdf-vm/asdf.git.
  • legacy_version_file Whether or not to use legacy version files. Defaults to false.
  • update_asdf Whether or not to update asdf. Defaults to true.
  • user Which user to install asdf to. Defaults to name.

Package Dependencies

Although this cookbook is slowly but surely trying to make sure that dependencies are installed for each package on all supported operating systems, you may still need to add dependencies that have not been pre-installed for a particular package. If you do indeed get a package installed with dependencies that have not yet been pre-installed via this cookbook, please open up a pull request for review to be added.

Credit

This cookbook is based off of the ruby_rbenv cookbook.

Authors

Copyright:: Fernando Aleman

About

Chef cookbook for asdf version manager

License:Apache License 2.0


Languages

Language:Ruby 98.7%Language:Shell 1.3%