Skip to main content

Drone.io CI setup

Drone.io CI setup

Drone.io is a Continuous Integration for Github and Bitbucket that monitors your code for bugs. It uses GitHub (or some other online service) to fetch repositories and Docker containers to run the build process.
It can be used as a service (free for public projects), or set up on a custom server for free.
On this page it is described how Drone was configured to build OpenWrt project hosted on GitHub.

Steps

Install and start Docker

This step depends on your build machine so it is not going to be covered here. Please refer to official Docker documentation and see how to install Docker on your machine.

Create Github application

Click the link and create a new application. In this example we are using:
Homepage URL: http://tango.drone.openwrt.ninja/ 
Authorization callback URL: http://tango.drone.openwrt.ninja/authorize
There you will get Client ID and Client Secret. You will use that in the next step.

Create Drone config file

On the host create the file /etc/drone/dronerc with the following content:
REMOTE_DRIVER=github
REMOTE_CONFIG=https://github.com?client_id=&client_secret=

DATABASE_DRIVER=sqlite3
DATABASE_CONFIG=/var/lib/drone/drone.sqlite

Create //.drone.yml// file

In this customized version the .drone.yml must be located on the path /var/lib/drone/.drone.yml. This path is now hard-coded. An example .drone.yml is given as follows:
build:
  image: "sartura/drone-openwrt-builder:arch"
  commands:
    - export FORCE_UNSAFE_CONFIGURE=1
    - make defconfig
    - make -j8
Or to build with a customized configuration:
build:
  image: "owrt/drone-openwrt-builder:arch"
  commands:
    - export FORCE_UNSAFE_CONFIGURE=1
    - make defconfig
    - wget 'https://raw.githubusercontent.com/openwrt-ninja/openwrt-configs/master/default-x86.config' -O .config
    - ./scripts/config/conf --alldefconfig Config.in
    - make -j8

Run Drone Docker container

We are hosting prebuilt Drone Docker images in Docker Hub using the owrt id. That said, if you have followed the above instructions and have Docker up and running this should bring up your own Drone instance:
docker run \\
  --volume /var/lib/drone:/var/lib/drone \\
  --volume /var/run/docker.sock:/var/run/docker.sock \\
  --env-file /etc/drone/dronerc \\
  --restart=always \\
  --publish=80:8000 \\
  --detach=true \\
  --name=drone \\
  owrt/drone:v42-static-recipe

Drone customization

Since OpenWrt builds take a while to complete make sure to increase Timeout in Minutes to a maximum value of 900 minutes.

TODOs

Builds for all architectures

At the moment only the defconfig is built. We should change it so every supported architecture is build tested with Drone CI.

Customization of the drone "continuous-integration/drone" string per architecture and donation

In the Drone CI version 0.4.2 shows hardcoded string on GitHub builds ("continuous-integration/drone"). We are going to chage this so it is clearly visisible which drone build what and if it was sucessful.

Package builds

When a pull request is made for a certain package we should build this minimal version of OpenWrt with the package in question and its dependencies. This can be done but additional scripting inside Drone CI system is needed.

Optimization of the build process

Now, on every pull request everything is built from scratch. We should optimize the process so it does not build the entire toolchain every time and that we use a mirror close to the build servers to download all 3rd party sources.

Comments

Popular posts from this blog

fix idm integration on chrome

Chrome Browser Integration I do not see IDM extension in Chrome extensions list. How can I install it?  How to configure IDM extension for Chrome? Please note that all IDM extensions that can be found in Google Store are fake and should not be used. You need to install IDM extension manually from IDM installation folder. Read in step 2 how to do it . 1. Please update IDM to the latest version by using  "IDM Help->Check for updates..."  menu item 2.  I don't see  "IDM Integration module"  extension in the list of extensions in  Chrome . How can I install it? Press on  Chrome  menu ( arrow 1  on the image), select  "Settings"  menu item ( arrow 2  on the image) and then select  "Extensions"  tab ( arrow 3  on the image). After this open IDM installation folder ( "C:\Program Files (x86)\Internet Download Manager"  by default,  arrow 4  on the image) and drag and drop  "IDMGCExt.crx"  ( arrow 5  on the image) file int

Hidden Wiki

Welcome to The Hidden Wiki New hidden wiki url 2015 http://zqktlwi4fecvo6ri.onion Add it to bookmarks and spread it!!! Editor's picks Bored? Pick a random page from the article index and replace one of these slots with it. The Matrix - Very nice to read. How to Exit the Matrix - Learn how to Protect yourself and your rights, online and off. Verifying PGP signatures - A short and simple how-to guide. In Praise Of Hawala - Anonymous informal value transfer system. Volunteer Here are five different things that you can help us out with. Plunder other hidden service lists for links and place them here! File the SnapBBSIndex links wherever they go. Set external links to HTTPS where available, good certificate, and same content. Care to start recording onionland's history? Check out Onionland's Museum Perform Dead Services Duties. Introduction Points Ahmia.fi - Clearnet search engine for Tor Hidden Services (allows you

Explainer: The nico-teen brain

Explainer: The nico-teen brain The adolescent brain is especially vulnerable to the addictive effects of nicotine BY  TERESA SHIPLEY FELDHAUSEN   7:00AM, AUGUST 19, 2015 Nicotine (black triangle towards center left) tricks the nerve cell (neuron) into sending a message to release more dopamine (yellow dots). Those molecules enter the space (synapse) between one nerve cell and the next. When they get picked up by neighboring cells, this gives users a feel-good high. It also creates the risk of addiction and other health problems.  EMail  Print  Twitter  Facebook  Reddit  Google+ NATIONAL INSTITUTE ON DRUG ABUSE, ADAPTED BY J. HIRSHFELD Nicotine is the addictive chemical in tobacco smoke and e-cigarette vapors. And doctors say the teenage brain is no place for it to end up. Nicotine can reach the brain within seven seconds of puffing on a cigar, hookah, cigarette or electronic cigarette. The area of the brain responsible f