Skip to content

Commit

Permalink
Adding ability to set environment variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Vanbergen committed May 20, 2014
1 parent 4b0a734 commit 81d8d89
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Homestead.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ folders:
sites:
- map: homestead.app
to: /home/vagrant/Code/Laravel/public

environment:
- variable: APP_ENV
value: local
10 changes: 10 additions & 0 deletions scripts/homestead.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,15 @@ def Homestead.configure(config, settings)
s.args = [site["map"], site["to"]]
end
end

# Configure All Of The PHP Environment Variables
if settings.has_key?("environment")
settings["environment"].each do |var|
config.vm.provision "shell" do |s|
s.inline = "echo \"\nenv[$1] = '$2'\" >> /etc/php5/fpm/php-fpm.conf && service php5-fpm restart"
s.args = [var["variable"], var["value"]]
end
end
end
end
end

0 comments on commit 81d8d89

Please sign in to comment.