Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Drone CI/CD Platform

5,866 views

Published on

Drone is a Continuous Delivery platform built on Docker, written in Go

* 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

Published in: Software
  • Be the first to comment

Drone CI/CD Platform

  1. 1. Drone CI/CD Platform Drone is a Continuous Delivery platform built on Docker, written in Go 2018/11/03
  2. 2. 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
  3. 3. About Me appleboy @ appleboy @
  4. 4. Jenkins Drone Travis Gitlab ci
  5. 5. Why I leave Jenkins
  6. 6. Why? • Complicated project setting • Write the plugin (Java language) • Maintenance? • Learning Curve? • Grow your team?
  7. 7. Try the GitLab CI
  8. 8. .gitlab-ci.yml config
  9. 9. But Why I leave GitLab CI ?
  10. 10. Why? 1. GitLab Only 2. Not extensible
  11. 11. SSH Tunnel
  12. 12. How to use SSH command
  13. 13. https://florianbrinkmann.com/en/3473/deployment-gitlab-ci/
  14. 14. Try drone-ssh tool https://github.com/appleboy/drone-ssh
  15. 15. pipeline: ssh: image: appleboy/drone-ssh host: foo.com username: root password: 1234 port: 22 script: - echo hello - echo world proxy_host: 10.130.33.145 proxy_user: ubuntu proxy_port: 22 proxy_password: 1234 custom key
  16. 16. What is Drone?
  17. 17. Drone CI• Container native CI/CD platform • Easy to install & maintain • Isolate builds • Simple YAML Configuration • Integrates with several VCS Providers • Rich set of official plugins (any container can be a plugin) • Execute locally with simple command (drone exec) • open source (https://github.com/drone/drone)
  18. 18. Everything is a Docker Container
  19. 19. Project CI/CD Flow git clone testing deploy notify
  20. 20. Project List and Status
  21. 21. Job detail and logs
  22. 22. .drone.yml
  23. 23. Isolate build
  24. 24. Support Git Host
  25. 25. Drone CI Infrastructure Agent Server Step 1 git clone Step 2 make build Step 3 deploy app work space extra service Agent
  26. 26. Support Platform https://blog.drone.io/drone-cloud-native-ci-cd-windows-containers/ https://blog.drone.io/drone-announces-official-support-for-arm/
  27. 27. services: drone-server: image: drone/drone:0.8 ports: - 8080:8000 volumes: - ./:/var/lib/drone/ restart: always environment: - DRONE_HOST=${HOST} - DRONE_OPEN=true - DRONE_SECRET=drone-workshop - DRONE_ADMIN=appleboy # GitHub Config - DRONE_GITHUB=true - DRONE_GITHUB_CLIENT=${CLIENT} - DRONE_GITHUB_SECRET=${SECRET} SQLite DB
  28. 28. drone-agent: image: drone/agent:0.8 restart: always depends_on: - drone-server volumes: - /var/run/docker.sock:/var/run/docker.sock environment: - DRONE_SERVER=drone-server:9000 - DRONE_SECRET=drone-workshop - DRONE_MAX_PROCS=3 drone agent count
  29. 29. Auto scale drone agent https://github.com/appleboy/drone-on-kubernetes
  30. 30. Agent Server Agent Agent Agent autoscaler https://github.com/drone/autoscaler
  31. 31. Task - Agent drone_server=server:9000 Task - Server port: 80/9000 ECS - Fargate ECS - Service Target Group Port: 80 Route 53 Service Discovery ALB / SSL Cloud Watch https://github.com/appleboy/drone-terraform-in-aws
  32. 32. Deploy Flow in Golang ReleaseTestGit Docker Notify
  33. 33. Pipeline in Golang • Go Testing • Verify Quality • Build Binary • Deploy Binary • Build Image • Deploy Container • Send Notification
  34. 34. workspace: base: /go/src path: github.com/go-ggz/ggz clone: git: image: plugins/git depth: 50 tags: true
  35. 35. Testing && Verify Quality
  36. 36. pipeline: backend: image: golang:1.11 pull: true commands: - cp .env.example .env - make embedmd - make fmt-check - make misspell-check
  37. 37. Parallel processing
  38. 38. build_linux_i386: image: golang:1.11 pull: true group: build environment: TAGS: sqlite commands: - SERVICE=ggz-server make build_linux_i386 - SERVICE=ggz-redirect make build_linux_i386 build_linux_arm64: image: golang:1.11 pull: true group: build environment: TAGS: sqlite commands: - SERVICE=ggz-server make build_linux_arm64 - SERVICE=ggz-redirect make build_linux_arm64
  39. 39. Build Docker
  40. 40. publish_linux_amd64: image: plugins/docker group: release pull: true repo: goggz/ggz-server dockerfile: dockerfile/server/Dockerfile secrets: [ docker_username, docker_password ] default_tags: true when: event: [ push, tag ] local: false Docker plugin for Drone CI/CD
  41. 41. Secret Security
  42. 42. Notification Plugin
  43. 43. Write Drone Plugin Whether you prefer language PHP, Ruby, Bash, Go, Python
  44. 44. Three Steps •Program with your language •Build Docker Image and Testing •Upload to Docker Hub
  45. 45. Prefix PLUGIN_
  46. 46. Testing in Local
  47. 47. Try Drone without Server drone exec
  48. 48. https://www.udemy.com/devops-oneday/?couponCode=DRONE-DEVOPS
  49. 49. Any Question?

×