You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-13Lines changed: 12 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,16 +2,15 @@
2
2
This library is inspired by [docker-deploy-webhook](https://github.com/iaincollins/docker-deploy-webhook).
3
3
(Please read about MQTT protocol before proceeding with the rest of the document)
4
4
5
-
MQTT Hook for automated deployment of images to docker-swarm on local-machines.
6
-
(*Note: Please use this library only if your deployment target machine is not on the cloud or if your machine does not have a static IP address. If not, then consider using [this](https://github.com/iaincollins/docker-deploy-webhook))
5
+
MQTT Hook for automated deployment of images to docker-swarm on any machine(Irrespective of global/static/dynamic/local IP).
7
6
8
7
<!-- Here is a [blog]() about how to integrate this library with gitlab-ci -->
9
8
10
9
# Docs
11
10
12
11
## Environment Variables
13
-
**CONFIG** (*Default to 'production'*)
14
-
Informs deployment process about which configuration to pick from ddm_config.json
12
+
**CONFIG** (*Defaults to 'production'*)
13
+
Information about which configuration to pick from ddm_config.json (Sample file described below)
15
14
16
15
## Docker-Config
17
16
**broker_url**
@@ -32,18 +31,18 @@ Docker registry name (Ex. registry.gitlab.com)
32
31
```
33
32
In here you can specify different environments according to your needs. Each environment can have any number of images configured to be deployed onto the docker-swarm.
34
33
35
-
***environment**
36
-
It is used distinguish between different types of deployment preferences. For instance one may choose to deploy only `latest` versions on `production` while test all the versions on staging environment
37
-
***image-name:image-tag**
38
-
`<image-name>` corresponds to the docker image to be deployed, whereas`<image-tag>`can be exactly the tag that you desire to deploy or it can match multiple tags based on pattern matching. *`<image-tag>` defaults to latest*.
34
+
***\<environment\>**
35
+
It's used to distinguish between different types of deployment preferences(like production/staging/testing etc). For instance one may choose to deploy only `latest` versions on `production`, while deploy every single image on staging environment.
36
+
***\<image-name\>:\<image-tag\>**
37
+
`<image-name>` corresponds to the docker image-name to be deployed and`<image-tag>`is the docker image-tag. `<image-tag>` also supports pattern matching (*`<image-tag>` defaults to latest*)
39
38
Hence all the below patterns are valid
40
39
*`helloworld`*(By default tag is `latest`)*
41
40
*`helloworld:*`
42
41
*`helloworld:test_*`
43
42
*`helloworld:latest`
44
-
*`helloworld:!danger`*(This corresponds to all images except `danger`)*
45
-
For more details visit [matcher](https://www.npmjs.com/package/matcher)
46
-
***service-name**
43
+
*`helloworld:!ignored`*(This corresponds to all images except `ignored` tag)*
44
+
For more details of supported patterns visit [matcher](https://www.npmjs.com/package/matcher)
45
+
***\<service-name\>**
47
46
Docker-swarm service name whose image is intended to be updated.
48
47
49
48
## Docker-Secrets
@@ -57,7 +56,7 @@ In here you can specify different environments according to your needs. Each env
57
56
Docker login - password
58
57
59
58
## MQTT-Topic to publish
60
-
docker-deploy-mqtt would subscribe to `/docker-deploy-mqtt/${ddm_token}` topic. So your CI/CD design must include a step to publish on the same MQTT Topic, with the message in the following format:
59
+
docker-deploy-mqtt would subscribe to `/docker-deploy-mqtt/${ddm_token}` topic. So your CI/CD design must include a step to publish on the same MQTT Topic with the message in the following format:
61
60
```JSON
62
61
{
63
62
"name" : "<image-name>(Without Tag)",
@@ -132,7 +131,7 @@ Get the image from [here](https://hub.docker.com/r/akashbabu256/docker-deploy-mq
132
131
133
132
## Caveats
134
133
* Do not include (+,#) in ddm_tokens
135
-
* Do not include `'` in messages as it will be replaced with `"`
134
+
* Be careful when wrapping CI/CD VARIABLES in `'`(single quotes) as they will be considered as strings. Hence suggested solution is to wrap the entire string in `"`(double quotes) and then use `'`(single quotes) for inner strings.
136
135
137
136
## Contributions
138
137
For contributions, please take up the tasks in Roadmap or If you find any potential improvement to this library, feel free to create a PR or raise an issue for the same.
0 commit comments