Git Product home page Git Product logo

drone-ci-example's Introduction

drone-ci-example

Follows the Getting Started guide at https://docs.drone.io/server/provider/github/ for running a local Drone Server and Runner on Mac OS.

Overview of Terms

The "Drone Server" provides a nice web GUI for seeing what CI/CD is happening. You register it with your GitHub account as an OAuth application that knows to kick off build-test-deploy pipelines whenever you make PRs, etc.

"Drone Runners" do the heavy lifting of executing your pipelines. They listen to the "Drone Server", to which they authenticate with an arbitrary shared secret, to download your code and receive instructions for what to do with your code.

Authorizing the Drone Server with your GitHub

  1. Install ngrok and make an account with them
  2. In a dedicated terminal window or tmux session, run ngrok http 80 (and don't cancel it with ^C). This will expose port 80 on your computer to the wider internet via a random URL of ngrok's choosing. The output of that function should look like:
ngrok by @inconshreveable     (Ctrl+C to quit)

Session Status                online
Account                       David Brakman (Plan: Free)
Version                       2.3.35
Region                        United States (us)
Web Interface                 http://127.0.0.1:4040
Forwarding                    http://12345.ngrok.io -> http://localhost:80
Forwarding                    https://12345.ngrok.io -> http://localhost:80

The http forwarding url (http://12345.ngrok.io) will be where you, and github, access the Drone server you're about to make.

  1. In the Developer Settings for your personal GitHub account, register a new OAuth application.
  2. Copy the Client ID and Client Secret to a file on your computer.
  3. Specify "Homepage URL": http://12345.ngrok.io
  4. Specify "Authorization callback URL": http://12345.ngrok.io/login
  5. In a new terminal session, finish the instructions through Start the Server
  6. Visit http://12345.ngrok.io in your browser and click Activate on any GitHub repo of yours. It should look like drone web ui home

Executing Build/Test/Deploy Instructions with Runners

At time of writing, Drone's docs would say "Install Runners", point you to a menu of 6 different runner types, and tell you that the Docker Runner won't work on Mac (but it will). Foolishly, I tried using the "Exec Runner", which I couldn't get to connect to the Drone Server, write logs, or do anything. Don't mess with any of that stuff.

  1. Follow the Docker Runner instructions at https://docs.drone.io/runner/docker/installation/linux/, committing and pushing the example .drone.yml file to your repository. If a runner is correctly connected to your server, it should look like drone-execution-instance. If the runner isn't connected, the "activity feed" item will be stuck in a "Pending" state.

drone-ci-example's People

Contributors

dbrakman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.