How to Tell Engine Yard to Not Delete a File in the .gitignore

谁说我不能喝 提交于 2019-12-23 06:06:53

问题


To give you some context, I'm trying to use Figaro to safely add in environment variables without having to worry about security risks. The problem is is that I can't seem to get Engine Yard to play nice with production.

I went and did a touch application.yml and then vim application.yml, i, and then command+v to insert that api keys and what not. I know the ENV['VARIABLES'] work because of development and all my rspec and cucumber tests (which utilize the APIs), passed.

When I've got everything ready, I add within the .gitignore:

# Ignore application configuration
/config/application.yml

Afterwards, I deploy the site. I open it up and data isn't going to the APIs anymore. OK...

cd into config and discover application.yml isn't there anymore. Paste it back in... Redeploy the site since now it understands it has to ignore that file and I'm not seeing changes on production. Check back... and its gone again!

Stumped on what's going on.


回答1:


Simply putting a file into your deployed application's filesystem will not work because you get a clean environment each time you deploy. EngineYard cannot know that you want that particular file copied to that particular location without a little bit of extra work.

Their official recommendation is to put your YAML configuration files in /data/<app>/shared/config and symlink them to /data/<app>/current/config each time you deploy using deploy hooks.



来源:https://stackoverflow.com/questions/22569696/how-to-tell-engine-yard-to-not-delete-a-file-in-the-gitignore

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!