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

CI/CD для Go проектов на drone.io

CI/CD для Go проектов на drone.io

5b8d20aa7d63c5d391b1c881e1764460?s=128

Iskander (Alex) Sharipov

February 08, 2020
Tweet

Transcript

  1. CI/CD для GO проектов на drone.io Алик Хилажев Marketplace Technologies

    (KazanExpress.ru) +
  2. drone • open source (github.com/drone/drone), написан на Go • container

    native CI/CD платформа (все есть контейнер) • простая конфигурация через drone.yml (YAML/Jsonnet/ Starlark) • поддержка GitHub, Bitbucket, GitLab, Gogs, Gitea • система плагинов (любой контейнер может быть плагином) • поддержка kubernetes !2
  3. community vs enterprise Community • бесплатно • self-hosted* • single-instance

    • pipeline plugins !3 Enterprise • от 299$ в месяц • cloud или self-hosted • autoscaling • external secrets stores • pipeline + system plugins https://drone.io/enterprise/features/
  4. enterprise for free? • для open source проектов (cloud.drone.io) •

    первые 5000 билдов (self-hosted, official docker image) • для компаний/стартапов с годовой выручкой < $1 млн !4 https://discourse.drone.io/t/licensing-and-subscription-faq/3839
  5. drone self-hosted infrastructure !5

  6. !6 https://www.slideshare.net/appleboy/drone-cicd-platform

  7. run via docker-compose !7 version: '2.2' services: drone-server: image: drone/drone:1.6

    restart: always https://docs.drone.io/installation/providers/github/ ports: - 80:80 - 443:443 volumes: - ./drone-data:/data environment: - DRONE_TLS_AUTOCERT=true - DRONE_SERVER_HOST=drone.example.ru - DRONE_AGENTS_DISABLED=true - DRONE_GITHUB_CLIENT=gh_client_id - DRONE_GITHUB_SECRET=gh_secret_key
  8. .drone.yml !8

  9. .drone.yml kind: pipeline steps: - name: test image: golang commands:

    - go test - go build - name: publish image: plugins/docker settings: repo: octocat/hello-world tags: [ latest, 1.0, 1 ] !9
  10. .drone.yml (2) kind: pipeline name: admin-service-build steps: - name: gcr

    image: plugins/gcr settings: registry: gcr.io repo: kazanexpress/${DRONE_REPO,,} volumes: - name: docker-volume path: /var/run/docker.sock - name: deploy image: quay.io/honestbee/drone-kubernetes settings: container: admin deployment: admin repo: gcr.io/kazanexpress/${DRONE_REPO,,} environment: KUBERNETES_TOKEN: from_secret: kubernetes_token !10
  11. demo • https://github.com/quasilyte/phpgrep • https://github.com/drone-plugins/boilr-plugin • https://cloud.drone.io • http://plugins.drone.io/ !11

  12. итоги !12

  13. disadvantages • мало документации, не все фичи задокументированы • configuration

    duplication* • сравнительно мало плагинов • случайные ошибки и падения во время билдов (редко) !13
  14. advantages • простой и быстрый • open source • golang

    • плагины • “системные” плагины • сообщество в discourse !14
  15. Спасибо за внимание! telegram & github: @alikhil
 email: alik@kazanexpress.ru !15

  16. resources • простой плагин с демо - https://github.com/alikhil/simple-drone-webhook-plugin • https://www.slideshare.net/appleboy/drone-cicd-platform

    • официальный сайт - https://drone.io • документация - https://docs.drone.io • плагины (тут не все) - http://plugins.drone.io/ • форум - https://discourse.drone.io • шаблон для плагинов https://github.com/drone-plugins/boilr-plugin • еще плагины - https://github.com/appleboy !16
  17. Open Source vs Enterprise Is Drone Enterprise Edition Free? Yes,

    the official docker image provides free access to all Drone Enterprise features, for up to 5,000 builds. This includes both commercial and non- commercial use. Can I Remove the Build Limit? Yes, you can remove the 5,000 build limit by purchasing a commercial license. Or if you qualify for free use you can build the Enterprise Edition from source and remove all limits by compiling with the nolimit build tag. Or you can downgrade to the Open Source Edition. Источник: Licensing and Subscription FAQ (https://discourse.drone.io/t/ licensing-and-subscription-faq/3839) !17
  18. !18 https://drone.io/enterprise/