https://github.com/eclass/semantic-release-docker-swarm
semantic-release plugin to deploy services in docker swarm
https://github.com/eclass/semantic-release-docker-swarm
Last synced: 5 months ago
JSON representation
semantic-release plugin to deploy services in docker swarm
- Host: GitHub
- URL: https://github.com/eclass/semantic-release-docker-swarm
- Owner: eclass
- License: mit
- Created: 2020-09-22T17:58:26.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-08-31T12:03:49.000Z (7 months ago)
- Last Synced: 2025-09-22T23:58:59.929Z (6 months ago)
- Language: JavaScript
- Size: 239 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 42
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# @eclass/semantic-release-docker-swarm
[](https://www.npmjs.com/package/@eclass/semantic-release-docker-swarm)

[](https://www.npmjs.com/package/@eclass/semantic-release-docker-swarm)
[](https://david-dm.org/eclass/semantic-release-docker-swarm)
[](https://david-dm.org/eclass/semantic-release-docker-swarm#info=devDependencies)
[](https://coveralls.io/github/eclass/semantic-release-docker-swarm?branch=master)
[](https://codeclimate.com/github/eclass/semantic-release-docker-swarm/maintainability)
[](https://github.com/semantic-release/semantic-release)
> [semantic-release](https://github.com/semantic-release/semantic-release) plugin to deploy docker swarm service
| Step | Description |
| ------------------ | ------------------------------------------ |
| `verifyConditions` | Verify the presence of the plugin options. |
| `publish` | Deploy app. |
## Install
```bash
npm i -D @eclass/semantic-release-docker-swarm
```
## Usage
The plugin can be configured in the [**semantic-release** configuration file](https://github.com/semantic-release/semantic-release/blob/caribou/docs/usage/configuration.md#configuration):
```json
{
"plugins": [
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/git",
"@semantic-release/gitlab",
"@eclass/semantic-release-docker-swarm"
]
}
```
## Configuration
### Options
| Variable | Description |
| ------------- | ------------------------------------------------------------------------------------------------ |
| `dockerHost` | URI for connect to remote docker host. Required. Example: `ssh://username@host` |
| `service` | Name of the docker swarm service. Required. |
| `image` | Name of docker image. Required. Example: `registry.gitlab.com/mygroup/myapp` |
| `updateOrder` | Order to update the service. Only `start-first` or `stop-first`. Optional. Default: `stop-first` |
### Examples
```json
{
"plugins": [
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/git",
"@semantic-release/gitlab",
[
"@semantic-release/exec",
{
"prepareCmd": "sh .release/buildimage.sh"
}
],
[
"@eclass/semantic-release-docker",
{
"baseImageName": "registry.gitlab.com/mygroup/myapp",
"registries": [
{
"url": "registry.gitlab.com",
"imageName": "registry.gitlab.com/mygroup/myapp",
"user": "CI_REGISTRY_USER",
"password": "CI_REGISTRY_PASSWORD"
}
]
}
],
[
"@eclass/semantic-release-docker-swarm",
{
"dockerHost": "ssh://username@host",
"services": [
{
"name": "mystack_myservice",
"image": "registry.gitlab.com/mygroup/myapp",
"updateOrder": "start-first"
},
{
"name": "mystack_myworker",
"image": "registry.gitlab.com/mygroup/myapp",
"updateOrder": "stop-first"
}
]
}
]
]
}
```
```yml
# .gitlab-ci.yml
release:
image: node:alpine
stage: release
script:
- npx semantic-release
only:
- master
```
```yml
# .travis.yml
language: node_js
cache:
directories:
- ~/.npm
node_js:
- '12'
stages:
- test
- name: deploy
if: branch = master
jobs:
include:
- stage: test
script: npm t
- stage: deploy
script: npx semantic-release
```
## License
[MIT](https://tldrlegal.com/license/mit-license)