docs for envs

This commit is contained in:
cupcakearmy 2019-05-25 17:22:52 +02:00
parent 75e25e8fdc
commit 0c6eb507b7

View File

@ -18,12 +18,11 @@ steps:
- name: deploy - name: deploy
image: cupcakearmy/drone-deploy image: cupcakearmy/drone-deploy
pull: always pull: always
environment:
PLUGIN_KEY:
from_secret: ssh_key
settings: settings:
host: example.org host: example.org
user: root user: root
key:
from_secret: ssh_key
port: 69 port: 69
target: /my/web/root/project target: /my/web/root/project
sources: sources:
@ -43,3 +42,32 @@ steps:
The plugins creates a tarball compressing all the files included inside of `sources`. 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. 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. 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: default
steps:
# build...
- name: deploy
image: cupcakearmy/drone-deploy
pull: always
settings:
# host, user, port, key, when, target ...
myenv: 'Something'
somesecret:
from_secret: mysecret
envs:
- myvar
- somesecret
commands:
- echo $MYENV # Outputs: Something
- echo $SOMESECRET # Outputs: Whatever is saved in drone as `mysecret`
```