Drone CI Config Generator

Generate `.drone.yml` pipelines with Docker containers, services, and pipeline triggers.

Drone CI Pipeline

Pipeline Steps

.drone.yml
1

Understanding Drone CI Configuration

What is .drone.yml?

Drone CI is a container-native continuous delivery platform. Every step of your build is executed inside an isolated Docker container that is automatically downloaded at runtime. You configure your pipelines using a .drone.yml file.

Key Concepts

#

  • Pipelines
  • A pipeline represents a single execution workflow. You can define multiple pipelines in a single file to separate different workflows (e.g., one pipeline for testing on Linux, another for Windows, another for deployment).

    #

  • Steps
  • A step represents a single command or set of commands. Because Drone is container-native, every step requires a Docker image. Steps are executed sequentially.

  • Workspace: All steps share a single workspace volume mounted to /drone/src. This means files created by step A are instantly available to step B.
  • #

  • Services
  • Services are background containers used to provide databases, message brokers, or caches required by your build steps. Services are started before the first step in your pipeline and stopped after the last step.

  • Example: Running a PostgreSQL container alongside your test suite.
  • #

  • Triggers
  • Triggers allow you to define when a pipeline should be executed. You can limit pipelines to specific branches (e.g., main) or events (e.g., push, pull_request, tag).

    Best Practices

  • Use Small Images: Since images are downloaded at runtime, use small alpine-based images to keep your pipeline execution fast.
  • Avoid Privileged Mode: Unless you are building Docker images (Docker-in-Docker), you should avoid running steps in privileged mode for security reasons.
  • Use Plugins: Drone has a massive ecosystem of plugins (which are just Docker containers) for publishing to S3, sending Slack messages, deploying to Kubernetes, etc.