This document provides a high-level overview of the .drone.yml configuration file. The configuration file is placed in the root of your repository and defines one or more continuous integration or continuous delivery Pipelines.
Example pipeline configuration:
|
|
Objects
The configuration file defines one or many objects in the same file, where each object is a separate yaml document. Pipelines are one kind of object. You can also define Signature and Secret objects.
-
Example Pipeline configuration:
kind: pipeline type: docker name: default steps: - name: test image: golang commands: - go build - go test
-
Example Pipeline and Signature configuration:
--- kind: pipeline type: docker name: default steps: - name: test image: golang commands: - go build - go test --- kind: signature hmac: F10E2821BBBEA527EA02200352313BC059445190
Each object must include the kind attribute. The kind attribute identifies the kind of object being declared, and helps to distinguish one object from another.
Pipelines
The Pipeline object defines a Continuous Integration and Continuous Delivery pipeline. The type attribute defines the runtime that should be used when executing the pipeline. Drone offers support for a variety of runtimes.
-
Example Docker pipeline, which executes each pipeline steps inside isolated Docker containers.
kind: pipeline type: docker
-
Example Kubernetes pipeline, which executes pipeline steps as containers inside of Kubernetes pods.
kind: pipeline type: kubernetes
-
Example Exec pipeline, which executes pipeline steps directly on the host machine, with zero isolation.
kind: pipeline type: exec
Multiple Pipelines
When you define multiple Pipeline objects in the same configuration file, pipelines are spread across runners and executed in parallel. The below example configures two pipelines to execute in parallel. The overall build status is determined by the successful completion of both pipelines.
|
|
Multiple Platforms
One common use case for multiple pipelines is to define and execute pipelines for different platforms. For example, execute one pipeline on x86 and another pipeline on arm.
|
|
Graph Execution
Drone also supports describing your pipelines as a directed acyclic graph. In the below example we fan-out to execute the first two pipelines in parallel, and then once complete, we fan-in to execute the final pipeline.
|
|
Scripting
Drone supports custom language extensions for when you need a more powerful alternative to yaml. See the Starlark and Jsonnet documentation for more details. You can also create your own language extension.