Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update RVM to use custom resources #414

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions .editorconfig

This file was deleted.

15 changes: 9 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ name: ci
"on":
pull_request:
push:
branches:
- main
branches: [main]

jobs:
lint-unit:
Expand All @@ -23,10 +22,14 @@ jobs:
strategy:
matrix:
os:
- "centos-7"
- "debian-9"
- "ubuntu-1604"
- "ubuntu-1804"
- amazonlinux-2
- debian-9
- debian-10
- debian-11
- centos-7
- centos-8
- ubuntu-1804
- ubuntu-2004
suite:
- "server-install"
fail-fast: false
Expand Down
6 changes: 1 addition & 5 deletions Berksfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,5 @@ source 'https://supermarket.chef.io'
metadata

group :integration do
cookbook 'apt'
cookbook 'yum'
cookbook 'java'
cookbook 'user'
cookbook 'rvm_wrapper', path: 'test/fixtures/cookbooks/rvm_wrapper'
cookbook 'test', path: 'test/fixtures/cookbooks/test'
end
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

- Rename test cookbook to test
- Testing Updates
- Remove test users databag
- Remove Foodcritic config
- Foodcritic has been replace by Cookstyle
- Require Chef 15.3 for unified_mode and Chef 18 support
- Move the vagrant recipe to the test cookbook
- This recipe this is only for testing
- Move all recipes to resource
- This allows us to use unifed_mode to install gems in the correct order

## 2.0.4 - *2023-09-29*

## 2.0.3 - *2023-09-04*
Expand Down
162 changes: 20 additions & 142 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,162 +1,40 @@
# RVM
# RVM Cookbook

<a name="title"></a> chef-rvm [![Build Status](https://secure.travis-ci.org/martinisoft/chef-rvm.png?branch=master)](http://travis-ci.org/martinisoft/chef-rvm)

**WARNING** - Please read!

There is currently a _major_ rewrite going on with this cookbook to simplify
the interface to RVM with Chef. Expect the master branch to be very broken
until there is a 1.0 release. All previous pull requests will need to rebase
to the newer master to contribute to the newly re-factored resources.

## <a name="description"></a> Description
[![Cookbook Version](https://img.shields.io/cookbook/v/rvm.svg)](https://supermarket.chef.io/cookbooks/rvm)
[![OpenCollective](https://opencollective.com/sous-chefs/backers/badge.svg)](#backers)

Check failure on line 4 in README.md

View workflow job for this annotation

GitHub Actions / lint-unit / markdownlint-cli2

Link fragments should be valid

README.md:4:1 MD051/link-fragments Link fragments should be valid [Context: "[![OpenCollective](https://opencollective.com/sous-chefs/backers/badge.svg)](#backers)"] https://github.com/DavidAnson/markdownlint/blob/v0.30.0/doc/md051.md
[![OpenCollective](https://opencollective.com/sous-chefs/sponsors/badge.svg)](#sponsors)

Check failure on line 5 in README.md

View workflow job for this annotation

GitHub Actions / lint-unit / markdownlint-cli2

Link fragments should be valid

README.md:5:1 MD051/link-fragments Link fragments should be valid [Context: "[![OpenCollective](https://opencollective.com/sous-chefs/sponsors/badge.svg)](#sponsors)"] https://github.com/DavidAnson/markdownlint/blob/v0.30.0/doc/md051.md
[![License](https://img.shields.io/badge/License-Apache%202.0-green.svg)](https://opensource.org/licenses/Apache-2.0)

Manages system-wide and per-user [RVM][rvm]s and manages installed Rubies.
Several resources are defined to accomplish these tasks.

## <a name="requirements"></a> Requirements

### <a name="requirements-chef"></a> Chef
## Requirements

Tested on 12.5.1 but older versions of chef may not work due to the changes
in the resource model. You are welcome to submit a pull request to add this
support.
- Chef 15.3+

File an [issue][issues] if this isn't the case.
### Platforms

### <a name="requirements-platform"></a> Platform

The following platforms have been tested with this cookbook, meaning that
the recipes and LWRPs run on these platforms without error:

* ubuntu (12.04 and higher)
* debian (6.0 and newer)
* mac_os_x (10.6/10.7) (See [Platform Notes](#platform-notes-osx))
* mac_os_x_server (See [Platform Notes](#platform-notes-osx))
* suse (openSUSE, SLES)
* centos
* amazon (2011.09)
* scientific
* redhat
* fedora
* gentoo

Please [report][issues] any additional platforms so they can be added.
- Debian, Ubuntu
- CentOS, RedHat, Fedora, Scientific, Amazon

### Platform Notes

#### <a name="platform-notes-osx"></a> OSX

This cookbook suggests the [homebrew](http://community.opscode.com/cookbooks/homebrew) cookbook, which is needed to install
any additional packages needed to compile ruby. RVM now ships binary rubies,
but will require homebrew to install any additional libraries.

### <a name="requirements-cookbooks"></a> Cookbooks

If you are installing [JRuby][jruby] then a Java runtime will need to be
installed. The Opscode [java cookbook][java_cb] can be used on supported
platforms.

## <a name="installation"></a> Installation
## Installation

Depending on the situation and use case there are several ways to install
this cookbook. All the methods listed below assume a tagged version release
is the target, but omit the tags to get the head of development. A valid
Chef repository structure like the [Opscode repo][chef_repo] is also assumed.

### <a name="installation-berkshelf"></a> Using Berkshelf

[Berkshelf][berkshelf] is a way to manage a cookbook or an application's
cookbook dependencies. Include the cookbook in your Berksfile, and then run
`berks install`. To install using Berkshelf:

```shell
gem install berkshelf
cd chef-repo
berks init
echo "cookbook 'rvm', github: 'fnichol/chef-rvm'" >> Berksfile
berks install
```

### <a name="installation-librarian"></a> Using Librarian-Chef

[Librarian-Chef][librarian] is a bundler for your Chef cookbooks.
Include a reference to the cookbook in a [Cheffile][cheffile] and run
`librarian-chef install`. To install Librarian-Chef:

```shell
gem install librarian-chef
cd chef-repo
librarian-chef init
cat >> Cheffile <<END_OF_CHEFFILE
cookbook 'rvm',
:git => 'git://github.com/fnichol/chef-rvm.git', :ref => 'v0.10.1'
END_OF_CHEFFILE
librarian-chef install
```
## Resources

## <a name="recipes"></a> Recipes
- [rvm_system_install](documentation/rvm_system_install.md)
- [rvm_user_install](documentation/rvm_user_install.md)
- [rvm_ruby](documentation/rvm_ruby.md)
- [rvm_gem](documentation/rvm_gem.md)
- [rvm_gemset](documentation/rvm_gem_set.md)
- [rvm_alias](documentation/rvm_alias.md)
- [rvm_wrapper](documentation/rvm_wrapper.md)

### <a name="recipes-default"></a> default

Installs the RVM gem and initializes Chef to use the Resources in this cookbook
for installing and managing RVM.

## <a name="contributing"></a> Contributing
## Contributing

See the CONTRIBUTING.md file

### Testing

Make sure you have the following requirements setup:

* [Vagrant][vagrant]
* [vagrant-berkshelf][vagrant-berkshelf]

After you `bundle install` run `rake` for unit tests and `kitchen test` for
integration level tests.

## <a name="license"></a> License and Authors

Authors:: [Aaron Kalin][martinisoft] (<[email protected]>)

Contributors:: <https://github.com/sous-chefs/chef-rvm/contributors>

Copyright:: 2010 - 2017, Aaron Kalin

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

<http://www.apache.org/licenses/LICENSE-2.0>

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

[berkshelf]: http://berkshelf.com
[chef_repo]: https://github.com/chef/chef
[cheffile]: https://github.com/applicationsonline/librarian/blob/master/lib/librarian/chef/templates/Cheffile
[compilation]: http://wiki.opscode.com/display/chef/Evaluate+and+Run+Resources+at+Compile+Time
[dragons]: http://en.wikipedia.org/wiki/Here_be_dragons
[martinisoft]: https://github.com/martinisoft
[java_cb]: http://supermarket.chef.io/cookbooks/java
[jruby]: http://jruby.org/
[librarian]: https://github.com/applicationsonline/librarian#readme
[rvm]: https://rvm.io
[rvm_create_gemset]: https://rvm.io/gemsets/creating/
[rvm_delete_gemset]: https://rvm.io/gemsets/deleting/
[rvm_empty_gemset]: https://rvm.io/gemsets/emptying/
[rvm_default]: https://rvm.io/rubies/default/
[rvm_gemsets]: https://rvm.io/gemsets/
[rvm_install]: https://rvm.io/rvm/install/
[rvm_remove]: https://rvm.io/rubies/removing/
[rvm_ruby_install]: https://rvm.io/rubies/installing/
[rvm_upgrading]: https://rvm.io/rvm/upgrading/
[vagrant]: http://vagrantup.com
[vagrant-berkshelf]: https://github.com/berkshelf/vagrant-berkshelf

[repo]: https://github.com/sous-chefs/chef-rvm
[issues]: https://github.com/sous-chefs/chef-rvm/issues
10 changes: 10 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# TODO

How we're going to go about fixing RVM!

- Install one Ruby
-

## Use a Mixed mode installation

- For an installation usable by all users on the system - with isolated rubies/gemsets within a user's $HOME. Installation instructions are exactly the same as for Multi-User installations, the difference is in users environment.
31 changes: 2 additions & 29 deletions attributes/default.rb
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
#
# Cookbook:: rvm
# Attributes:: default
#
# Author:: Fletcher Nichol <[email protected]>
#
# Copyright:: 2010, 2011, Fletcher Nichol
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# ruby that will get installed and set to `rvm use default`.
default['rvm']['default_ruby'] = 'ruby-1.9.3-p547'
default['rvm']['user_default_ruby'] = 'ruby-1.9.3-p547'
Expand All @@ -39,7 +18,7 @@
default['rvm']['user_gems'] = {}

# hash of rvmrc options
default['rvm']['rvmrc_env'] = { 'rvm_gem_options' => '--no-ri --no-rdoc' }
default['rvm']['rvmrc_env'] = { 'rvm_gem_options' => '--no-document' }

# a hash of user hashes, each an isolated per-user RVM installation
default['rvm']['installs'] = {}
Expand All @@ -48,17 +27,11 @@
default['rvm']['installer_url'] = 'https://raw.githubusercontent.com/rvm/rvm/master/binscripts/rvm-installer'
default['rvm']['version'] = 'stable'

# GPG key for rvm verification
default['rvm']['gpg_key'] = 'D39DC0E3'
default['rvm']['gpg_key_server'] = 'hkp://keys.gnupg.net'

# Autolib mode, see https://rvm.io/rvm/autolibs
default['rvm']['autolib_mode'] = 3

# extra system-wide tunables
default['rvm']['root_path'] = '/usr/local/rvm'
default['rvm']['group_id'] = 'default'
default['rvm']['group_users'] = []
default['rvm']['root_path'] = '/usr/local/rvm'

case node['platform']
when 'redhat', 'centos', 'fedora', 'scientific', 'amazon', 'oracle'
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions documentation/rvm_gem.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Empty file added documentation/rvm_gem_set.md
Empty file.
Empty file added documentation/rvm_ruby.md
Empty file.
Empty file added documentation/rvm_system.md
Empty file.
Empty file.
Empty file added documentation/rvm_user.md
Empty file.
Empty file.
Empty file added documentation/rvm_wrapper.md
Empty file.
2 changes: 1 addition & 1 deletion kitchen.dokken.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ transport: { name: dokken }
provisioner: { name: dokken }

platforms:
- name: almalinux-8
- name: debian-9
driver:
image: dokken/almalinux-8
pid_one_command: /usr/lib/systemd/systemd
Expand Down
Loading
Loading