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 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 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 Slide

  4. Jenkins Drone GitLab CI

    View Slide

  5. Why I leave Jenkins

    View 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 Slide

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


    View Slide

  8. Why Not GitLab CI

    View Slide

  9. Use .gitlab-ci.yml config

    View Slide

  10. Use Docker Container

    View Slide

  11. Only two concerns
    But why I leave GitLab?

    View Slide

  12. 1. GitLab only

    View Slide

  13. 2. Customize Yaml

    View Slide

  14. Control your remote server
    How to use SSH

    View Slide

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


    View Slide

  16. SSH Tunnel

    View Slide

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

    View Slide

  18. View Slide

  19. Continuous Delivery system built on container technology


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

    View Slide

  20. Everything is a Docker Container

    View Slide

  21. ●Git Clone


    ●Testing


    ●Package


    ●Deploy


    ●Notify
    Project deploy flow

    View Slide

  22. Simple UI

    View Slide

  23. View Slide

  24. .drone.yml
    Change this config in


    DRONE_REPO_CONFIG

    View Slide

  25. View Slide

  26. View Slide

  27. Support Git Host

    View Slide

  28. Drone Infrastructure

    View Slide

  29. One Server, Multiple Agents

    View Slide

  30. Server
    agent
    agent
    agent
    Database

    View Slide

  31. Drone
    Docker Docker
    Drone Agent
    Database
    Drone Server

    View Slide

  32. Drone Server
    Docker Docker
    Drone
    Database
    Drone Agent

    View Slide

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

    View Slide

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


    docker pull drone/agent:0.8

    View Slide

  35. ●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 Slide

  36. Multiple Agent
    docker-compose up drone-agent

    View Slide

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

    View Slide

  38. Drone Workspace
    Clone Build Deploy
    Share Workspace

    View Slide

  39. Git Test Release Docker Discord
    Deploy Flow in Golang

    View Slide

  40. ● Go testing


    ● Verify Quality


    ● Build Binary


    ● Deploy Binary


    ● Build Image


    ● Deploy Container


    ● Send Notification
    Pipeline in Golang

    View Slide

  41. Git Clone

    View Slide

  42. Testing && Verify Quality

    View Slide

  43. View Slide

  44. View Slide

  45. Build Cross Platform Binary

    View Slide

  46. View Slide

  47. Build Docker

    View Slide

  48. View Slide

  49. Secret Security
    Drone CLI or Web Console

    View Slide

  50. View Slide

  51. Notification Plugin

    View Slide

  52. Plugin Image

    View Slide

  53. vendor, node_modules
    Drone Cache

    View Slide

  54. Drone Workspace
    Clone Build Deploy
    Rebuild
    Restore
    Storage

    View Slide

  55. Volume or SFTP cache
    Drone Plugin

    View Slide

  56. View Slide

  57. [skip cache] or [cache skip]


    Only for SFTP cache
    Cache Broken?

    View Slide

  58. Drone Downstream

    View Slide

  59. Write Drone Plugin
    Whether you prefer language


    PHP, Ruby, Bash, Go, Python …

    View Slide

  60. ●Program with your language


    ●Build Docker Image


    ●Upload to Docker Hub


    ●Testing your plugin
    Four Steps

    View Slide

  61. ARG
    ARG
    ARG

    View Slide

  62. Bash Shell Script Plugin

    View Slide

  63. Prefix PLUGIN_

    View Slide

  64. Build Docker Image

    View Slide

  65. View Slide

  66. Upload Docker Hub

    View Slide

  67. View Slide

  68. Testing in Local

    View Slide

  69. View Slide

  70. drone exec
    Try Drone without Server

    View Slide

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

    View Slide

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


    View Slide

  73. Any Question?

    View Slide