Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/julian-eggers/docd
Automatic redeploy for docker swarm services
https://github.com/julian-eggers/docd
continuous-delivery continuous-deployment docker docker-swarm swarm
Last synced: 5 days ago
JSON representation
Automatic redeploy for docker swarm services
- Host: GitHub
- URL: https://github.com/julian-eggers/docd
- Owner: julian-eggers
- License: mit
- Created: 2018-11-11T21:54:19.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-13T23:06:48.000Z (over 4 years ago)
- Last Synced: 2024-10-10T05:37:11.762Z (28 days ago)
- Topics: continuous-delivery, continuous-deployment, docker, docker-swarm, swarm
- Language: Java
- Homepage:
- Size: 40 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# docd
[![Build](https://github.com/julian-eggers/docd/workflows/release/badge.svg)](https://github.com/julian-eggers/docd/actions)
[![Nightly build](https://github.com/julian-eggers/docd/workflows/nightly/badge.svg)](https://github.com/julian-eggers/docd/actions)Automatic redeploy for docker swarm services
## Docker
[Dockerhub](https://hub.docker.com/r/jeggers/docd/)## Setup
1. Start docd on a swarm-manager
2. Choose a trigger-method (Messaging, WebHook or REST)
3. 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
```## Deployments
- via Messaging (AWS SQS or RabbitMQ)
- via WebHook (Dockerhub)
- via REST### Messaging
#### AWS SQS
| Property | Required | Default | Example |
| -------- | -------- | ------- | ---- |
| --webhookevent.queue.awssqs.access-key | yes | | [Policy](https://github.com/julian-eggers/docd/wiki/AWS-SQS#policy) |
| --webhookevent.queue.awssqs.secret-key | yes | | |
| --webhookevent.queue.awssqs.region | yes | | [Regions](https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/regions/Regions.html) |
| --webhookevent.queue.awssqs.queue-name | yes | | |Note: Every cluster needs its own queue-name!
#### RabbitMQ
| 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!
### WebHook
#### Dockerhub
- POST: http://docd/webhook/dockerhub
- Body: [WebHookEvent](https://docs.docker.com/docker-hub/webhooks/)### REST
- POST: http://docd/service/{serviceName}/redeploy## Selection (Whitelist/Blacklist)
docd supports a white- and blacklist-mode.Blacklist is the default, so every service is automatically deployed.
Preferred usage: Test-systemsTo 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=BLACKLISTdocker 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-systemsTo 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=WHITELISTdocker service create \
--name=dummy-service \
--label DAD_SELECTION_ALLOWED=true \
dummy/service:latest
```## REST
- 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}## Build & Release
### Build
```
mvn clean package dockerfile:build
```### Release
```
mvn clean package dockerfile:build dockerfile:tag@tag-latest dockerfile:tag@tag-version dockerfile:push@push-latest dockerfile:push@push-version github-release:release
```