by hdra · 13y ago · 0 comments
Is there any total noobs guide to automated deployment? Everything I have seen to this day assumes some knowledge of sysops and the whole ecosystem of that specific deployment tool (e.g. like it assumes I knew what is a 'cookbook', or where to find them, etc). It would be great if there is a guide for people like me that doesn't assume any knowledge from the reader aside from development / basic local deployment.
[1] http://www.opinionatedprogrammer.com/2011/06/chef-solo-tutor...
It's a lightweight management tool, like writing a shell script in python, but easier and targeted towards system deployment, really
you only have to get around its unintuitive calling convention (not inside the script - it's the way you use the cmd line tool) but otherwise it's a breeze
Chef/Puppet are harder (as in, you really have to fit their paradigms)
Writing the functionality of Fabric in shell would take you a long time and give you something which was buggy and inflexible. Someone else wrote it in Python for you. There's no good reason to write it in shell.
with Fabric you are writing shell scripts in python, so you can have people who doesn't know how to read complex(?) shell scripts be able to read/write/modify your deploy scripts.
I'll assume you use Git (if not, replace with your workflow). A super simple fabric script might simply be a `git push`. Instead of typing "git push origin master" in order to push to github/bitbucket/wherever, you'd run "fab deploy". Not going to go into the fabric specifics, but deploy() would pretty much just call git push.
Anyway, that may have confused you even more. My point is, start with something incredibly simple. After you've added git push, you can add to your fabfile.py to ssh into the server, and run git pull. Then add in something to run south migrations. Then collectstatic. Eventually you'll build to something that you can simply run, and everything will be updated and all good.
Chef/Puppet are like Makefiles, it would rebuild the targets if they don't exist. If it is already in the desired state, running the script performs nothing. This is not the case with Fabric. Fabric scripts would usually always perform the required action (unless you have written checks explicitly).
Fabric is a low hanging fruit so I would suggest starting there until you really have the need to manage multiple servers and then use Chef/Puppet.
Puppet is not really great at executing a sequence of steps because it is declarative: you can always express sequence as dependencies (e.g., reload nginx when file X has changed), but for fine grained steps (e.g., create a softlink for the latest version of your code), it's less convenient.
It's also slower than a Fabric script. If I want to revert to a previous version, I just do "fab revert myapp". With puppet I would have to rerun the puppet agent/change a manifest/change the version in my rpm repository/...
We heavily use puppet to manage our servers, but we rely on Fabric for deployment tasks.
http://www.slideshare.net/zerok/django-buildout-en-presentat... http://www.sophomoredev.com/2012/06/how-i-use-django-virtual...
As for managing deployments and general devops, I am currently looking at ansible.
You need to have some knowledge of sysops to use automated deployment tools. I guess it's why they were created in the first place, i.e. not for beginners but for those with enough knowledge/skill to automate tedious sys admin tasks. Perhaps the best solution for you is to use a PaaS like Heroku, EngineYard, Google App Engine, etc.
I am not looking to be so proficient that I can handle a production server, but I do wish that I can automate some of my development workflow.