- Vagrant
Download vagrant: http://www.vagrantup.com/
- Cuisine
Install cuisine:
sudo pip install cuisine
-
Add or edit cuisine/fabric scripts in provision/recipes.
-
Add or edit config files in provision/config.
-
The main provisioning function is setup_hosts in fabfile.py, you can edit this function or add more.
-
You can add more enviroments in provision/enviroments.py.
-
Edit settings.json for add staging or production hosts/private_keys. Also you can edit options for vagrant or add new options for your commands.
-
The development enviroment is only for vagrant.
-
Example of the settings.cfg:
{ "enviroments": { "development": { "IP" : "192.168.13.37", "USERNAME" : "vagrant", "PASSWORD" : "vagrant", "VAGRANT_PRIVATE_KEY_PATH": "/Users/alvarolizama/.vagrant.d/insecure_private_key", "PROVISIONER_COMMAND" : "setup_host", "SRC_MOUNT_DIR" : "/home/vagrant/src" }, "staging": { "USERNAME": "", "HOSTS" : [ ], "PRIVATE_KEY_PATH" : "" }, "production": { "USERNAME": "root", "HOSTS" : [ "192.168.13.37:22" ], "PRIVATE_KEY_PATH" : "/Users/alvarolizama/.ssh/work.pem" } } }
- If you need port redirect for vagrant edit the Vagrantfile.
- Run vagrant up for exec setup_host command in vagrant box.
- Run vagrant ssh for enter in to vagrant box.
- For run a command of the fabfile.py in vagrant just type fab development .
- For run a command of the fabfile.py in staging just type fab staging .
- For run a command of the fabfile.py in production just type fab production .
- Put your source code in src, vagrant mount it in /home/vagrant/src.
-
Setup (Edit this recipe for change the default user)
- Install VIM
- Install nano
- Install tmux
- Install some util libs
- Config tmux for vagrant user
-
Python
- Install python and python development files
- Install pip
- Install virtualenvs
-
Nginx
- Install nginx
- Create user for apps
- Create dir for apps and logs
-
Uwsgi
- Install Uwsgi
-
Postgres
- Install postgres
- Create user
- Create database
- Grant permissions
-
Gitolite
- Install gitolite
- Create user for git
- Config gitolite