capistrano-env icon indicating copy to clipboard operation
capistrano-env copied to clipboard

First deployment and linking the .env

Open Startouf opened this issue 8 years ago • 3 comments

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)

Startouf avatar Apr 10 '16 21:04 Startouf

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.

masarakki avatar Apr 11 '16 05:04 masarakki

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.

Startouf avatar Apr 11 '16 10:04 Startouf

In your case, it is better to add ENV in normal way, such as editing .bashrc or /etc/bashrc (by other people, manualy) .

masarakki avatar Apr 13 '16 08:04 masarakki