07.06.2023

How to install and configure Drone on Ubuntu 20.04 server

Introduction

CI/CD - Response to specific requests or triggers when working with containers,
or any other project, that is, acts as a notification of changes in the project.

Simplifies the work with notification, storing results, as well as publishing various projects.

Drone CI also has a free SaaS (software as a service) plan that is available for open source projects.

Integrates with Github, Bitbucket, Gitea. Configuration is customizable thanks to yaml (+ starlark and jsconnet).

It doesn't require a lot of resources to make it work, which saves on hardware and gets you started with Dorne even on weak devices.

It requires Docker to be pre-installed, in my publication i will able to use pre-installed version of Docker.

To install Docker, use our instructions or create a server in Serverspace with the application already installed.

Required dependencies for deploy

Preliminary configuration of machine

Visit page of account settings, and create access there to delegate our machine for github.

Generate your own OAuth application by first changing domain-name to subdomain "drone.****".

You can use your own ip address of your server by replacing the domain
"http://yourip" in the homepage URL tab to "http://yourip/login".

Copy your client id, as well as create an authorization key, its will be needed later.

Configure machine

Create RPC server key.

openssl rand -hex 16

Create and configure the local config.

nano /etc/drone

DRONE_SERVER_HOST=drone.steammmmm.space
#Host of your subdomain
DRONE_SERVER_PROTO=http
#what type of connection you will use
DRONE_GITHUB_CLIENT_ID=id_from_git_OAuth
#Client id from github
DRONE_GITHUB_CLIENT_SECRET=secret_from_github
#Secret from github
DRONE_RPC_SECRET=secret_from_server
#rpc password that we created on server
DRONE_USER_CREATE=username:barikasss,admin:true
#Username of your profile github

The full list of available configuration file options is located on the developer page.

Installing application

Setup the latest version of software.

docker pull drone/drone:1

Create a database for application.

docker volume create drone-base

Launch software.

docker run --name=dronegit --detach --restart=always --env-file=/etc/drone --volume=drone-base --publish=80:80 --publish=443:443 drone/drone:1

Check

Go to your ip-address that you specified in your profile, you will see the authorization window on github.

After authorization , you will ascertain the drone interface.

Conclusion

There are a lot of CI and CD products on the market that allow take them for free,
but each has its own limitations for commercial use.
Drone CI :