2021-09-04 20:08:15 +02:00

55 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# .drone.yml
## Docker Pipeline
### Example Docker Configuration
This guide covers configuring continuous integration pipelines for projects that have a Docker dependency. If youre new to Drone please read our Tutorial and build configuration guides first.
### Basic Example
In the below example we demonstrate a pipeline that connects to the host machine Docker daemon by mounting a volume. For security reasons, only trusted repositories can mount volumes. Furthermore, mounting the host machine Docker socket is highly insecure, and should only be used in trusted environments.
```yaml
---
kind: pipeline
name: default
steps:
- name: test
image: docker:dind
volumes:
- name: dockersock
path: /var/run/docker.sock
commands:
- docker ps -a
volumes:
- name: dockersock
host:
path: /var/run/docker.sock
...
```
# SSH
```yaml
---
kind: pipeline
name: ssh deploy
steps:
- name: ssh commands
image: appleboy/drone-ssh
settings:
host:
from_secret: host
username:
from_secret: username
password:
from_secret: password
port: 22
script:
- docker run --rm sthopeless/randompwd
- docker image rm sthopeless/randompwd:latest
- mkdir ~/test
- rm -r ~/test
- echo "This is a test."
```