How to Install Drone on EndeavourOS

Drone is a popular open-source continuous integration (CI) and continuous delivery (CD) tool. In this tutorial, we will show you how to install Drone on EndeavourOS.

Prerequisites

Before you start, make sure you have the following prerequisites:

Step 1 - Create a GitHub OAuth App

To use Drone, you need to create a GitHub OAuth App.

  1. Log in to your GitHub account and go to Settings.

  2. Click on Developer settings and then click on OAuth Apps.

  3. Click on Register a new application.

  4. Fill in the form with the following information:

    • Application name: Any name you want.
    • Homepage URL: The URL to your Drone server.
    • Authorization callback URL: The URL to your Drone server followed by /login.
  5. Click on Register application.

  6. Keep the Client ID and Client Secret safe. You will need them in the next step.

Step 2 - Run a Drone Server

To run a Drone server, you need to start a Docker container with the Drone image.

  1. Open a terminal.

  2. Run the following command to download the Drone Docker image:

    docker pull drone/drone:1
    
  3. Run the following command to start the Drone server:

    docker run \
      --volume=/var/run/docker.sock:/var/run/docker.sock \
      --env=DRONE_GITHUB_CLIENT_ID=<YOUR_CLIENT_ID> \
      --env=DRONE_GITHUB_CLIENT_SECRET=<YOUR_CLIENT_SECRET> \
      --env=DRONE_SERVER_HOST=<YOUR_SERVER_URL> \
      --env=DRONE_SERVER_PROTO=http \
      --env=DRONE_RPC_SECRET=<SECRET_TOKEN> \
      --publish=80:80 \
      --detach=true \
      --name=drone \
      drone/drone:1
    

    Replace <YOUR_CLIENT_ID>, <YOUR_CLIENT_SECRET>, <YOUR_SERVER_URL>, and <SECRET_TOKEN> with the actual values.

    • <YOUR_CLIENT_ID>: The Client ID you got from GitHub.
    • <YOUR_CLIENT_SECRET>: The Client Secret you got from GitHub.
    • <YOUR_SERVER_URL>: The URL to your Drone server (e.g., http://localhost or http://your-domain-name).
    • <SECRET_TOKEN>: Any random string you want to use as a secret token.
  4. Check that the Drone server is running by opening your web browser and going to <YOUR_SERVER_URL>. You should see the Drone login page.

Step 3 - Run a Drone Agent

To run a Drone agent, you need to start another Docker container with the Drone agent image.

  1. Open another terminal.

  2. Run the following command to download the Drone agent Docker image:

    docker pull drone/drone-runner-docker:1
    
  3. Run the following command to start the Drone agent:

    docker run -d \
      -v /var/run/docker.sock:/var/run/docker.sock \
      -e DRONE_RPC_PROTO=http \
      -e DRONE_RPC_HOST=<YOUR_SERVER_URL> \
      -e DRONE_RPC_SECRET=<SECRET_TOKEN> \
      -e DRONE_RUNNER_CAPACITY=2 \
      --name runner \
      --restart always \
      drone/drone-runner-docker:1
    

    Replace <YOUR_SERVER_URL> and <SECRET_TOKEN> with the actual values.

    • <YOUR_SERVER_URL>: The URL to your Drone server (e.g., http://localhost or http://your-domain-name).
    • <SECRET_TOKEN>: The same secret token you used in Step 2.
  4. Check that the Drone agent is running by going to the Drone server web interface and clicking on the Agents tab. You should see the new agent listed there.

Congratulations! You have successfully installed Drone on EndeavourOS. You can now create your first build pipeline and start testing and deploying your applications with Drone.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!