GithubHelp home page GithubHelp logo

chef-plenv's Introduction

chef-plenv

Chef cookbook and LWRPs for plenv

Requirements

Platforms

  • Debian, Ubuntu
  • RedHat, CentOS, Fedora, Amazon, Scientific

Cookbooks

Usage

Using Attributes and Recipes

Add these recipes below into run_list:

recipe[plenv]
recipe[plenv::install]
recipe[plenv::global]
recipe[plenv::cpanm]

Then set attributes described later.

Using LWRPs (Recommended)

Only recipe[plenv] should be added into your run_list.

recipe[plenv]

Then use LWRPs in your own recipe.

plenv_install "5.16.3" do
  user   "kentaro"
  action :install
end

plenv_global "5.16.3" do
  user   "kentaro"
  action :run
end

%w[
  carton
  Plack
  Amon2
].each do |mod|
  plenv_cpanm mod do
    user    "kentaro"
    version "5.16.3"
    options "--force"
    action  :install
  end
end

Attributes

Key Type Description Default
['plenv']['repository'] String Repository URL of plenv git://github.com/tokuhirom/plenv.git
['plenv']['reference'] String Reference to the Git repository master
['plenv']['users'] Hash Users and information of Perls to be installed for each users See the example below

Example of users attribute

plenv: {
  users: [
    {
      name: "kentaro",
      versions: [
        {
          version:         "5.16.3",
          install_options: "-Dusethreads",
          cpanm_options:   "--force",
          moudles: %w[
            Plack
            Amon2
          ],
        },
        {
          version:         "5.14.3",
          install_options: "-Dusethreads",
          cpanm_options:   "--force",
          moudles: %w[
            Mojolicious
          ],
        },
      ],

      global: "5.16.3",
    },

    {
      name: "studio3104",
      versions: [
        {
          # This version will be treated as global if `global` option not set
          version:         "5.16.3",

          install_options: "-Dusethreads",
          cpanm_options:   "--force",
          moudles: %w[
            Plack
            Amon2
          ],
        },
      ],
    },
  ]
}

Recipes

  • plenv::install: Installs plenv (if not installed yey) and perls
  • plenv::global: Sets a certain version of perl as globally used version
  • plenv::cpanm: Installs cpanm (if not installed yet) and a perl module via cpanm

If you want to handle the installation manually, just use only plenv recipe and use LWRPs described below.

Resources and Providers

This cookbook provides serveral LWRPs listed below:

  • plenv_install: Installs plenv (if not installed yet) and runs plenv install ...
  • plenv_global: Runs plenv global ...
  • plenv_cpanm: Installs cpanm (if not installed yet) and a perl module via cpanm

plenv_install

Installs plenv (if not installed yet) and perl via plenv.

plenv_install "5.16.3" do
  user            "kentaro"
  install_options "-Dusethreads"
  action          :install
end

plenv_global

Set a certain version of perl as globally used version.

plenv_global "5.16.3" do
  user   "kentaro"
  action :run
end

plenv_cpanm

Installs cpanm (if not installed yet) and a perl module.

plenv_cpanm "Plack" do
  version "5.16.3"
  user    "kentaro"
  options "--force --reinstall"
  action :install
end

Contributing

  1. Fork the repository on Github
  2. Create a named feature branch (like add_component_x)
  3. Write you change
  4. Write tests for your change (if applicable)
  5. Run the tests, ensuring they all pass
  6. Submit a Pull Request using Github

License and Authors

License

MIT License

Authors

chef-plenv's People

Contributors

kentaro avatar

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.