Automatic redeploy for docker swarm services
- Start docd on a swarm-manager
- Choose a trigger-method (Messaging, WebHook or REST)
- Trigger deployments for existing services
docker service create \
--name=docd \
--publish mode=host,target=8080 \
--mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock \
jeggers/docd:latest
- via Messaging (AWS SQS or RabbitMQ)
- via WebHook (Dockerhub)
- via REST
Property | Required | Default | Example |
---|---|---|---|
--webhookevent.queue.awssqs.access-key | yes | Policy | |
--webhookevent.queue.awssqs.secret-key | yes | ||
--webhookevent.queue.awssqs.region | yes | Regions | |
--webhookevent.queue.awssqs.queue-name | yes |
Note: Every cluster needs its own queue-name!
Property | Required | Default | Example |
---|---|---|---|
--webhookevent.queue.rabbitmq.hosts | yes | localhost | |
--webhookevent.queue.rabbitmq.username | no | guest | |
--webhookevent.queue.rabbitmq.password | no | guest | |
--webhookevent.queue.rabbitmq.exchange.name | no | io.docker | |
--webhookevent.queue.rabbitmq.routing-key | no | webHookEvent | |
--webhookevent.queue.rabbitmq.queue-name | no | com.itelg.docker.docd.webhookevent |
Note: Every cluster needs its own queue-name!
- POST: http://docd/webhook/dockerhub
- Body: WebHookEvent
docd supports a white- and blacklist-mode.
Blacklist is the default, so every service is automatically deployed. Preferred usage: Test-systems
To disable deployments in blacklist-mode a service-label named "DAD_SELECTION_BLOCKED" must be set.
docker service create \
--name=docd \
jeggers/docd:latest \
--service.selection.mode=BLACKLIST
docker service create \
--name=dummy-service \
--label DAD_SELECTION_BLOCKED=true \
dummy/service:latest
In whitelist-mode you have to explicitly enable every service. Preferred usage: Staging-systems or small production-systems
To enable deployments in whitelist-mode a service-label named "DAD_SELECTION_ALLOWED" must be set.
docker service create \
--name=docd \
jeggers/docd:latest \
--service.selection.mode=WHITELIST
docker service create \
--name=dummy-service \
--label DAD_SELECTION_ALLOWED=true \
dummy/service:latest
- POST/GET: http://docd/service/{serviceName}/allow
- POST/GET: http://docd/service/{serviceName}/block
- POST/GET: http://docd/service/{serviceName}/redeploy
- DELETE: http://docd/service/{serviceName}
- GET: http://docd/service/{serviceName}
mvn clean package dockerfile:build
mvn clean package dockerfile:build dockerfile:tag@tag-latest dockerfile:tag@tag-version dockerfile:push@push-latest dockerfile:push@push-version github-release:release