This is a fabric deploy script with extra functions that allow anyone deploy a Magento site
This fabric deploy script has the ability to
- Add git remotes to a repo
- Check if a web directory is sane for deployment
- Create MYSQL databases
- Deploy a git repository to a) single host b) group of hosts (roles)
- Import a gz database archive into a MYSQL database
- Create symlink to your web foolder which points to your latest release
- List the remotes on a git repo
- Migrate a web folder to the expected structure
- Prune releases archives
- Ping a server or group of servers and have them report their latest running kernel
- Rollback to a previous release
- Set permissions on a web folder
- Create an expected folder structure
- Show MYSQL databases
- Create symlinks to folders outside of version control eg. media; var; app/etc/local.xml
- Install fabric on your laptop or local machine on ubuntu : sudo apt-get install fabric
- Download and configure the fabfile.py with your settings
- run fab -A -R [role/host] [command]
/var/ └── www ├──domain.com ├── db ├── releases │ ├── 20140320-2057 │ ├── 20140320-2200 │ ├── 20140321-1056 │ ├── 20140321-1127 │ └── 20140321-1133 ├── repo ├── shared │ ├── media │ └── var └── web -> /var/www/domain.com/releases/20140321-1133
fab -A -R [role,host] [command]
examples:
- fab -A -R dev deploy
- fab -A -R dev deploy:master
- fab -A -R dev rollback:2
add_remote
check
create_database
deploy
import_database_archive
link_to_web
list_remote
migrate
prune_releases
report
rollback
set_permissions
setup
show_databases
symlink
If you have any issues with this code, open an issue on GitHub (see URL above)
Any contributions are highly appreciated. The best way to contribute code is to open a pull request on GitHub.
Winston Nolan
OSL - Open Software Licence 3.0
Copyright (c) 2014 Winston Nolan