From 1e2f7439049ee351e2c0a0060e5dd40be1810822 Mon Sep 17 00:00:00 2001 From: Greg Burd Date: Wed, 18 Oct 2023 14:09:34 -0400 Subject: [PATCH] finished setup, need to add worker(s) --- drone/README.md | 38 ++++++++++++++++++++++++++++++++++++++ drone/fly.toml | 4 +++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 drone/README.md diff --git a/drone/README.md b/drone/README.md new file mode 100644 index 0000000..10dc242 --- /dev/null +++ b/drone/README.md @@ -0,0 +1,38 @@ +# Drone, the builder for Forgejo + +This deploys Drone.io, CI builder for Forgejo (was Gitea). + +## Installation + +1. Clone this repository +1. `fly launch`, follow the prompts +1. Select `n` when it asks if you want to deploy +1. Setup the admin user account: + ```shell + fly secrets set "DRONE_USER_CREATE=username:greg,machine:false,admin:true,token:=$(openssl rand -hex 16)" + ``` +1. Check that the [user filter](https://docs.drone.io/server/reference/drone-user-filter/) `DRONE_USER_FILTER = "greg"` matches your username above. +1. Also consider setting the [repository filter](https://docs.drone.io/server/reference/drone-repository-filter/) if needed +1. Generate, and store securely, you secrets: + ```shell + fly secrets set "DRONE_RPC_SECRET=$(openssl rand -hex 16)" + ``` +1. storage you'll need to add two more secrets: + ```shell + fly secrets set \ + "DRONE_GITEA_CLIENT_ID=[redacted]" \ + "DRONE_GITEA_CLIENT_SECRET=[redacted]" + ``` +1. Deploy, `fly deploy --remote-only` +1. Setup DNS with your registrar, you must have either CNAME or A/AAAA records + set. See: https://fly.io/docs/app-guides/custom-domains-with-fly/ +1. Create certificate for Fly's automatic TLS termination. `fly certs create build.example.com` + +# Final Step + +1. Delete the Docker Engine from your local system. +1. You probably want to scale your remote Daemon: `fly scale vm dedicated-cpu-2x` and `fly scale memory 2048` + +# NOTES: + +* https://docs.drone.io/server/provider/gitea/ diff --git a/drone/fly.toml b/drone/fly.toml index fcc033c..6040e31 100644 --- a/drone/fly.toml +++ b/drone/fly.toml @@ -17,10 +17,12 @@ kill_timeout = "5s" DRONE_GITEA_SERVER = "https://git.burd.me" DRONE_JSONNET_ENABLED = "true" DRONE_REGISTRATION_CLOSED = "true" - DRONE_RPC_PROTO = "http" + DRONE_RPC_HOST = "build.burd.me" + DRONE_RPC_PROTO = "https" DRONE_RUNNER_CAPACITY = "1" DRONE_SERVER_HOST = "build.burd.me" DRONE_SERVER_PROTO = "https" + DRONE_USER_FILTER = "greg" [processes] runner = "/bin/drone-runner-docker"