SlideShare a Scribd company logo
CI/CD
com Docker
& Drone
Fernando Barbosa
DevOps Engineer @ QuintoAndar
// fernando.barbosa@quintoandar.com.br
// linkedin.com/in/fbcbarbosa
// github.com/fbcbarbosa
// @fbcbarbosa
TDC2018SP | Trilha Containers - CI/CD com Docker e Drone
Estamos contratando!
quin.to/carreiras
TDC2018SP | Trilha Containers - CI/CD com Docker e Drone
TDC2018SP | Trilha Containers - CI/CD com Docker e Drone
TDC2018SP | Trilha Containers - CI/CD com Docker e Drone
TDC2018SP | Trilha Containers - CI/CD com Docker e Drone
TDC2018SP | Trilha Containers - CI/CD com Docker e Drone
Agenda
CI/CD (Integração Contínua/Entrega Contínua)
O que é Drone
Configurando sua pipeline (hands on)
CI/CD
Integração Contínua/Entrega Contínua
CI (integração contínua)
Build Test
CD (entrega contínua/deploy contínuo)
Build Test Deploy
Continuous Delivery
Publish
CD (entrega contínua/deploy contínuo)
Build Test Deploy
Continuous Delivery
Publish
Build Test Deploy
Continuous Deployment
Publish
Drone
O que é importante saber?
TDC2018SP | Trilha Containers - CI/CD com Docker e Drone
#1
Configuração
em código
.drone.yml
#1
Configuração
em código
#1
Configuração
em código
pipeline:
build:
image: golang
commands:
- go get
- go build
test:
image: golang
commands:
- go test
publish:
image: plugins/docker
repo: myrepo/app
tags: [ 'latest' ]
pipeline:
build:
image: golang
commands:
- go get
- go build
test:
image: golang
commands:
- go test
publish:
image: plugins/docker
repo: myrepo/app
tags: [ 'latest' ]
Build
Test
Publish
#1
Configuração
em código
version: 2
jobs:
build:
docker:
- image:
circleci/<language>:<version TAG>
steps:
- checkout
- run: <command>
test:
docker:
- image:
circleci/<language>:<version TAG>
steps:
- checkout
- run: <command>
workflows:
version: 2
build_and_test:
jobs:
- build
- test
language: python
python:
- "2.6"
- "2.7"
- "3.4"
- "3.5"
- "3.6"
# PyPy versions
- "pypy2.7"
- "pypy3.5"
# command to install dependencies
install:
- pip install -r requirements.txt
- pip install .
# command to run tests
script: pytest
pipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Building..'
}
}
stage('Test') {
steps {
echo 'Testing..'
}
}
stage('Deploy') {
steps {
echo 'Deploying....'
}
}
}
}
O .drone.yml é um
do nosso amigo
SUPERSET*
pipeline:
build:
image: golang
commands:
- go get
- go build
test:
image: golang
commands:
- go test
publish:
image: plugins/docker
repo: myrepo/app
tags: [ 'latest' ]
#2
Open
Source
#2
Open
Source
#2
Open
Source
discourse.drone.io
15k
230
85+
#3
Docker
Native
#3
Docker
Native
pipeline:
build:
image: golang
commands:
- go get
- go build
test:
image: golang
commands:
- go test
publish:
image: plugins/docker
repo: myrepo/app
tags: [ 'latest' ]
Build
Test
Publish
#3
Docker
Native
pipeline:
build:
image: golang
commands:
- go get
- go build
test:
image: golang
commands:
- go test
publish:
image: plugins/docker
repo: myrepo/app
tags: [ 'latest' ]
Build
Test
Publish
E isso é bom?
É ÓTIMO!
#3
Docker
Native
Isolamento entre ambientes
Host OS
#3
Docker
Native
Imutabilidade entre builds
Build
Test
Publish
Build
Test
Publish
1x 2x
#3
Docker
Native
hub.docker.com
Drone
Configuração em Código
Open Source
Docker Native
Hands On
Configurando sua pipeline
Fácil de configurar.
Por que usar
Drone #1
github.com/fbcbarbosa/drone-demo
version: '2'
services:
drone-server:
image: drone/drone:0.8.5
ports:
- 8000:8000
volumes:
- /var/lib/drone:/var/lib/drone/
restart: always
environment:
- DRONE_OPEN=false # só admins podem logar!
- DRONE_ADMIN=fbcbarbosa
- DRONE_SECRET=1234
- DRONE_HOST=${DRONE_HOST}
- DRONE_GITHUB=true
- DRONE_GITHUB_CLIENT=${DRONE_GITHUB_CLIENT}
- DRONE_GITHUB_SECRET=${DRONE_GITHUB_SECRET}
drone-agent:
image: drone/agent:0.8.5
command: agent
restart: always
depends_on:
- drone-server
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- DRONE_SECRET=1234
- DRONE_SERVER=drone-server:9000
Fácil de usar.
Por que usar
Drone #2
Contador de visitas!
Build Test
services:
redis:
image: redis
pipeline:
test:
image: python:2.7
commands:
- pip install -r requirements.txt
- pip install pytest
- pytest tests.py -s
...
Fácil de estender.
Por que usar
Drone #3
TDC2018SP | Trilha Containers - CI/CD com Docker e Drone
...
deploy:
image: fbcbarbosa/heroku
login: fbcbarbosa@gmail.com
app: hello-tdc
secrets: [ plugin_token ]
when:
branch: master
...
Plugin
...
deploy:
image: fbcbarbosa/heroku
login: fbcbarbosa@gmail.com > PLUGIN_LOGIN
app: hello-tdc > PLUGIN_APP
secrets: [ plugin_token ] > PLUGIN_TOKEN
when:
branch: master
...
Plugin
$ cat plugin/heroku.sh
#!/bin/sh
cat >~/.netrc <<EOF
machine git.heroku.com
login ${PLUGIN_LOGIN}
password ${PLUGIN_TOKEN}
EOF
git push -f https://git.heroku.com/${PLUGIN_APP}.git master
Plugin
$ cat plugin/Dockerfile
FROM alpine/git
ADD heroku.sh /bin/heroku.sh
ENTRYPOINT /bin/heroku.sh
Plugin
plugins.drone.io
Drone
#1 Fácil de configurar
#2 Fácil de usar
#3 Fácil de estender
Drone
#1 Fácil de configurar
#2 Fácil de usar
#3 Fácil de estender
#4 Também [pode ser] barato
server (t2.micro)
10x agents (m5.xlarge)
1 GB Ram / 1 vCPU
16 GB Ram / 4 vCPU
database (t2.db.micro)
Todo dia...
// 50 devs
// 35 deploys
// 300 pipelines
// 2000 steps
TDC2018SP | Trilha Containers - CI/CD com Docker e Drone
Para saber mais...
// docs.drone.io
// autoscale.drone.io
// github.com/fbcbarbosa/drone-demo
Obrigado!
Fernando Barbosa
DevOps Engineer @ QuintoAndar
// fernando.barbosa@quintoandar.com.br
// linkedin.com/in/fbcbarbosa
// github.com/fbcbarbosa
// @fbcbarbosa

More Related Content

PDF
Docker & GitLab
PPTX
Docker e git lab
PPTX
CI-CD WITH GITLAB WORKFLOW
PDF
Webinar - Unbox GitLab CI/CD
PDF
Workshop - Golang language
PDF
Docker 導入:障礙與對策
PDF
Gitlab - Creating C++ applications with Gitlab CI
PDF
Drone 1.0 Feature
Docker & GitLab
Docker e git lab
CI-CD WITH GITLAB WORKFLOW
Webinar - Unbox GitLab CI/CD
Workshop - Golang language
Docker 導入:障礙與對策
Gitlab - Creating C++ applications with Gitlab CI
Drone 1.0 Feature

What's hot (20)

PPTX
Grunt to automate JS build
PPTX
Lando - AddWeb Solution
PPTX
PDF
Gitlab ci e kubernetes, build test and deploy your projects like a pro
PDF
Drone CI/CD Platform
PDF
Docker basic on azure
PDF
Paris Container Day 2016 : Cloud de conteneurs, conteneurs dans le cloud, str...
PDF
Docker for tooling
PDF
Ondřej Procházka - Deployment podle Devel.cz
PDF
Using GitLab CI
PDF
Sep Nasiri "Upwork PHP Architecture"
PDF
Continuous Deployment with Kubernetes, Docker and GitLab CI
PDF
GDGSCL - Docker a jeho provoz v Heroku a AWS
PPTX
Docker session I: Continuous integration, delivery and deployment
PPTX
drone continuous Integration
PDF
Continuous Delivery di una WebApp - by example
PDF
GCE 上搭配 Cloud Storage 建置 Drone CI
PDF
PDF
Docker - modern platform for developement and operations
PDF
The myths of deprecating docker in kubernetes
Grunt to automate JS build
Lando - AddWeb Solution
Gitlab ci e kubernetes, build test and deploy your projects like a pro
Drone CI/CD Platform
Docker basic on azure
Paris Container Day 2016 : Cloud de conteneurs, conteneurs dans le cloud, str...
Docker for tooling
Ondřej Procházka - Deployment podle Devel.cz
Using GitLab CI
Sep Nasiri "Upwork PHP Architecture"
Continuous Deployment with Kubernetes, Docker and GitLab CI
GDGSCL - Docker a jeho provoz v Heroku a AWS
Docker session I: Continuous integration, delivery and deployment
drone continuous Integration
Continuous Delivery di una WebApp - by example
GCE 上搭配 Cloud Storage 建置 Drone CI
Docker - modern platform for developement and operations
The myths of deprecating docker in kubernetes
Ad

Similar to TDC2018SP | Trilha Containers - CI/CD com Docker e Drone (20)

PDF
Docker in Production: Reality, Not Hype
PDF
Clustering Docker with Docker Swarm on openSUSE
PPTX
JFrog container registry - DevOps extravaganza
PDF
Docker Clustering - Batteries Included
PDF
Bring Continuous Integration to Your Laptop With the Drone CI Docker Extensio...
PDF
BBL Premiers pas avec Docker
PPTX
PDF
Drone Continuous Integration
PDF
Chicago Docker Meetup Presentation - Mediafly
PDF
Production sec ops with kubernetes in docker
PPTX
Docker for Fun and Profit, Devoxx 2014
PDF
Docker Introduction.pdf
PDF
Continuous Delivery com Docker, OpenShift e Jenkins
PPTX
No More Dockerfiles! Buildpacks to Help You Ship Your Image!
PDF
Docker in Production: Reality, Not Hype - DevOps Chicago
PDF
Deployment Tactics
PDF
Docker &amp; rancher
PDF
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
PDF
Be a happier developer with Docker: Tricks of the trade
PDF
Docker as development environment
Docker in Production: Reality, Not Hype
Clustering Docker with Docker Swarm on openSUSE
JFrog container registry - DevOps extravaganza
Docker Clustering - Batteries Included
Bring Continuous Integration to Your Laptop With the Drone CI Docker Extensio...
BBL Premiers pas avec Docker
Drone Continuous Integration
Chicago Docker Meetup Presentation - Mediafly
Production sec ops with kubernetes in docker
Docker for Fun and Profit, Devoxx 2014
Docker Introduction.pdf
Continuous Delivery com Docker, OpenShift e Jenkins
No More Dockerfiles! Buildpacks to Help You Ship Your Image!
Docker in Production: Reality, Not Hype - DevOps Chicago
Deployment Tactics
Docker &amp; rancher
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Be a happier developer with Docker: Tricks of the trade
Docker as development environment
Ad

More from tdc-globalcode (20)

PDF
TDC2019 Intel Software Day - Visao Computacional e IA a servico da humanidade
PDF
TDC2019 Intel Software Day - Tecnicas de Programacao Paralela em Machine Lear...
PDF
TDC2019 Intel Software Day - ACATE - Cases de Sucesso
PDF
TDC2019 Intel Software Day - Otimizacao grafica com o Intel GPA
PDF
TDC2019 Intel Software Day - Deteccao de objetos em tempo real com OpenVino
PDF
TDC2019 Intel Software Day - OpenCV: Inteligencia artificial e Visao Computac...
PDF
TDC2019 Intel Software Day - Inferencia de IA em edge devices
PDF
Trilha BigData - Banco de Dados Orientado a Grafos na Seguranca Publica
PPT
Trilha .Net - Programacao funcional usando f#
PDF
TDC2018SP | Trilha Go - Case Easylocus
PDF
TDC2018SP | Trilha Modern Web - Para onde caminha a Web?
PDF
TDC2018SP | Trilha Go - Clean architecture em Golang
PDF
TDC2018SP | Trilha Go - "Go" tambem e linguagem de QA
PDF
TDC2018SP | Trilha Mobile - Digital Wallets - Seguranca, inovacao e tendencia
PDF
TDC2018SP | Trilha .Net - Real Time apps com Azure SignalR Service
PDF
TDC2018SP | Trilha .Net - Passado, Presente e Futuro do .NET
PDF
TDC2018SP | Trilha .Net - Novidades do C# 7 e 8
PDF
TDC2018SP | Trilha .Net - Obtendo metricas com TDD utilizando build automatiz...
PDF
TDC2018SP | Trilha .Net - .NET funcional com F#
PDF
TDC2018SP | Trilha .Net - Crie SPAs com Razor e C# usando Blazor em .Net Core
TDC2019 Intel Software Day - Visao Computacional e IA a servico da humanidade
TDC2019 Intel Software Day - Tecnicas de Programacao Paralela em Machine Lear...
TDC2019 Intel Software Day - ACATE - Cases de Sucesso
TDC2019 Intel Software Day - Otimizacao grafica com o Intel GPA
TDC2019 Intel Software Day - Deteccao de objetos em tempo real com OpenVino
TDC2019 Intel Software Day - OpenCV: Inteligencia artificial e Visao Computac...
TDC2019 Intel Software Day - Inferencia de IA em edge devices
Trilha BigData - Banco de Dados Orientado a Grafos na Seguranca Publica
Trilha .Net - Programacao funcional usando f#
TDC2018SP | Trilha Go - Case Easylocus
TDC2018SP | Trilha Modern Web - Para onde caminha a Web?
TDC2018SP | Trilha Go - Clean architecture em Golang
TDC2018SP | Trilha Go - "Go" tambem e linguagem de QA
TDC2018SP | Trilha Mobile - Digital Wallets - Seguranca, inovacao e tendencia
TDC2018SP | Trilha .Net - Real Time apps com Azure SignalR Service
TDC2018SP | Trilha .Net - Passado, Presente e Futuro do .NET
TDC2018SP | Trilha .Net - Novidades do C# 7 e 8
TDC2018SP | Trilha .Net - Obtendo metricas com TDD utilizando build automatiz...
TDC2018SP | Trilha .Net - .NET funcional com F#
TDC2018SP | Trilha .Net - Crie SPAs com Razor e C# usando Blazor em .Net Core

Recently uploaded (20)

PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
01-Introduction-to-Information-Management.pdf
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
Pharma ospi slides which help in ospi learning
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
master seminar digital applications in india
PPTX
Institutional Correction lecture only . . .
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Classroom Observation Tools for Teachers
PDF
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
Microbial disease of the cardiovascular and lymphatic systems
VCE English Exam - Section C Student Revision Booklet
Abdominal Access Techniques with Prof. Dr. R K Mishra
01-Introduction-to-Information-Management.pdf
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Renaissance Architecture: A Journey from Faith to Humanism
Pharma ospi slides which help in ospi learning
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
102 student loan defaulters named and shamed – Is someone you know on the list?
Anesthesia in Laparoscopic Surgery in India
Supply Chain Operations Speaking Notes -ICLT Program
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
master seminar digital applications in india
Institutional Correction lecture only . . .
STATICS OF THE RIGID BODIES Hibbelers.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Classroom Observation Tools for Teachers
Mark Klimek Lecture Notes_240423 revision books _173037.pdf

TDC2018SP | Trilha Containers - CI/CD com Docker e Drone