I use gem capistrano-env
and found a small problem. My deploy script is:
Capistrano::Env.use do |env|
env.add 'DB_DSN', 'mysql:host=localhost;dbname=dbname'
env.add 'DB_USER', 'user'
env.add 'DB_PASS', 'pass'
end
And this code create .env
file on server after deploy. But! .env
file permissions is 640 and my PHP script cannot read it. I can run chmod
command after each deploy, but probably exist other nice solution?
EDIT
I created pull request and add new filemode
option into this gem. So, now solution is:
Capistrano::Env.use do |env|
env.add 'DB_DSN', 'mysql:host=localhost;dbname=dbname'
env.add 'DB_USER', 'user'
env.add 'DB_PASS', 'pass'
env.filemode = 0644
end