Run drone-server on Cloudron
Find a file
Felix Bartels 1361023637 Simplify build process (#2)
switch cli helper to dind base
use local socket in all steps
ignore tags file
use txt file format for secrets
2020-10-17 20:43:08 +00:00
.github Create FUNDING.yml 2020-06-06 09:21:11 +02:00
helpers Simplify build process (#2) 2020-10-17 20:43:08 +00:00
runner add the runner webui to a dedicated file 2020-10-09 13:55:33 +02:00
.dockerignore move runner into subfolder 2020-06-07 17:07:27 +02:00
.drone.yml Simplify build process (#2) 2020-10-17 20:43:08 +00:00
.gitignore Simplify build process (#2) 2020-10-17 20:43:08 +00:00
CloudronManifest.json add logo 2020-06-09 12:08:43 +02:00
Dockerfile update drone and surfer to the latest version 2020-10-08 14:41:04 +02:00
LICENSE.txt add license 2020-06-10 14:50:51 +02:00
logo.png add logo 2020-06-09 12:08:43 +02:00
Makefile Add helper for cli and use it to update the drone server itself (#1) 2020-10-16 21:50:57 +00:00
README.md Simplify build process (#2) 2020-10-17 20:43:08 +00:00
start.sh add logo 2020-06-09 12:08:43 +02:00
supervisor-drone-server.conf Add scripting to run drone-server on Cloudron 2020-06-05 22:25:57 +02:00

Drone CI for Cloudron

Run the Drone server on Cloudron and the agents locally.

I am using this setup together with a Gitea running on the same Cloudron installation.

What is Sponsorware?

This project is published as Sponsorware. Which means it is (at first) only available for those that sponsor my work (for example on Github) and therefore allow me to spent time on it. I have collected some thoughs on Sponsorware on my blog.

Requirements

  • docker-compose (on the system where you want to run the agent)
  • git
  • jq
  • make
  • Cloudron CLI

Installation

  • Run DOCKER_REPO=your-docker-hub-user make install to install the Drone server component at drone.yourdomain.com (yourdomain.com automatically adapts to your Cloudron setup)
  • Run make exec to open the cli of the app and modify .env so that it can connect to your Git instance
  • Run cloudron restart to restart the app and apply your changes
  • Verify that your setup works by going to https://drone.yourdomain.com
  • If all looks good run runner/start.sh to start the Drone agent on your local machine (will fetch credentials from the installed app directly)
  • Add the Drone configuration to your desired repositories

Tips and Tricks

I would also like to share some very useful commands. To install drone CLI, follow official docs.

Using drone-cli

Go to your user settings and get login information

export DRONE_SERVER=https://drone.9wd.eu
export DRONE_TOKEN=your token
drone info

Executing pipelines directly

You can also run pipelines directly with the Drone CLI:

drone exec --secret-file secrets.txt .drone.yml

A template for secrets.txt:

slack_url=https://hooks.slack.com/services/xxxxxxxxxxxx

Adding secrets through CLI

You can either add secrets through the web UI or use drone directly from your terminal:

drone secret add -repository username/repository-name --name foo --data bar --allow-pull-request

Inspiration