Slide 1

Slide 1 text

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

Slide 2

Slide 2 text

drone • open source (github.com/drone/drone), написан на Go • container native CI/CD платформа (все есть контейнер) • простая конфигурация через drone.yml (YAML/Jsonnet/ Starlark) • поддержка GitHub, Bitbucket, GitLab, Gogs, Gitea • система плагинов (любой контейнер может быть плагином) • поддержка kubernetes !2

Slide 3

Slide 3 text

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/

Slide 4

Slide 4 text

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

Slide 5

Slide 5 text

drone self-hosted infrastructure !5

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

.drone.yml !8

Slide 9

Slide 9 text

.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

Slide 10

Slide 10 text

.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

Slide 11

Slide 11 text

demo • https://github.com/quasilyte/phpgrep • https://github.com/drone-plugins/boilr-plugin • https://cloud.drone.io • http://plugins.drone.io/ !11

Slide 12

Slide 12 text

итоги !12

Slide 13

Slide 13 text

disadvantages • мало документации, не все фичи задокументированы • configuration duplication* • сравнительно мало плагинов • случайные ошибки и падения во время билдов (редко) !13

Slide 14

Slide 14 text

advantages • простой и быстрый • open source • golang • плагины • “системные” плагины • сообщество в discourse !14

Slide 15

Slide 15 text

Спасибо за внимание! telegram & github: @alikhil
 email: alik@kazanexpress.ru !15

Slide 16

Slide 16 text

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

Slide 17

Slide 17 text

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

Slide 18

Slide 18 text

!18 https://drone.io/enterprise/