Skip to content

Latest commit

 

History

History
59 lines (40 loc) · 2.83 KB

SETUP.md

File metadata and controls

59 lines (40 loc) · 2.83 KB

Installation guide

For Drone CI installation auxilincom.drone Ansible role is used.

Prerequisites

  1. Ansible
  2. Ubuntu 16.04 server & ssh access to that server

Deploy to production

❕ deploment tested on the latest DigitalOcean Ubuntu dropet. Some changes might be required to run other linux distributives.

High level deployment steps:

  1. Docker installation
  2. Nginx proxy installation & configuration to work with Drone
  3. PostgreSQL installation for Drone to persist build information
  4. Running Drone & Drone CI inside Docker containers
  5. Optional configuration of SSL certificate

Prepare for deployment:

  1. Update server ip in hosts file. If you are planning to use same server for both drone and nginx - just put same ip for both, drone & nginx targets.
  2. Install Ansible role dependencies with one command: ./bin/install-ansible-dependencies.sh
  3. Update github application callback url to either point to your server ip address or your domain. For example: http://ci.myapp.com/login or just http://server_ip/login.
  4. Set server ip variable or domain name in vars/main.yml (drone_server_host variable).
  5. Update drone_user_create in vars/main.yml - a comma separated list of github users, who will have admin access your continuous integration server. Read more here.
  6. Rename credentials-template.yml into credentials.yml and update your github clientId, clientSecret, drone secrets, certbot dns data as well as username and password for PostgreSQL database.

Once you done all above, run the following command:

$ ./bin/setup-server.sh && ./bin/deploy-drone.sh

You should have Drone CI installed by now. The only step remaining is to make Drone work behind Nginx proxy.

Setting up Nginx for Drone CI

If you would like to install nginx on a same server with Drone CI - just run following command:

$ ./bin/setup-nginx.sh

If you already have nginx installed somewhere else and just would like to attach drone nginx configuration to existing nginx server you can do following:

  1. Set nginx server ip in hosts file for the nginx target
  2. Run same command ./bin/setup-nginx.sh, but reply no to the question about nginx installation.

In this case nginx configuration for Drone CI will be copied to the existing nginx server.

Setting up ssl for production Drone CI

  1. Place your ssl keys into the ssl-keys directory as app.crt and app.key (they are in a .gitignore)
  2. Make sure that server_setup_ssl is set to yes in vars/main.yml
  3. Deploy ssl using ./bin/setup-server.sh --tags "nginx"
  4. Update callback url in the Github application to start from https