简体   繁体   English

使用Capistrano Deploy复制Figaro的application.yml - Rails

[英]Copy Figaro's application.yml with Capistrano Deploy - Rails

I am trying to deploy my Rails application to a staging server with Capistrano, nginx and Puma. 我正在尝试将我的Rails应用程序部署到具有Capistrano,nginx和Puma的登台服务器。 I am using the Figaro gem to setting ENV variables. 我正在使用Figaro gem来设置ENV变量。 When deploying, the standard Capistrano configuration does not look for and copy the application.yml file before deploying the app, and of course the deployment fails because of missing credentials. 部署时,标准Capistrano配置在部署应用程序之前不会查找并复制application.yml文件,当然,部署因缺少凭据而失败。 I have found a few Gists with a snippet to insert into the deploy.rb. 我找到了一些Gists,其中包含一个要插入deploy.rb的代码段。 These looked promising but I was insure about the before/after actions because the ones they were using, didn't match up with the actions used in my deploy.rb file. 这看起来很有希望,但我确保前/后操作,因为他们使用的那些,与我的deploy.rb文件中使用的操作不匹配。 I also tried the capistrano-figaro-yml gem which seamed to copy the file but would not update the file if it was changed locally. 我还尝试了capistrano-figaro-yml gem,它接缝复制文件,但如果文件在本地更改则不会更新。

Is there a more standard way to trigger a copy of the application.yml file with the Capistrano deployment? 是否有更标准的方法来触发带有Capistrano部署的application.yml文件的副本? Thanks 谢谢

添加set :linked_files, %w{config/application.yml}到deploy.rb就可以了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM