Skip to content

Latest commit

 

History

History

swarm

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Fabricio: Docker service

This example shows how to deploy Docker swarm mode configuration consisting of a single service based on official Nginx image.

Requirements

Files

  • fabfile.py, Fabricio configuration
  • README.md, this file
  • Vagrantfile, Vagrant config

Virtual Machines creation

Run vagrant up and wait until VMs will be created.

List of available commands

fab --list

Deploy

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

Deploy idempotency

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

Parallel execution

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

Rollback

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

Customization

See "Hello World" Customization section.