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

Drone 1.0 Feature

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.

Bo-Yi Wu

April 22, 2019
Tweet

More Decks by Bo-Yi Wu

Other Decks in Technology

Transcript

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

    golang commands: - go build - go test - name: frontend image: node commands: - npm install - npm test
  2. --- 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
  3. --- 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
  4. --- 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
  5. 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
  6. --- 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
  7. # example when configuration when: cron: [ nightly ] #

    example trigger configuration trigger: cron: [ nightly ]
  8. 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
  9. 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 ...
  10. 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
  11. 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
  12. 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
  13. Drone CI Infrastructure Agent Server Step 1 git clone Step

    2 make build Step 3 deploy app work space extra service Agent
  14. 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
  15. Drone Agent • Linux amd64 • Linux arm • Linux

    arm64 • Windows 1803 • Windows 1809
  16. kind: pipeline name: default steps: - name: build image: golang

    commands: - go build - go test node: instance: highmem
  17. #!/bin/sh curl -X POST \ -H 'Content-type: application/json' \ -d

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

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

    settings: webhook: https://hooks.slack.com/... text: hello