Ruby on Rails Monday, June 10, 2019

Hmmmm I don't know if heroku lets you add custom commands during deploy, I've only used it for tests. If it does, you could have two files on your source credentials.yml.enc.prod and credentials.yml.enc.dev and during deploy just rename on of them depending on the environment you are (mv config/credentials.yml.enc config/credentials.yml.enc). It you can't add custom command then I don't know haha.

El lun., 10 jun. 2019 a las 9:33, tech@datatravels.com (<tech@datatravels.com>) escribió:


On Jun 10, 2019, at 12:25 AM, Ariel Juodziukynas <arieljuod@gmail.com> wrote:

Rails 6 will have this feature https://github.com/rails/rails/pull/33521

For Rails 5.2, personally, I wouldn't add the file to the source control. I would do this steps:

1- run rails credentials:edit locally
2- add the credentials for production and save
3- upload the file to your hosting at /home/user/your_app/shared/config/


You  mean, you don't even check-in the encrypted file?


4- configure capistrano to symlink that file on each deploy (at config/deploy.rb)

set :linked_files, fetch(:linked_files, [])+%W{config/credentials.yml.enc}

Now, on each deploy, capistrano runs a task that adds some symlink to the current release pointing to /shared so they are kept between releases. Your file /home/user/your_app/current/config/credentials.yml.enc will actually be a symlink to /home/user/your_app/shared/config/credentials.yml.enc. You can just have that on production, use one on development and add it to the .gitignore file so it doesn't conflict with the symlink.



I think this is interesting but sort of paradigmatically different as I am working with 12-Factor deploys (Heroku), so there isn't a symlink paradigm in these cases. 

nonetheless, thanks for the input.


-Jason



--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/D070CEB0-00EF-45B2-B600-C88B3C2C8CED%40datatravels.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAPS3bcCh863N6q2WqKKovAbpUSEDdTYqc7%2BSFH0D04J5tAErzA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment