This example shows how to deploy Docker swarm mode configuration consisting of a single service based on official Nginx image.
- Fabricio 0.3.17 or greater
- Vagrant
- One from the list of Vagrant supported providers (this example was tested with VirtualBox)
- fabfile.py, Fabricio configuration
- README.md, this file
- Vagrantfile, Vagrant config
Run vagrant up
and wait until VMs will be created.
fab --list
Before proceed you have to initialize Docker swarm cluster by running following command:
fab swarm-init
Note: use fab swarm-reset
to reset cluster
After cluster has been successfully initialized everything is ready to work with services:
fab service
Fabricio will not try to update service if no service parameters were changed after the last successful deploy attempt. However service update can be forced by using force
flag:
fab service:force=yes
Any Fabricio command can be executed in parallel mode. This mode provides advantages when you have more then one host to deploy to. Use --parallel
option if you want to run command on all hosts simultaneously:
fab --parallel service
Try to change some service options (e.g. change environment variable FOO=42
to FOO=hello
) and run deploy again:
fab service
This will update service with new options. After that you can return service to previous state by running 'rollback' command:
fab service.rollback
See "Hello World" Customization section.