-
-
Save grahamc/0c4079e43b5f997a5bd6 to your computer and use it in GitHub Desktop.
This file contains 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
base_dir = "/opt/foobar/" | |
deployed_env = "dev" | |
deployed_user = "foobar" | |
deployed_group = "foobar" | |
# Create a bundle_wrapper.sh which sets the deployed RAILS_ENV, | |
# and puts our ruby first in the path, use it as if it were bundler | |
# itself: | |
# cd /opt/foobar/deployment/current | |
# /opt/foobar/bundle_wrapper.sh exec rake db:migrate | |
# | |
# etc. | |
file "#{base_dir}/bundle_wrapper.sh" do | |
user deployed_user | |
group deployed_group | |
mode "0750" | |
content <<-EOH | |
#!/bin/bash | |
export PATH="/usr/local/bin/:$PATH" | |
export RAILS_ENV="#{deployed_env}" | |
exec bundle $@ | |
EOH | |
end | |
application "foobar" do | |
environment_name deployed_env | |
migrate true | |
rails do | |
bundler true | |
bundle_command "#{base_dir}/bundle_wrapper.sh" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment