https://github.com/cupcakearmy/drone-deploy
Deployment Plugin for Drone
https://github.com/cupcakearmy/drone-deploy
deployment drone-ci drone-plugin plugin sftp ssh
Last synced: 6 months ago
JSON representation
Deployment Plugin for Drone
- Host: GitHub
- URL: https://github.com/cupcakearmy/drone-deploy
- Owner: cupcakearmy
- License: mit
- Created: 2019-03-05T18:20:56.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-12-19T20:56:42.000Z (almost 2 years ago)
- Last Synced: 2025-03-28T20:12:12.934Z (6 months ago)
- Topics: deployment, drone-ci, drone-plugin, plugin, sftp, ssh
- Language: Python
- Size: 12.7 KB
- Stars: 7
- Watchers: 2
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Drone Deployment Plugin
## Quickstart 🚀
```yaml
kind: pipeline
name: defaultsteps:
- name: build
image: node:11-alpine
pull: always
commands:
- npm i
- npm run build:prod- name: deploy
image: cupcakearmy/drone-deploy
pull: always
settings:
host: example.org
user: root
key:
from_secret: ssh_key
# or with a password
# password: S3cr37Sh1zzl3
port: 69
target: /my/web/root/project
sources:
# To copy all the files
# - .
- ./public
- ./docker-compose.yml
- ./docker-compose.prod.yml
commands:
- docker-compose -f docker-compose.yml -f docker-compose.prod.yml down
- docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
when:
event: push
branch: master
```### Details 📒
The plugins creates a tarball compressing all the files included inside of `sources`.
Then the compressed tarball gets uploaded, extracted and deleted, leaving only the files specified by `sources` inside of the `target` folder.
Afterwards all the commands inside of `commands` will get executed at the `target` directory.### Mapping remote environment variables 🗺
Sometimes it's usefull to have a remote env with a secret. Here is how.
```yaml
kind: pipeline
name: defaultsteps:
# build...
- name: deploy
image: cupcakearmy/drone-deploy
pull: always
settings:
# host, user, port, key, when, target ...myvar: 'Something'
somesecret:
from_secret: mysecret
envs:
- myvar
- somesecret
commands:
- echo $MYENV # Outputs: Something
- echo $SOMESECRET # Outputs: Whatever is saved in drone as `mysecret`
```###### Note
If you don't want to specify single variables just use `envs: all` and all the parameters inside of `settings` will be available.All the vars will be automagically be uppercased.