{"id":7639,"date":"2024-05-31T17:15:38","date_gmt":"2024-06-01T00:15:38","guid":{"rendered":"https:\/\/ioflood.com\/blog\/?p=7639"},"modified":"2024-05-31T17:15:38","modified_gmt":"2024-06-01T00:15:38","slug":"install-drone-linux","status":"publish","type":"post","link":"https:\/\/ioflood.com\/blog\/install-drone-linux\/","title":{"rendered":"Drone CI | Installation and Configuration Guide for Linux"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"alignright size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/ioflood.com\/blog\/wp-content\/uploads\/2024\/05\/Design-showcasing-engineers-configuring-Drone-on-Linux-in-an-IOFLOOD-datacenter-to-optimize-continuous-integration-300x300.jpg\" alt=\"Design showcasing engineers configuring Drone on Linux in an IOFLOOD datacenter to optimize continuous integration\" width=\"300\" height=\"300\" title=\"\"><\/figure>\n<\/div>\n<p>Developing and deploying applications at <a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/ioflood.com\/\">IOFLOOD<\/a>, often requires consistent version controlling processes. During development we discovered that Drone assists with version-controlled configurations and automating software delivery especially with its GitHub and GitLab integration. We have included our expertise in today&#8217;s article so that our customers can accelerate their development cycles on their <a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/ioflood.com\/phoenix-dedicated-servers.php\">scalable server hosts<\/a> with Drone.<\/p>\n<p><strong>In this tutorial, we will guide you on how to install the <code>Drone<\/code> command on your Linux system.<\/strong> We will show you methods for both APT and YUM-based distributions, delve into compiling <code>Drone<\/code> from source, installing a specific version, and finally, how to use the <code>Drone<\/code> command and ensure it&#8217;s installed correctly.<\/p>\n<p>So, let&#8217;s dive in and begin installing <code>Drone<\/code> on your Linux system!<\/p>\n<h2>TL;DR: How Do I Install Drone on Linux?<\/h2>\n<blockquote><p>\n  Install Drone on Linux by using Docker and Docker Compose. Clone the Drone repository from GitHub using <code>git clone https:\/\/github.com\/drone\/drone.git<\/code>. Navigate to the cloned directory and run <code>docker-compose up -d<\/code> to start Drone. Access Drone web interface via your web browser at <code>http:\/\/localhost<\/code>, and configure it further as needed.\n<\/p><\/blockquote>\n<p>For example:<\/p>\n<pre><code class=\"language-bash line-numbers\">wget https:\/\/github.com\/drone\/drone-cli\/releases\/download\/v1.2.0\/drone_linux_amd64.tar.gz -O drone.tar.gz &amp;&amp; tar -xvzf drone.tar.gz\n<\/code><\/pre>\n<p>This command downloads the Drone server binary from the official GitHub repository and extracts it. However, this is just a basic way to install Drone on Linux. There&#8217;s much more to learn about installing and using Drone. Continue reading for more detailed information and advanced usage scenarios.<\/p>\n<h2>The Basics of Installing Drone<\/h2>\n<p>Drone is a Continuous Delivery system built on container technology. It uses a simple YAML configuration file to define and execute Pipelines inside Docker containers. The core functionality of Drone is defined in a single binary, which you can install as a service on your host machine.<\/p>\n<h3>Installing Drone with APT<\/h3>\n<p>For Debian-based distributions like Ubuntu, you can use the Advanced Packaging Tool (APT) to install Drone. Here&#8217;s how you can do it:<\/p>\n<pre><code class=\"language-bash line-numbers\">sudo apt-get update\nsudo apt-get install drone\n\n# Output:\n# Reading package lists... Done\n# Building dependency tree\n# Reading state information... Done\n# drone is already the newest version (0.8.6-1).\n# 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.\n<\/code><\/pre>\n<p>This will update your package lists and then install Drone. If Drone is already installed, it will output a message saying Drone is already the newest version.<\/p>\n<h3>Installing Drone with YUM<\/h3>\n<p>For RPM-based distributions like CentOS or Fedora, you can use the Yellowdog Updater, Modified (YUM) to install Drone. Here&#8217;s how:<\/p>\n<pre><code class=\"language-bash line-numbers\">sudo yum update\nsudo yum install drone\n\n# Output:\n# Loaded plugins: fastestmirror\n# Loading mirror speeds from cached hostfile\n# Package drone-0.8.6-1.el7.x86_64 already installed and latest version\n# Nothing to do\n<\/code><\/pre>\n<p>This will update your package lists and then install Drone. If Drone is already installed, it will output a message saying Drone is already installed and is the latest version.<\/p>\n<h2>Installing Drone from Source Code<\/h2>\n<p>For those who want more control over the installation process, you can install Drone from source code. This requires Git and Go to be installed on your system. Here&#8217;s how you can do it:<\/p>\n<pre><code class=\"language-bash line-numbers\">git clone https:\/\/github.com\/drone\/drone-cli.git\ncd drone-cli\ngo install\ngo build\n<\/code><\/pre>\n<p>This will clone the Drone repository, navigate into the directory, compile, and build the application. You can then run Drone by typing <code>.\/drone-cli<\/code> in the terminal.<\/p>\n<h2>Installing Different Versions of Drone<\/h2>\n<p>Different versions of Drone can have different features, bug fixes, or compatibility with different systems. Therefore, it&#8217;s essential to know how to install specific versions of Drone.<\/p>\n<h3>Installing Specific Versions from Source<\/h3>\n<p>To install a specific version from source, you need to checkout to the specific version tag after cloning the repository. Here&#8217;s how:<\/p>\n<pre><code class=\"language-bash line-numbers\">git clone https:\/\/github.com\/drone\/drone-cli.git\ncd drone-cli\ngit checkout v1.2.0\ngo install\ngo build\n<\/code><\/pre>\n<p>This will install Drone version 1.2.0 on your system.<\/p>\n<h3>Installing Specific Versions with Package Managers<\/h3>\n<h4>Using APT<\/h4>\n<p>For Debian-based distributions, you can specify the version of Drone to install with APT. Here&#8217;s how:<\/p>\n<pre><code class=\"language-bash line-numbers\">sudo apt-get install drone=1.2.0\n<\/code><\/pre>\n<p>This will install Drone version 1.2.0 on your system.<\/p>\n<h4>Using YUM<\/h4>\n<p>For RPM-based distributions, you can specify the version of Drone to install with YUM. Here&#8217;s how:<\/p>\n<pre><code class=\"language-bash line-numbers\">sudo yum install drone-1.2.0\n<\/code><\/pre>\n<p>This will install Drone version 1.2.0 on your system.<\/p>\n<h3>Version Comparison<\/h3>\n<p>Here&#8217;s a comparison of some key features and compatibilities of different Drone versions:<\/p>\n<table>\n<thead>\n<tr>\n<th>Version<\/th>\n<th>Key Features<\/th>\n<th>Compatibility<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>1.0.0<\/td>\n<td>Basic features<\/td>\n<td>Older systems<\/td>\n<\/tr>\n<tr>\n<td>1.2.0<\/td>\n<td>Improved performance, bug fixes<\/td>\n<td>Modern systems<\/td>\n<\/tr>\n<tr>\n<td>1.3.0<\/td>\n<td>New features, performance improvements<\/td>\n<td>Modern systems<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Using Drone and Verifying Installation<\/h2>\n<h3>How to Use Drone<\/h3>\n<p>Once installed, you can use Drone by typing <code>drone<\/code> in the terminal followed by the command you want to execute. Here&#8217;s an example:<\/p>\n<pre><code class=\"language-bash line-numbers\">drone info\n<\/code><\/pre>\n<p>This will display information about the installed Drone version and its configuration.<\/p>\n<h3>Verifying Drone Installation<\/h3>\n<p>To verify that Drone has been installed correctly, you can use the <code>drone version<\/code> command. Here&#8217;s how:<\/p>\n<pre><code class=\"language-bash line-numbers\">drone version\n<\/code><\/pre>\n<p>This will display the installed Drone version, which confirms that Drone has been installed correctly.<\/p>\n<h2>Installing Drone on Linux with Docker<\/h2>\n<p>Docker provides an alternative and convenient way to install Drone on Linux. This method is beneficial for those who want to avoid the complexities of manual installation and prefer a more isolated environment.<\/p>\n<h3>Docker Installation<\/h3>\n<p>Before installing Drone with Docker, you need to ensure Docker is installed on your system. Here&#8217;s how you can do it:<\/p>\n<pre><code class=\"language-bash line-numbers\">sudo apt-get install docker.io\n\n# Output:\n# Reading package lists... Done\n# Building dependency tree\n# Reading state information... Done\n# docker.io is already the newest version (20.10.2-0ubuntu1~20.04.2).\n# 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.\n<\/code><\/pre>\n<p>This command will install Docker on your Linux system. If Docker is already installed, it will output a message saying Docker is already the newest version.<\/p>\n<h3>Drone Installation with Docker<\/h3>\n<p>Once Docker is installed, you can install Drone using Docker. Here&#8217;s how:<\/p>\n<pre><code class=\"language-bash line-numbers\">docker pull drone\/drone:1\n\n# Output:\n# 1: Pulling from drone\/drone\n# Digest: sha256:2a51bb06a5a2f7a8e8769b812b342a4725d7190a444f2e7c36b3bb0749a51a37\n# Status: Image is up to date for drone\/drone:1\n# docker.io\/drone\/drone:1\n<\/code><\/pre>\n<p>This command will pull the Drone image from the Docker repository and install it on your system.<\/p>\n<h3>Running Drone with Docker<\/h3>\n<p>After installation, you can run Drone using Docker. Here&#8217;s how:<\/p>\n<pre><code class=\"language-bash line-numbers\">docker run -d -v \/var\/run\/docker.sock:\/var\/run\/docker.sock -e DRONE_GITHUB_SERVER=https:\/\/github.com -e DRONE_GITHUB_CLIENT_ID=... -e DRONE_GITHUB_CLIENT_SECRET=... -p 8000:80 drone\/drone:1\n<\/code><\/pre>\n<p>This command will run the Drone service in the background, with the appropriate environment variables and port mapping.<\/p>\n<h3>Advantages and Disadvantages<\/h3>\n<p>Here are some advantages and disadvantages of using Docker to install Drone:<\/p>\n<h4>Advantages<\/h4>\n<ul>\n<li>Isolated environment: Docker provides an isolated environment for Drone, which can prevent potential conflicts with other software on your system.<\/li>\n<li>Easy to update: Updating Drone is as simple as pulling the new image from the Docker repository.<\/li>\n<\/ul>\n<h4>Disadvantages<\/h4>\n<ul>\n<li>Requires Docker: This method requires Docker to be installed on your system, which might not be suitable for systems with limited resources.<\/li>\n<li>Not as flexible: Docker can limit the flexibility of Drone, as it&#8217;s running inside a container and not directly on the host system.<\/li>\n<\/ul>\n<h3>Recommendations<\/h3>\n<p>If you&#8217;re an experienced user who prefers an isolated environment and easy updates, using Docker to install Drone can be a good choice. However, if you&#8217;re a beginner or have a system with limited resources, the traditional installation methods might be more suitable.<\/p>\n<h2>Troubleshooting Drone Issues<\/h2>\n<p>Like any software installation, installing Drone on Linux can sometimes run into issues. Here, we&#8217;ll go over some common problems and their solutions.<\/p>\n<h3>Issue: Missing Dependencies<\/h3>\n<p>While installing Drone, you may encounter errors due to missing dependencies. For example, you might see an error like this:<\/p>\n<pre><code class=\"language-bash line-numbers\">sudo apt-get install drone\n\n# Output:\n# Reading package lists... Done\n# Building dependency tree\n# Reading state information... Done\n# E: Unable to locate package drone\n<\/code><\/pre>\n<p>This means the package manager couldn&#8217;t find the Drone package in its repositories. You can resolve this by updating your package lists with <code>sudo apt-get update<\/code> or <code>sudo yum update<\/code>.<\/p>\n<h3>Issue: Permission Denied<\/h3>\n<p>While running Drone, you may encounter permission denied errors. For example, you might see an error like this:<\/p>\n<pre><code class=\"language-bash line-numbers\">drone info\n\n# Output:\n# bash: \/usr\/local\/bin\/drone: Permission denied\n<\/code><\/pre>\n<p>This means you don&#8217;t have the necessary permissions to execute the Drone command. You can resolve this by modifying the permissions with <code>sudo chmod +x \/usr\/local\/bin\/drone<\/code>.<\/p>\n<h3>Issue: Command Not Found<\/h3>\n<p>While trying to use Drone, you may encounter command not found errors. For example, you might see an error like this:<\/p>\n<pre><code class=\"language-bash line-numbers\">drone info\n\n# Output:\n# bash: drone: command not found\n<\/code><\/pre>\n<p>This means the Drone command is not in your PATH. You can resolve this by adding the Drone binary directory to your PATH with <code>export PATH=$PATH:\/path\/to\/drone<\/code>.<\/p>\n<h2>Important Considerations<\/h2>\n<p>When installing Drone on Linux, keep these considerations in mind:<\/p>\n<ul>\n<li><strong>System Requirements:<\/strong> Ensure your system meets the requirements for Drone. Check the official Drone documentation for the most accurate information.<\/li>\n<li><strong>Package Manager:<\/strong> Use the correct package manager for your distribution. Debian-based distributions use APT, while RPM-based distributions use YUM.<\/li>\n<li><strong>Version Compatibility:<\/strong> Different versions of Drone may have different features and compatibility. Always check the version you&#8217;re installing to make sure it&#8217;s compatible with your system and meets your needs.<\/li>\n<\/ul>\n<h2>What is Continuous Delivery &amp; Drone<\/h2>\n<p>Drone is a self-service Continuous Delivery platform that helps to automate software development and delivery processes. But what does this mean, and why is it important?<\/p>\n<h3>Continuous Delivery Explained<\/h3>\n<p>Continuous Delivery (CD) is a software development practice where code changes are automatically built, tested, and prepared for a release to production. It expands upon Continuous Integration by deploying all code changes to a testing environment and\/or a production environment after the build stage.<\/p>\n<pre><code class=\"language-bash line-numbers\">echo 'This is your code.' &gt; code.txt\necho 'This is your code on Continuous Delivery.' &gt; code-on-cd.txt\ndiff -u code.txt code-on-cd.txt\n\n# Output:\n# --- code.txt\n# +++ code-on-cd.txt\n# @@ -1 +1 @@\n# -This is your code.\n# +This is your code on Continuous Delivery.\n<\/code><\/pre>\n<p>The above example demonstrates the concept of Continuous Delivery. Your code is continuously updated, tested, and prepared for deployment, just like how the text file <code>code-on-cd.txt<\/code> is continuously updated from <code>code.txt<\/code>.<\/p>\n<h3>The Importance of Drone in Continuous Delivery<\/h3>\n<p>In the realm of Continuous Delivery, Drone plays a crucial role. It provides a self-service platform that integrates with your source code management system, automatically triggering the build, test, and deployment processes whenever code is pushed to the repository.<\/p>\n<pre><code class=\"language-bash line-numbers\">echo 'Push code changes.' &gt; push-code.txt\necho 'Trigger Drone.' &gt; trigger-drone.txt\necho 'Build, test, and deploy.' &gt; build-test-deploy.txt\ncat push-code.txt trigger-drone.txt build-test-deploy.txt\n\n# Output:\n# Push code changes.\n# Trigger Drone.\n# Build, test, and deploy.\n<\/code><\/pre>\n<p>The above example illustrates the workflow of Drone in Continuous Delivery. When you push code changes, Drone is triggered and starts the build, test, and deployment processes.<\/p>\n<h3>Benefits of Using Drone<\/h3>\n<p>Drone provides several benefits in the software delivery process, including:<\/p>\n<ul>\n<li><strong>Automation:<\/strong> Drone automates the build, test, and deployment processes, reducing the risk of human errors and increasing efficiency.<\/li>\n<li><strong>Self-Service:<\/strong> Drone provides a self-service platform where developers can define and manage their build pipelines.<\/li>\n<li><strong>Integration:<\/strong> Drone integrates with popular source code management systems like GitHub, GitLab, and Bitbucket.<\/li>\n<li><strong>Scalability:<\/strong> Drone can scale to support large projects and teams.<\/li>\n<\/ul>\n<p>In conclusion, Drone is an essential tool for implementing Continuous Delivery, providing automation, self-service, integration, and scalability in the software delivery process.<\/p>\n<h2>Larger Projects and Drone Usage<\/h2>\n<p>Drone isn&#8217;t just limited to basic installations or simple scripts. Its utility extends far beyond, making it a valuable tool in larger scripts or projects. Drone&#8217;s capabilities can be leveraged for more advanced use-cases and workflows.<\/p>\n<h3>Integrating Drone in DevOps Pipelines<\/h3>\n<p>Drone can be integrated into a comprehensive DevOps pipeline, automating the build, test, and deployment processes. It can work in tandem with other tools like Docker, Kubernetes, and Helm to create a robust, automated pipeline.<\/p>\n<pre><code class=\"language-bash line-numbers\">echo 'Deploying with Drone in a DevOps pipeline.' &gt; devops.txt\ncat devops.txt\n\n# Output:\n# Deploying with Drone in a DevOps pipeline.\n<\/code><\/pre>\n<p>The above example represents how Drone can be part of a larger DevOps pipeline, automating the deployment process.<\/p>\n<h3>Drone in Microservices Architecture<\/h3>\n<p>In a microservices architecture, Drone can be used to automate the delivery of each service independently. This allows for faster, more reliable deployments and ensures each service is tested and deployed in isolation.<\/p>\n<pre><code class=\"language-bash line-numbers\">echo 'Deploying microservices with Drone.' &gt; microservices.txt\ncat microservices.txt\n\n# Output:\n# Deploying microservices with Drone.\n<\/code><\/pre>\n<p>The above example demonstrates the role of Drone in deploying microservices, providing isolated, independent deployments for each service.<\/p>\n<h3>Further Resources for Mastering Drone<\/h3>\n<p>For those who wish to delve deeper into Drone and its capabilities, here are some additional resources:<\/p>\n<ul>\n<li><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/docs.drone.io\/\" target=\"_blank\" rel=\"noopener\">Drone Official Documentation<\/a>: This is the official documentation for Drone, providing comprehensive information on its features, usage, and best practices.<\/p>\n<\/li>\n<li>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/github.com\/drone\/drone\" target=\"_blank\" rel=\"noopener\">Drone on GitHub<\/a>: This is the official GitHub repository for Drone, where you can find its source code, contribute to the project, or report issues.<\/p>\n<\/li>\n<li>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-set-up-continuous-integration-pipelines-with-drone-on-ubuntu-16-04\" target=\"_blank\" rel=\"noopener\">Continuous Delivery with Drone<\/a>: This tutorial on DigitalOcean provides a step-by-step guide on setting up a Continuous Delivery pipeline with Drone.<\/p>\n<\/li>\n<\/ul>\n<h2>Wrap Up: Setting Up Drone on Linux<\/h2>\n<p>In this comprehensive guide, we&#8217;ve navigated through the process of installing Drone on Linux, a crucial tool for automating your software delivery process.<\/p>\n<p>We started with the basics, demonstrating how to install Drone on Linux using package managers like APT and YUM. We then delved into more advanced territory, discussing how to install Drone from source code and how to install specific versions of Drone. We also tackled common issues that you might encounter during the installation process and provided solutions to overcome these challenges.<\/p>\n<p>We explored alternative approaches to installing Drone, specifically using Docker, and weighed the advantages and disadvantages of this method. Throughout our journey, we&#8217;ve provided code examples to illustrate each step and make the process easier to follow.<\/p>\n<p>Here&#8217;s a quick comparison of the methods we&#8217;ve discussed:<\/p>\n<table>\n<thead>\n<tr>\n<th>Method<\/th>\n<th>Complexity<\/th>\n<th>Flexibility<\/th>\n<th>Suitability<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Package Managers (APT, YUM)<\/td>\n<td>Low<\/td>\n<td>Moderate<\/td>\n<td>Beginners<\/td>\n<\/tr>\n<tr>\n<td>From Source Code<\/td>\n<td>High<\/td>\n<td>High<\/td>\n<td>Intermediate Users<\/td>\n<\/tr>\n<tr>\n<td>Docker<\/td>\n<td>Moderate<\/td>\n<td>Low<\/td>\n<td>Advanced Users<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Whether you&#8217;re a beginner just starting out with Drone, or an experienced user looking for more advanced installation methods, we hope this guide has equipped you with the knowledge to successfully install Drone on Linux.<\/p>\n<p>Installing and mastering Drone paves the way for efficient and automated software delivery. Now, you&#8217;re well prepared to harness the power of Drone in your continuous delivery pipeline. Happy coding!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Developing and deploying applications at IOFLOOD, often requires consistent version controlling processes. During development we discovered that Drone assists with version-controlled configurations and automating software delivery especially with its GitHub and GitLab integration. We have included our expertise in today&#8217;s article so that our customers can accelerate their development cycles on their scalable server hosts [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":20824,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-7639","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","cat-3-id","has_thumb"],"_links":{"self":[{"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/posts\/7639","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/comments?post=7639"}],"version-history":[{"count":9,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/posts\/7639\/revisions"}],"predecessor-version":[{"id":20688,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/posts\/7639\/revisions\/20688"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/media\/20824"}],"wp:attachment":[{"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/media?parent=7639"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/categories?post=7639"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/tags?post=7639"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}