Skip to content

Drone CI/CD

Drone is a Container-Native Continuous Integration and Continuous Delivery (CI/CD) platform designed to automate testing, building, and deployment workflows.^[400-devops-04-ci-cd-pipelines-drone.md]

Licensing and Build Limits

By default, the open-source version of Drone includes a restriction limiting the number of builds to 5,000.^[400-devops-04-ci-cd-pipelines-drone.md] To bypass this limitation, users must manually compile the server binary using the go build command with specific tags^[400-devops-04-ci-cd-pipelines-drone.md] (e.g., nolimit).

Compilation

The source code provides instructions for building both the open-source and enterprise editions from source.^[400-devops-04-ci-cd-pipelines-drone.md]

Building Locally

To build the server locally, the following commands are used^[400-devops-04-ci-cd-pipelines-drone.md]:

# Open-source build (with limits removed)
$ go build -tags "oss nolimit" github.com/drone/drone/cmd/drone-server

# Enterprise build
$ go build -tags "nolimit" github.com/drone/drone/cmd/drone-server

Containerized Build

A Dockerfile is provided to create a container image with a version of Drone that has no functional limits (version 2.15.0 is cited as an example).^[400-devops-04-ci-cd-pipelines-drone.md]

This multi-stage build process involves^[400-devops-04-ci-cd-pipelines-drone.md]: 1. Builder Stage: Uses golang:1.18-alpine to download the Drone source and compile the binary with the -tags="nolimit" flag. 2. Certs Stage: Uses alpine:3.13 to generate necessary SSL certificates. 3. Final Stage: Uses alpine:3.16 to set up the runtime environment, configuring environment variables for database drivers, server ports, and runner architecture, before copying the compiled binary and certificates into the final image^[400-devops-04-ci-cd-pipelines-drone.md].

Integration

The source material suggests using Drone in conjunction with Gitea for version control needs^[400-devops-04-ci-cd-pipelines-drone.md].

Sources

  • 400-devops-04-ci-cd-pipelines-drone.md