Barcelona Devops Meetup 4 Oct 2018
Building a Continuous Delivery platform
With drone-server and gogs
Barcelona Devops Meetup 4 Oct 2018
# About me
# $name = Pol Jane
# $position = DevOps Engineer
# $where = Edrans Iberia
# $expertise_level = +15 (years)
# $hobbies = [“linux”,”security”,”automation”,“cloud computing”,“kitesurf”]
Barcelona Devops Meetup 4 Oct 2018
# What are we going to talk about?
# What is a CI/CD and why we need it?
# Benefits of using CI/CD
# The tools: drone-server & gogs
# Setting up the environment + explanation
# Start playing, run jobs & deploy stuff!
# Q&A
Barcelona Devops Meetup 4 Oct 2018
# What is a CI/CD and why we need it?
★ CI and CD are the pillars of a
successful DevOps team
★ Establish and optimize the CI/CD
development model and reap the
benefits
Barcelona Devops Meetup 4 Oct 2018
# What is a CI/CD and why we need it?
★ Companies need to build an effective
pipeline to automate their build,
integration and testing processes.
★ It helps us to automate the testing:
- Merge readiness
- Code review
- Unit testing
- Integration testing
- UI testing
- Performance testing
- Security testing
Barcelona Devops Meetup 4 Oct 2018
# Benefits of using CI/CD★ Developers have
greater control over
the whole process
★ We can quickly
bring up new
environments, test
against them and
easily start over
★ Decreases repetitive,
manual work and with
it the opportunity for
“fat finger” mistakes
# Benefits of using CI/CD
Barcelona Devops Meetup 4 Oct 2018
# The tools: drone-server & gogs
def
Drone-server
A Continuous Delivery
platform
built on Docker,
written in Go
Gogs
A painless
self-hosted Git
service
Barcelona Devops Meetup 4 Oct 2018
# Benefits of using CI/CD★ 100% open source
& free of charge
★ Faster than others
★ Simple & minimal
★ Native AWS integration
★ Several plugins
#Pros & Cons
Barcelona Devops Meetup 4 Oct 2018
# Benefits of using CI/CD★ Easy pipelines syntax
★ Container native
★ Jenkins is the undisputed
king of plugins
#Pros & Cons
Barcelona Devops Meetup 4 Oct 2018
# But….How it works?
def
Drone-Agent
Barcelona Devops Meetup 4 Oct 2018
# Run in local, run in the cloud, or attach AWS resources
to your pipeline!
Barcelona Devops Meetup 4 Oct 2018
# Run in local, run in the cloud, or attach AWS resources
to your pipeline!
Barcelona Devops Meetup 4 Oct 2018
# The workflow
Barcelona Devops Meetup 4 Oct 2018
# Just tech stuff
Barcelona Devops Meetup 4 Oct 2018
docker-compose.yml
version: '2'
services:
db:
image: "mysql/mysql-server:5.6"
ports:
- "13306:3306"
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=gogs
- MYSQL_USER=gogs
- MYSQL_PASSWORD=gogs
- MYSQL_ROOT_HOST=%
volumes:
- /tmp/mysql:/var/lib/mysql
restart: always
networks:
red:
aliases:
- db
Barcelona Devops Meetup 4 Oct 2018
docker-compose.yml
gogs:
image: "gogs/gogs"
ports:
- "10022:22"
- "3000:3000"
depends_on:
- db
volumes:
- /tmp/gogs:/data
restart: always
networks:
red:
aliases:
- gogs
drone-server:
image: drone/drone:0.8
ports:
- 8000:8000
volumes:
- /tmp/drone:/var/lib/drone/
Barcelona Devops Meetup 4 Oct 2018
docker-compose.yml
restart: always
depends_on:
- gogs
environment:
- DRONE_OPEN=true
- DRONE_GOGS=true
- DRONE_ADMIN=careto
- DRONE_HOST=http://drone-server
- DRONE_GOGS_URL=http://gogs:3000
- DRONE_SECRET=12345678
- DRONE_GOGS_SECRET=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZXh0I
networks:
red:
aliases:
- drone-server
drone-agent:
image: drone/agent:0.8
restart: always
Barcelona Devops Meetup 4 Oct 2018
docker-compose.yml
depends_on:
- drone-server
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- DRONE_SERVER=drone-server:9000
- DRONE_SECRET=12345678
networks:
red:
aliases:
- drone-agent
networks:
red:
ipam:
config:
- subnet: 10.5.0.0/16
gateway: 10.5.0.1
Barcelona Devops Meetup 4 Oct 2018
#demotime
Barcelona Devops Meetup 4 Oct 2018
# Resources & Documentation
Gogs official documentation:
https://gogs.io/docs
Drone-Server official repo:
https://github.com/drone/drone
Meetup DEMO repo:
https://github.com/zpol/meetup-demo
Barcelona Devops Meetup 4 Oct 2018
We’re hiring!
More info:
https://edrans.applytojob.com/apply
● OpenStack DevOps Engineer @ BCN
● Senior Devops Engineer @ BCN
● Senior PHP Front End Developer @ BCN
● Site Reliability Engineer (SRE) @ BCN
Thank you

Ci/CD platform with drone and gogs

  • 1.
    Barcelona Devops Meetup4 Oct 2018 Building a Continuous Delivery platform With drone-server and gogs
  • 2.
    Barcelona Devops Meetup4 Oct 2018 # About me # $name = Pol Jane # $position = DevOps Engineer # $where = Edrans Iberia # $expertise_level = +15 (years) # $hobbies = [“linux”,”security”,”automation”,“cloud computing”,“kitesurf”]
  • 3.
    Barcelona Devops Meetup4 Oct 2018 # What are we going to talk about? # What is a CI/CD and why we need it? # Benefits of using CI/CD # The tools: drone-server & gogs # Setting up the environment + explanation # Start playing, run jobs & deploy stuff! # Q&A
  • 4.
    Barcelona Devops Meetup4 Oct 2018 # What is a CI/CD and why we need it? ★ CI and CD are the pillars of a successful DevOps team ★ Establish and optimize the CI/CD development model and reap the benefits
  • 5.
    Barcelona Devops Meetup4 Oct 2018 # What is a CI/CD and why we need it? ★ Companies need to build an effective pipeline to automate their build, integration and testing processes. ★ It helps us to automate the testing: - Merge readiness - Code review - Unit testing - Integration testing - UI testing - Performance testing - Security testing
  • 6.
    Barcelona Devops Meetup4 Oct 2018 # Benefits of using CI/CD★ Developers have greater control over the whole process ★ We can quickly bring up new environments, test against them and easily start over ★ Decreases repetitive, manual work and with it the opportunity for “fat finger” mistakes # Benefits of using CI/CD
  • 7.
    Barcelona Devops Meetup4 Oct 2018 # The tools: drone-server & gogs def Drone-server A Continuous Delivery platform built on Docker, written in Go Gogs A painless self-hosted Git service
  • 8.
    Barcelona Devops Meetup4 Oct 2018 # Benefits of using CI/CD★ 100% open source & free of charge ★ Faster than others ★ Simple & minimal ★ Native AWS integration ★ Several plugins #Pros & Cons
  • 9.
    Barcelona Devops Meetup4 Oct 2018 # Benefits of using CI/CD★ Easy pipelines syntax ★ Container native ★ Jenkins is the undisputed king of plugins #Pros & Cons
  • 10.
    Barcelona Devops Meetup4 Oct 2018 # But….How it works? def Drone-Agent
  • 11.
    Barcelona Devops Meetup4 Oct 2018 # Run in local, run in the cloud, or attach AWS resources to your pipeline!
  • 12.
    Barcelona Devops Meetup4 Oct 2018 # Run in local, run in the cloud, or attach AWS resources to your pipeline!
  • 13.
    Barcelona Devops Meetup4 Oct 2018 # The workflow
  • 14.
    Barcelona Devops Meetup4 Oct 2018 # Just tech stuff
  • 15.
    Barcelona Devops Meetup4 Oct 2018 docker-compose.yml version: '2' services: db: image: "mysql/mysql-server:5.6" ports: - "13306:3306" environment: - MYSQL_ROOT_PASSWORD=root - MYSQL_DATABASE=gogs - MYSQL_USER=gogs - MYSQL_PASSWORD=gogs - MYSQL_ROOT_HOST=% volumes: - /tmp/mysql:/var/lib/mysql restart: always networks: red: aliases: - db
  • 16.
    Barcelona Devops Meetup4 Oct 2018 docker-compose.yml gogs: image: "gogs/gogs" ports: - "10022:22" - "3000:3000" depends_on: - db volumes: - /tmp/gogs:/data restart: always networks: red: aliases: - gogs drone-server: image: drone/drone:0.8 ports: - 8000:8000 volumes: - /tmp/drone:/var/lib/drone/
  • 17.
    Barcelona Devops Meetup4 Oct 2018 docker-compose.yml restart: always depends_on: - gogs environment: - DRONE_OPEN=true - DRONE_GOGS=true - DRONE_ADMIN=careto - DRONE_HOST=http://drone-server - DRONE_GOGS_URL=http://gogs:3000 - DRONE_SECRET=12345678 - DRONE_GOGS_SECRET=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZXh0I networks: red: aliases: - drone-server drone-agent: image: drone/agent:0.8 restart: always
  • 18.
    Barcelona Devops Meetup4 Oct 2018 docker-compose.yml depends_on: - drone-server volumes: - /var/run/docker.sock:/var/run/docker.sock environment: - DRONE_SERVER=drone-server:9000 - DRONE_SECRET=12345678 networks: red: aliases: - drone-agent networks: red: ipam: config: - subnet: 10.5.0.0/16 gateway: 10.5.0.1
  • 19.
    Barcelona Devops Meetup4 Oct 2018 #demotime
  • 20.
    Barcelona Devops Meetup4 Oct 2018 # Resources & Documentation Gogs official documentation: https://gogs.io/docs Drone-Server official repo: https://github.com/drone/drone Meetup DEMO repo: https://github.com/zpol/meetup-demo
  • 21.
    Barcelona Devops Meetup4 Oct 2018 We’re hiring! More info: https://edrans.applytojob.com/apply ● OpenStack DevOps Engineer @ BCN ● Senior Devops Engineer @ BCN ● Senior PHP Front End Developer @ BCN ● Site Reliability Engineer (SRE) @ BCN Thank you