Permalink
Browse files

Install phpenv along with config-add and config-rm extensions.

  • Loading branch information...
1 parent 182afa6 commit 7dac1ce824b946e88df0b9a7f3d078f1994321e0 @loicfrering loicfrering committed Mar 5, 2013
Showing with 17 additions and 7 deletions.
  1. +6 −0 ci_environment/phpenv/attributes/default.rb
  2. +11 −7 ci_environment/phpenv/recipes/default.rb
@@ -0,0 +1,6 @@
+default[:phpenv] = {
+ :git => {
+ :repository => "git://github.com/CHH/phpenv.git",
+ :revision => "a3091e84de6dd2c61ea1bdb96cf3053c62740a3f"
+ }
+}
@@ -1,21 +1,25 @@
include_recipe "git"
+phpenv_path = "#{node.travis_build_environment.home}/.phpenv"
-remote_file "/tmp/phpenv-install.sh" do
- source "https://raw.github.com/CHH/phpenv/master/bin/phpenv-install.sh"
- mode "0755"
+git "/tmp/phpenv" do
+ user node.travis_build_environment.user
+ group node.travis_build_environment.group
+ repository node[:phpenv][:git][:repository]
+ revision node[:phpenv][:git][:revision]
+ action :checkout
end
bash "install phpenv" do
user node.travis_build_environment.user
group node.travis_build_environment.group
- environment Hash["HOME" => node.travis_build_environment.home]
code <<-EOF
- . /tmp/phpenv-install.sh
+ PHPENV_ROOT="#{phpenv_path}" . /tmp/phpenv/bin/phpenv-install.sh
+ cp /tmp/phpenv/extensions/rbenv-config-add /tmp/phpenv/extensions/rbenv-config-rm "#{phpenv_path}/libexec"
EOF
- not_if "test -f #{node.travis_build_environment.home}/.phpenv/bin/phpenv"
+ not_if "test -f #{phpenv_path}/bin/phpenv"
end
-directory "#{node.travis_build_environment.home}/.phpenv/versions" do
+directory "#{phpenv_path}/versions" do
owner node.travis_build_environment.user
group node.travis_build_environment.group
mode "0755"

0 comments on commit 7dac1ce

Please sign in to comment.