stack-ssh-deploy/README.md

63 lines
2.0 KiB
Markdown
Raw Permalink Normal View History

2020-09-23 08:32:50 +02:00
# stack-ssh-deploy
Deploy swarm stacks against a SSH based remote docker daemon context.
2020-09-23 08:56:27 +02:00
This is meant to be used as a [Drone plugin](http://plugins.drone.io/).
2020-09-23 08:44:37 +02:00
## Settings
2020-09-25 19:26:21 +02:00
### Required (no default)
- **deploy_key**: SSH private key part for ssh public key authentication
- **stack**: Name of the stack to be deployed
### Required (If Private Repo)
- **image**: Name and Tag of image since private image's are not pulled automatically by docker stack deploy
2020-09-25 19:26:21 +02:00
### Optional (with defaults)
2020-09-23 08:50:38 +02:00
- **compose** (default: `compose.yml`): compose file to use for deploying
- **host** (default: `swarm.autonomic.zone`): Host to deploy to (don't include `ssh://`)
- **port** (default: `222`): SSH port to connect to
- **user** (default: `drone`): System user to connect via SSH with
2020-09-27 21:20:17 +02:00
- **networks** (default:): Try and auto-create these networks first
- **rm**: (default: `false`): Remove the stack before deploying it
2022-01-04 14:49:01 +01:00
- **reg_user**: Registry user if publishing from a private repository
- **reg_pass**: Registry password if publishing from a private repository
2023-01-12 14:38:56 +01:00
- **reg_url**: Registry URL
2020-09-25 19:26:21 +02:00
### Dangerous options, unwise outside CI
2020-09-25 20:07:57 +02:00
- **generate_secrets** (default: `false`): randomly set all `secrets:` found in the
compose file -- you won't be able to retrieve them afterwards, so you almost
certainly don't want this for real deployments.
- **purge** (default: `false`): runs aggresive cleaning up measure to wipe
deployment afterwards
2020-09-23 08:44:37 +02:00
2020-09-23 08:32:50 +02:00
## Example
```yaml
---
kind: pipeline
name: deploy to swarm
steps:
- name: stack deploy
2020-09-25 12:57:09 +02:00
image: decentral1se/stack-ssh-deploy:latest
2020-09-23 08:32:50 +02:00
settings:
2020-09-23 08:50:38 +02:00
stack: mystack
2020-09-23 08:32:50 +02:00
deploy_key:
from_secret: drone_deploy_key
2020-09-27 21:20:17 +02:00
networks:
- proxy
- mail
environment:
DOMAIN: test.example.com
2020-09-23 08:32:50 +02:00
```
2020-09-23 08:44:56 +02:00
## Publishing
2020-09-25 13:30:33 +02:00
The version can be bumped in the [.drone.yml](./.drone.yml) file. We're sticking with `latest` as we iterate on the code right now.
2020-09-23 08:56:27 +02:00
2020-09-23 08:44:56 +02:00
If you push a commit to master, the [Drone config](./.drone.yml) will publish to [Docker Hub](https://hub.docker.com/r/decentral1se/stack-ssh-deploy).