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

Drone 1.0 Feature

265bcbb56e831266de7a9f9281aab57a?s=47 Bo-Yi Wu
April 22, 2019

Drone 1.0 Feature

This talk will describe all of the reasons for drone CI/CD 1.0, all of its features demonstrate its functionality, I will cover the background of Drone, how we built it, why we built it.

265bcbb56e831266de7a9f9281aab57a?s=128

Bo-Yi Wu

April 22, 2019
Tweet

Transcript

  1. Drone CI/CD Container-Native Continuous Delivery Platform https://github.com/drone/drone 2019/04/20

  2. Bo-yi Wu (appleboy) Software Engineer in Mediatek https://blog.wu-boy.com https://github.com/appleboy appleboy

    appleboy46
  3. Drone cloud free for the open source community https://cloud.drone.io/

  4. --- kind: pipeline name: default steps: - name: backend image:

    golang commands: - go build - go test - name: frontend image: node commands: - npm install - npm test
  5. https://github.com/drone/drone-ui

  6. Drone 1.0 Features

  7. Support Platform

  8. Multi-Machine Multi-Architecture Multi-Cloud

  9. --- kind: pipeline platform: arch: arm os: linux steps: -

    name: build image: golang commands: - go build - go test Linux amd64, Linux arm, Linux arm64 and Windows server
  10. --- kind: pipeline name: backend platform: arch: arm os: linux

    steps: - name: build image: golang commands: - go build - go test --- kind: pipeline name: frontend platform: arch: amd64 os: linux steps: - name: build image: node commands: - npm install - npm test depends_on: - backend
  11. --- kind: pipeline name: default steps: - name: backend image:

    golang commands: - go build - go test - name: frontend image: golang commands: - npm install - npm test - name: build image: plugins/slack settings: channel: general depends_on: - backend - frontend Faster Pipelines with Parallelization
  12. local pipeline = import 'pipeline.libsonnet'; local name = 'drone-ssh'; [

    pipeline.test, pipeline.build(name, 'linux', 'amd64'), pipeline.build(name, 'linux', 'arm64'), pipeline.build(name, 'linux', 'arm'), pipeline.release, pipeline.notifications(depends_on=[ 'linux-amd64', 'linux-arm64', 'linux-arm', 'release-binary', ]), ] Complex Configurations Simplified
  13. Secret Management

  14. --- kind: secret name: slack_webhook get: path: secret/data/slack name: webhook

    --- kind: pipeline name: default steps: - name: build image: golang commands: - go build - go test - name: notify image: plugins/slack settings: channel: general webhook: from_secret: slack_webhook
  15. per-organization secrets http://bit.ly/drone-org-secrets

  16. Cron Scheduling @hourly, @dailys, @weekly and @monthly

  17. # example when configuration when: cron: [ nightly ] #

    example trigger configuration trigger: cron: [ nightly ]
  18. Gitlab Pipelines image: ruby:2.2 services: - postgres:9.3 before_script: - bundle

    install test: script: - bundle exec rake spec --- kind: pipeline name: test platform: os: linux arch: amd64 steps: - name: test image: ruby:2.2 commands: - bundle install - bundle exec rake spec services: - name: postgres-9-3 image: postgres:9.3 ... $ drone convert .gitlab-ci.yml
  19. automatic runtime conversion

  20. Gitlab cache cache: untracked: true key: "$CI_BUILD_REF_NAME" paths: - node_modules/

    stages: - setup - test setup: stage: setup script: - npm install test: stage: test script: - npm test --- kind: pipeline name: setup platform: os: linux arch: amd64 steps: - name: setup commands: - npm install - name: test commands: - npm test depends_on: - setup ...
  21. Bitbucket Pipelines pipelines: default: - step: name: Build and test

    image: node:8.5.0 script: - npm install - npm test - npm build definitions: services: postgres: image: postgres:9.6.4 --- kind: pipeline name: default platform: os: linux arch: amd64 steps: - name: Build and test image: node:8.5.0 commands: - npm install - npm test - npm build services: - name: postgres image: postgres:9.6.4 ... $ drone convert bitbucket-pipelines.yml
  22. automatic runtime conversion

  23. Bitbucket cache pipelines: default: - step: caches: - node script:

    - npm install - npm test kind: pipeline name: default steps: - name: restore image: plugins/s3-cache settings: restore: true mount: - node_modules - name: build image: node commands: - npm install - npm test - name: rebuild image: plugins/s3-cache settings: rebuild: true mount: - node_modules
  24. Autoscale in Drone https://autoscale.drone.io/

  25. Agent Server Agent Agent Agent autoscaler https://github.com/drone/autoscaler

  26. 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
  27. Drone CI Infrastructure

  28. Drone CI Infrastructure Agent Server Step 1 git clone Step

    2 make build Step 3 deploy app work space extra service Agent
  29. Drone Server • Support SSL • Custom SSL • Let’s

    Encrypt • Database • SQLite • MySQL • Postgres • S3 Storage: Store Large Text Files (build logs) • Log to stderr in joss-format by default
  30. Drone + Prometheus

  31. global: scrape_interval: 60s scrape_configs: - job_name: 'drone' bearer_token: your_token static_configs:

    - targets: ['domain.com']
  32. Drone Agent • Linux amd64 • Linux arm • Linux

    arm64 • Windows 1803 • Windows 1809
  33. route builds to specific agents CPU, Memory, GPUS

  34. kind: pipeline name: default steps: - name: build image: golang

    commands: - go build - go test node: instance: highmem
  35. Drone Plugin Any language you want

  36. #!/bin/sh curl -X POST \ -H 'Content-type: application/json' \ -d

    '{"text":"hello"}' \ https://hooks.slack.com/services/...
  37. #!/bin/sh curl -X POST \ -H 'Content-type: application/json' \ -d

    '{"text":"${PLUGIN_TEXT}"}' \ ${PLUGIN_WEBHOOK}
  38. kind: pipeline name: default steps: - name: webhook image: janecitizen/slack

    settings: webhook: https://hooks.slack.com/... text: hello
  39. http://plugins.drone.io

  40. http://bit.ly/drone-2019