Last active
December 19, 2015 20:09
-
-
Save masutaka/6011122 to your computer and use it in GitHub Desktop.
The Chef recipe `plenv + cpanm + carton`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git '/home/masutaka/.plenv' do | |
| repository 'git://github.com/tokuhirom/plenv.git' | |
| reference 'master' | |
| user 'masutaka' | |
| group 'masutaka' | |
| action :sync | |
| end | |
| directory '/home/masutaka/.plenv/plugins' do | |
| owner 'masutaka' | |
| group 'masutaka' | |
| mode 0755 | |
| action :create | |
| end | |
| git '/home/masutaka/.plenv/plugins/perl-build' do | |
| repository 'git://github.com/tokuhirom/Perl-Build.git' | |
| reference 'master' | |
| user 'masutaka' | |
| group 'masutaka' | |
| action :sync | |
| end | |
| bash 'Install perl-5.18.2' do | |
| user 'masutaka' | |
| group 'masutaka' | |
| code <<-EOC | |
| export PATH=$HOME/.plenv/bin:$PATH | |
| eval "$(plenv init -)" | |
| plenv install 5.18.2 -Dusethreads | |
| plenv global 5.18.2 | |
| plenv rehash | |
| EOC | |
| creates '/home/masutaka/.plenv/versions/5.18.2' | |
| end | |
| bash 'Install cpanm' do | |
| user 'masutaka' | |
| group 'masutaka' | |
| code <<-EOC | |
| export PATH=$HOME/.plenv/bin:$PATH | |
| eval "$(plenv init -)" | |
| plenv install-cpanm | |
| EOC | |
| creates '/home/masutaka/.plenv/versions/5.18.2/bin/cpanm' | |
| end | |
| bash 'Install carton' do | |
| user 'masutaka' | |
| group 'masutaka' | |
| code <<-EOC | |
| export PATH=$HOME/.plenv/bin:$PATH | |
| eval "$(plenv init -)" | |
| plenv exec cpanm Carton | |
| EOC | |
| creates '/home/masutaka/.plenv/versions/5.18.2/bin/carton' | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe 'plenv' do | |
| describe file '/home/masutaka/.plenv/.git' do | |
| it_behaves_like 'a directory masutaka:masutaka 755' | |
| end | |
| describe file '/home/masutaka/.plenv/plugins' do | |
| it_behaves_like 'a directory masutaka:masutaka 755' | |
| end | |
| describe file '/home/masutaka/.plenv/plugins/perl-build/.git' do | |
| it_behaves_like 'a directory masutaka:masutaka 755' | |
| end | |
| describe file '/home/masutaka/.plenv/versions/5.18.2' do | |
| it_behaves_like 'a directory masutaka:masutaka 755' | |
| end | |
| describe file '/home/masutaka/.plenv/versions/5.18.2/bin/cpanm' do | |
| it_behaves_like 'a file masutaka:masutaka 555' | |
| end | |
| describe file '/home/masutaka/.plenv/versions/5.18.2/bin/carton' do | |
| it_behaves_like 'a file masutaka:masutaka 555' | |
| end | |
| end |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://masutaka.net/chalow/2013-07-17-1.html