2023-10-25 12:34:47 +00:00
|
|
|
# docker-cp-deploy
|
2020-11-14 21:27:16 +00:00
|
|
|
|
2021-12-10 20:24:03 +00:00
|
|
|
[![Build Status](https://build.coopcloud.tech/api/badges/coop-cloud/docker-cp-deploy/status.svg)](https://build.coopcloud.tech/coop-cloud/docker-cp-deploy)
|
2020-11-14 21:27:16 +00:00
|
|
|
|
|
|
|
[Drone plugin](http://plugins.drone.io/) to copy files into a remote docker container.
|
|
|
|
|
|
|
|
## Settings
|
|
|
|
|
|
|
|
### Required (no default)
|
|
|
|
|
|
|
|
- **deploy_key**: SSH private key part for ssh public key authentication
|
|
|
|
- **service**: Name of the target service
|
|
|
|
- **dest**: Absolute path to copy files into
|
|
|
|
|
|
|
|
### Optional (with defaults)
|
|
|
|
|
|
|
|
- **source** (default: `.`): Local path to copy from
|
|
|
|
- **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
|
2021-12-10 20:22:35 +00:00
|
|
|
- **exec** (default: none): Run a command in the container after copying
|
2024-01-23 01:32:16 +00:00
|
|
|
- **exec_pre** (default: none): Run a command in the container before copying
|
2020-11-14 21:27:16 +00:00
|
|
|
|
2020-11-14 22:52:31 +00:00
|
|
|
### Makes me sad they exist
|
|
|
|
|
2021-12-10 20:22:35 +00:00
|
|
|
- **chdir** (default: none): Add `-C` option to `tar`; i.e. change to a directory first
|
2020-11-14 22:52:31 +00:00
|
|
|
|
2020-11-14 21:27:16 +00:00
|
|
|
## Example
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
---
|
|
|
|
kind: pipeline
|
2020-11-14 22:08:31 +00:00
|
|
|
name: deploy to docker container
|
2020-11-14 21:27:16 +00:00
|
|
|
steps:
|
|
|
|
- name: docker cp deploy
|
2023-10-25 12:34:47 +00:00
|
|
|
image: git.coopcloud.tech/coop-cloud/docker-cp-deploy:latest
|
2020-11-14 21:27:16 +00:00
|
|
|
settings:
|
|
|
|
host: swarm.example.com
|
|
|
|
service: foo_bar_com_app
|
|
|
|
dest: /var/www/html/
|
|
|
|
deploy_key:
|
|
|
|
from_secret: drone_deploy_key
|
|
|
|
```
|
|
|
|
|
|
|
|
## Publishing
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
If you push a commit to master, the [Drone config](./.drone.yml) will publish to [Docker Hub](https://hub.docker.com/r/3wordchant/docker-cp-deploy).
|