capistrano-env
capistrano-env copied to clipboard
First deployment and linking the .env
I am using Capistrano 3 and I am linking the .env file between releases
set :linked_files, fetch(:linked_files, []).push('.env',...)
Then in my deploy files I am using the gem
Capistrano::Env.use do |env|
env.add ...
env.formatter = :dotenv
end
This still causes an error on the first deployment, complaining that .env is missing.
ERROR linked file /var/www/myWebsite-test/shared/.env does not exist on
(I want to allow a user to modify the .env file manually, but still synchronize new variables that would be added later during dev)
do you mean this?
- you want edit
.env
manualy after deployment - you want keep editied
.env
in next deployment
I want to know why you want to edit deployed .env
instead of editing deploy.rb
.
I put in deploy.rb the environment variables I know of, but other env variable (access keys, etc.) are entered later by other people manually in the .env to activate other functionalities.
In your case, it is better to add ENV in normal way, such as editing .bashrc
or /etc/bashrc
(by other people, manualy) .