Skip to content

Instantly share code, notes, and snippets.

@masutaka
Last active December 19, 2015 20:09
Show Gist options
  • Select an option

  • Save masutaka/6011122 to your computer and use it in GitHub Desktop.

Select an option

Save masutaka/6011122 to your computer and use it in GitHub Desktop.
The Chef recipe `plenv + cpanm + carton`
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
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
@masutaka

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment