Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Drone continuous Integration

Bo-Yi Wu
January 24, 2018

Drone continuous Integration

The following is my Agenda

* Why I don’t choose Jenkins or GitLab CI?
* What is Drone CI?
* Drone Infrastructure
* How to install Drone in five minutes?
* Integrate your project
* Create your Drone plugin
* Try drone CLI without drone server

more detailed information you can find that in Udemy: https://blog.wu-boy.com/drone-devops/

Bo-Yi Wu

January 24, 2018
Tweet

More Decks by Bo-Yi Wu

Other Decks in Technology

Transcript

  1. Bo-Yi Wu


    2018.01.17
    Drone

    Continuous Integration

    View full-size slide

  2. ● Why I don’t choose Jenkins or GitLab CI?


    ● What is Drone CI?


    ● Drone Infrastructure


    ● How to install Drone in five minutes?


    ● Integrate your project


    ● Create your Drone plugin


    ● Try drone cli without drone server
    Agenda

    View full-size slide

  3. ● Mediatek Engineer


    ● DevOps


    ● Golang, PHP, Node.js ..


    ● Some open source


    ● Gitea


    ● Gin


    ● Drone


    ● appleboy @GitHub


    ● appleboy @twitter


    ● appleboy @slideshare


    ● appleboy46 @facebook
    About Me
    3

    View full-size slide

  4. Jenkins Drone GitLab CI

    View full-size slide

  5. Why I leave Jenkins

    View full-size slide

  6. 1. Complicated project setting


    2. Version control project setting


    3. Write the plugin (Java language)


    4. Maintenance?


    5. Learning Curve?


    6. Grow your team?
    Why?

    View full-size slide

  7. http://bit.ly/devops-tool


    View full-size slide

  8. Why Not GitLab CI

    View full-size slide

  9. Use .gitlab-ci.yml config

    View full-size slide

  10. Use Docker Container

    View full-size slide

  11. Only two concerns
    But why I leave GitLab?

    View full-size slide

  12. 1. GitLab only

    View full-size slide

  13. 2. Customize Yaml

    View full-size slide

  14. Control your remote server
    How to use SSH

    View full-size slide

  15. https://florianbrinkmann.com/en/3473/deployment-gitlab-ci/


    View full-size slide

  16. https://github.com/appleboy/drone-ssh
    Try drone-ssh

    View full-size slide

  17. Continuous Delivery system built on container technology


    https://github.com/drone/drone
    What is Drone?

    View full-size slide

  18. Everything is a Docker Container

    View full-size slide

  19. ●Git Clone


    ●Testing


    ●Package


    ●Deploy


    ●Notify
    Project deploy flow

    View full-size slide

  20. .drone.yml
    Change this config in


    DRONE_REPO_CONFIG

    View full-size slide

  21. Support Git Host

    View full-size slide

  22. Drone Infrastructure

    View full-size slide

  23. One Server, Multiple Agents

    View full-size slide

  24. Server
    agent
    agent
    agent
    Database

    View full-size slide

  25. Drone
    Docker Docker
    Drone Agent
    Database
    Drone Server

    View full-size slide

  26. Drone Server
    Docker Docker
    Drone
    Database
    Drone Agent

    View full-size slide

  27. https://github.com/go-training/drone-tutorial
    How to install

    View full-size slide

  28. docker-compose.yml
    docker pull drone/drone:0.8


    docker pull drone/agent:0.8

    View full-size slide

  29. ●Setup drone server and agent


    ●Introduction to drone dashboard


    ●Enable or disable your project


    ●Configuring the drone cli tool
    Demo
    https://labs.play-with-docker.com/


    View full-size slide

  30. Multiple Agent
    docker-compose up drone-agent

    View full-size slide

  31. Drone Workspace
    Clone Build Deploy
    The first step: Git clone

    View full-size slide

  32. Drone Workspace
    Clone Build Deploy
    Share Workspace

    View full-size slide

  33. Git Test Release Docker Discord
    Deploy Flow in Golang

    View full-size slide

  34. ● Go testing


    ● Verify Quality


    ● Build Binary


    ● Deploy Binary


    ● Build Image


    ● Deploy Container


    ● Send Notification
    Pipeline in Golang

    View full-size slide

  35. Testing && Verify Quality

    View full-size slide

  36. Build Cross Platform Binary

    View full-size slide

  37. Build Docker

    View full-size slide

  38. Secret Security
    Drone CLI or Web Console

    View full-size slide

  39. Notification Plugin

    View full-size slide

  40. Plugin Image

    View full-size slide

  41. vendor, node_modules
    Drone Cache

    View full-size slide

  42. Drone Workspace
    Clone Build Deploy
    Rebuild
    Restore
    Storage

    View full-size slide

  43. Volume or SFTP cache
    Drone Plugin

    View full-size slide

  44. [skip cache] or [cache skip]


    Only for SFTP cache
    Cache Broken?

    View full-size slide

  45. Drone Downstream

    View full-size slide

  46. Write Drone Plugin
    Whether you prefer language


    PHP, Ruby, Bash, Go, Python …

    View full-size slide

  47. ●Program with your language


    ●Build Docker Image


    ●Upload to Docker Hub


    ●Testing your plugin
    Four Steps

    View full-size slide

  48. Bash Shell Script Plugin

    View full-size slide

  49. Prefix PLUGIN_

    View full-size slide

  50. Build Docker Image

    View full-size slide

  51. Upload Docker Hub

    View full-size slide

  52. Testing in Local

    View full-size slide

  53. drone exec
    Try Drone without Server

    View full-size slide

  54. https://github.com/appleboy/drone-on-kubernetes
    Drone on Kubernetes

    View full-size slide

  55. Online Drone Course (Chinese)
    https://www.udemy.com/devops-oneday/?couponCode=DRONE-DEVOPS


    View full-size slide

  56. Any Question?

    View full-size slide