There were times on Habré when every self-respecting (and not very) rail man for some reason laid out his own recipes for setting up a combat server and application deployment on Ruby on Rails. Such articles were 60% of all articles in the Rails hub, and the echoes of that time still surface: for example, in August I found two articles about the deployment of the rail.
I'm tired.
$ gem install from-scratch $ scratchify your_app_name your.host.com
')
What is this magic, read under the cut.
Gem from-scratchMore than anything, programmers love to solve problems. Less than anything, programmers love to solve problems that have been solved a thousand times before. I myself personally more than a dozen times manually raised the environment on the next VPS for the next project. In companies, the richer for this is DevOps. But when they are not there, then sooner or later the programmer begins to master automation himself. And either writes a simple bash script, or understands with Chef.
Actually, the magic is this: the command generates a typical config for Chef under the specified host and project name and starts Chef Solo (a mode that does not require starting the configuration server). Only does it all so that you don't need to understand anything in Chef. Here is what is provided in this configuration:
- Install all necessary packages
- Create a "powerless" user
- Install RVM with the latest MRI
- Install PostgreSQL, run pgtune
- Create a scheme in PG, create a user for it
- Generate database.yml and secrets.yml
- Install nginx
- Download typical config for nginx from upstream to any rack-based application server via unix-socket
And do not ask any extra questions.
All you have to do is set up Capistrano: