drone your ansible

27
Drone your Ansible Dennis Rowe @shr3kst3r wpengine.com

Upload: dennis

Post on 29-Jun-2015

1.502 views

Category:

Technology


8 download

DESCRIPTION

Testing Ansible code with Drone.

TRANSCRIPT

Page 1: Drone your Ansible

Drone your Ansible

Dennis Rowe @shr3kst3r

wpengine.com

Page 2: Drone your Ansible

Drone

•https://github.com/drone/drone

•“Drone is a Continuous Integration platform built on Docker, written in Go”

•Buzzword score: 4

Page 3: Drone your Ansible

Show Time

•Deploy Droid

•Hook it up to Github

•Test some Ansible code

•Poke around the Drone UI

Page 4: Drone your Ansible

Update Kernel

•apt-get update

•apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring

•reboot

Page 5: Drone your Ansible

Install Docker• apt-key adv --keyserver hkp://

keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9

• sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"

• apt-get update

• apt-get install lxc-docker

Page 6: Drone your Ansible

Install Drone

•wget http://downloads.drone.io/latest/drone.deb

•dpkg -i drone.deb

•start drone

Page 7: Drone your Ansible

http://IP/install

Page 8: Drone your Ansible

Register Drone with Github

Page 9: Drone your Ansible

Important Numbers

Page 10: Drone your Ansible

Add to Drone

Page 11: Drone your Ansible

New Repository

Page 12: Drone your Ansible

Authorize

Page 13: Drone your Ansible

Add Repository

Page 14: Drone your Ansible

Notes

•First run can take a looooong time because it needs to download the Docker image.

Page 15: Drone your Ansible

Completed Run

Page 16: Drone your Ansible

Poking at Docker

Page 17: Drone your Ansible

Now the Configuration

Page 18: Drone your Ansible

Pull

•GitHub

•BitBucket

Page 19: Drone your Ansible

Deployment•Cloud Foundry

•Engine Yard

•Git Push

•Bash

•Heroku

•Modulus

•Nodejitsu

•Tsuru

Page 20: Drone your Ansible

Publish

•S3

•Swift

•PyPI

•NPM

•Docker

Page 21: Drone your Ansible

Services•cassandra

•couchdb

•elasticsearch

•neo4j

•mongodb

•mysql

•postgres

•rabbitmq

•redis

•riak

•zookeeper

Page 22: Drone your Ansible

Notifications

•E-Mail

•Webhook

•Hipchat

Page 23: Drone your Ansible

Other Stuff

•Can launch custom Docker containers

•Can persist directories between builds

•Parameter injection in to the .drone.yml

Page 24: Drone your Ansible

.drone.ymlimage: python2.7 env: script: - sudo apt-get update - sudo apt-get install software-properties-common - sudo apt-add-repository ppa:ansible/ansible - sudo apt-get update - sudo apt-get install ansible - sudo pip install https://github.com/willthames/ansible-lint/archive/master.zip - sudo apt-get install rubygems - sudo gem install serverspec - sudo gem install rake - sudo ./drone_it notify: email: recipients: - [email protected]

Page 25: Drone your Ansible

drone_it

•Lints the Ansible code

•Deploys the Ansible code

•Runs server-spec to verify

•https://github.com/shr3kst3r/ansible-drone-example/blob/master/drone_it

Page 26: Drone your Ansible

Thoughts

•Would like to be able to test multiple docker images (https://github.com/drone/drone/issues/6).

•Hard to create complex setups.

•Can’t edit /etc/hosts because it is a bind mount.

Page 27: Drone your Ansible

Odds and Ends

•https://github.com/shr3kst3r/ansible-drone-example

•You can reach me at [email protected] or @shr3kst3r on the twitters