This repository provides configuration and instructions for how to get started with Drone CI
README.md |
drone-quickstart
This repository provides configuration and instructions for how to get started with Drone CI from Harness on Forgejo
Prerequisites
- Comfortable running commands in the terminal
- A Forgejo account
- A ngrok account
- A computer that can run amd64 or arm64 Docker containers (this includes the new M1-based Macs)
- In your terminal, verify you have
docker
anddocker-compose
commands available
- In your terminal, verify you have
Tools used
- Docker - for running the Drone and Drone Docker Runner processes
- ngrok - creates a tunnel between your local Drone docker container and the outside world, allowing it to receive webhooks from GitHub
Steps
Create the tunnel
- Login to https://ngrok.com
- Open https://dashboard.ngrok.com/get-started/setup, follow the steps to install the ngrok binary and connect to your account
- Create the tunnel by running
ngrok http 8080
in your terminal, do not stop the process until you are finished with this guide ngrok
will create your tunnel and provide you with a URL such ashttps://abcd-3fg-hij-k1-mn.ngrok.io
, make a note of it
Create the GitHub OAuth Application
- Follow Drone's Create an OAuth Application documentation
- For the "Homepage URL", enter the
ngrok
URL from the previous step - For the "Authorization callback URL", enter the same
ngrok
URL, with/login
appended - You will be given the "Client ID" and a "Client secret", make a note of each (the secret is only displayed once, if you misplace it, you will need to generate a new client secret)
Start the Drone and Drone Runner processes
- Fork this repository and clone the fork to your computer
- Edit the file
run.sh
- Set
DRONE_GITEA_CLIENT_ID
andDRONE_GITEA_CLIENT_SECRET
using the "Client ID" and "Client secret" from the previous step - Set
DRONE_GITEA_SERVER
Required string value provides your Forgejo server address. - Set
DRONE_GIT_ALWAYS_AUTH
configures Drone to authenticate when cloning public repositories. - Set
DRONE_SERVER_HOST
to yourngrok
URL, without thehttps://
(if yourngrok
URL ishttps://abcd-3fg-hij-k1-mn.ngrok.io
, setDRONE_SERVER_HOST
toabcd-3fg-hij-k1-mn.ngrok.io
) - Set
DRONE_SERVER_PROTO
This value should be set to http or https. - Save your changes
- Open a new terminal session and change to the directory where you checked out this repository
- Execute
run.sh
by typing./run.sh
and hitting enter - Open your
ngrok
URL in a browser, you should be greeted with "Welcome to Drone"! 🎉
Activate your repository
- Click "Continue", you will be prompted to authorize your OAuth application in your GitHub account
- Next you should see the dashboard, if you do not see any repositories, click the "Sync" button
- Your forked repository should now appear in the list, click the repository and then click "Activate Repository"