jefflunt / rpglogger

(retired) Build your own strategy guide for any RPG
6 stars 0 forks source link

Further automate the server building process #160

Open jefflunt opened 12 years ago

jefflunt commented 12 years ago

Also a (private) spreadsheet which currently shows that 25% of the server build process is manual. I really need to get this down to something like 1% - the 1% that is the kickoff of the provisioning of the server.

jefflunt commented 12 years ago

Learned how to do some more things with Chef lately. Should be able to provision the user, set the .bashrc and .bash_aliases files easily using templates (including the removal of .bash_profile, and the creation/modification of the database.yml on a per-environment basis.

Should also be able to write a capistrano recipe that will allow me to swap which database a given server points to by recreating the database.yml file by grabbing it from Chef and building it on the fly in capistrano.

Really this provisioning seems a lot simpler now that I've done more with Chef.

jefflunt commented 12 years ago

The swap command should really be something like cap preop deploy:promote

The purpose of this task would be the following:

This puts the new production server in place, promoting it with all production settings, and rebooting it, giving it a chance to get a clean start. Then, only after the smokescreen test passes will it reassign the IP and stop the old server. There might be some details I'm missing, but this should not only be possible, but relatively easy.

jefflunt commented 12 years ago

There will no longer be a preop server - I will simply rebuild the staging server and promote it when necessary before a big, stack-changing deploy.

jefflunt commented 12 years ago

Once these two things are done, the deploy:install and deploy:setup steps would be fully automated. This means that you could simply do deploy:cold and it should be able to everything in the first two steps, perhaps with a reboot in the middle, and go from zero to deployed app with a single command (after bootstrapping).

I might be able to move all the commands from the bootstrap script into capistrano as a bootstrap recipe, or something similar. It would effectively convert the current script into a series of run "command" commands inside of capistrano, but that's probably 100% okay after all.