drone.io

Do you know Travis CI or Circleci services? Here I will show you how to setup your own Drone 0.5 CI service.

  • Edit the /etc/dronerc file

    Get your github token from github setting page, and set agent secret to any random string.

    /etc/dronerc
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    DRONE_GITHUB=true
    DRONE_GITHUB_CLIENT=...
    DRONE_GITHUB_SECRET=...
    DRONE_AGENT_SECRET=...
    DRONE_OPEN=false
    DRONE_ADMIN=taka-wang,takawang
    # for armhf
    DOCKER_OS=linux
    DOCKER_ARCH=arm
    DRONE_PLUGIN_NAMESPACE=armhfplugins
    DRONE_YAML=.drone.armhf
  • Start drone server

    Mapping port 80 of docker container to port 8000 of hosted server.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    docker run \
    --privileged \
    --volume /var/lib/drone:/var/lib/drone \
    --env-file /etc/dronerc \
    --restart=always \
    --publish=80:8000 \
    --detach=true \
    --name=drone5 \
    drone/drone:0.5
  • Start drone agents

    Check your drone secret from /etc/dronerc

    1
    2
    3
    4
    5
    6
    7
    8
    9
    docker run \
    --privileged \
    --env DRONE_SERVER=http://where-is-your-drone-server:80 \
    --env DRONE_SECRET=.... \
    --volume /var/run/docker.sock:/var/run/docker.sock \
    --restart=always \
    --detach=true \
    --name=drone-agent \
    drone/drone:0.5 agent
  • Common commands

    1
    2
    3
    4
    docker stop drone5 # stop service
    docker start drone5 # start service
    docker logs -f drone5 # logs
    docker rm drone5 # remove service
  • References


That’s it, enjoy it!