DevOps Days India 2013: Build Radiator on Raspberry Pi
-
Upload
akshay-karle -
Category
Technology
-
view
195 -
download
0
description
Transcript of DevOps Days India 2013: Build Radiator on Raspberry Pi
![Page 1: DevOps Days India 2013: Build Radiator on Raspberry Pi](https://reader033.fdocuments.us/reader033/viewer/2022051611/54b372224a7959a1298b45b8/html5/thumbnails/1.jpg)
Build Radiator on Raspberry Pi
Akshay Karle Snap CI
ThoughtWorks, Pune
![Page 2: DevOps Days India 2013: Build Radiator on Raspberry Pi](https://reader033.fdocuments.us/reader033/viewer/2022051611/54b372224a7959a1298b45b8/html5/thumbnails/2.jpg)
PART IThe Basics
![Page 3: DevOps Days India 2013: Build Radiator on Raspberry Pi](https://reader033.fdocuments.us/reader033/viewer/2022051611/54b372224a7959a1298b45b8/html5/thumbnails/3.jpg)
What’s a Build Radiator
![Page 4: DevOps Days India 2013: Build Radiator on Raspberry Pi](https://reader033.fdocuments.us/reader033/viewer/2022051611/54b372224a7959a1298b45b8/html5/thumbnails/4.jpg)
Raspberry PI
![Page 5: DevOps Days India 2013: Build Radiator on Raspberry Pi](https://reader033.fdocuments.us/reader033/viewer/2022051611/54b372224a7959a1298b45b8/html5/thumbnails/5.jpg)
PART IIGetting started
![Page 6: DevOps Days India 2013: Build Radiator on Raspberry Pi](https://reader033.fdocuments.us/reader033/viewer/2022051611/54b372224a7959a1298b45b8/html5/thumbnails/6.jpg)
Installing Linux on your PI
![Page 7: DevOps Days India 2013: Build Radiator on Raspberry Pi](https://reader033.fdocuments.us/reader033/viewer/2022051611/54b372224a7959a1298b45b8/html5/thumbnails/7.jpg)
Installing Linux on your PI
$ wget http://downloads.raspberrypi.org/pidora_latest $ unzip pidora.zip $ dd if=pidora.img of=/dev/disk1s2 bs=4M
![Page 8: DevOps Days India 2013: Build Radiator on Raspberry Pi](https://reader033.fdocuments.us/reader033/viewer/2022051611/54b372224a7959a1298b45b8/html5/thumbnails/8.jpg)
Input - servers.yml - type: Snap url: https://snap-ci.com/secret/cctray.xml
![Page 9: DevOps Days India 2013: Build Radiator on Raspberry Pi](https://reader033.fdocuments.us/reader033/viewer/2022051611/54b372224a7959a1298b45b8/html5/thumbnails/9.jpg)
Input - servers.yml - type: Snap url: https://snap-ci.com/secret/cctray.xml
!- type: Go username: user password: password url: https://example.com/cctray.xml
![Page 10: DevOps Days India 2013: Build Radiator on Raspberry Pi](https://reader033.fdocuments.us/reader033/viewer/2022051611/54b372224a7959a1298b45b8/html5/thumbnails/10.jpg)
Controller – application.rb!!require 'yaml’
!def ci_servers @ci_servers ||= YAML::load(File.read('config/servers.yml')) end
![Page 11: DevOps Days India 2013: Build Radiator on Raspberry Pi](https://reader033.fdocuments.us/reader033/viewer/2022051611/54b372224a7959a1298b45b8/html5/thumbnails/11.jpg)
Controller – application.rb!require 'ci_status' require 'yaml’
!def ci_servers @ci_servers ||= YAML::load(File.read('config/servers.yml')) end
!!! ci_servers.each do |ci_server| cc = CiStatus::CruiseControl.new(ci_server['url'], ci_server['username'], ci_server['password']) builds += cc.builds end
![Page 12: DevOps Days India 2013: Build Radiator on Raspberry Pi](https://reader033.fdocuments.us/reader033/viewer/2022051611/54b372224a7959a1298b45b8/html5/thumbnails/12.jpg)
Controller – application.rbrequire 'sinatra' require 'ci_status' require 'yaml’
!def ci_servers @ci_servers ||= YAML::load(File.read('config/servers.yml')) end
!get '/' do builds = [] ci_servers.each do |ci_server| cc = CiStatus::CruiseControl.new(ci_server['url'], ci_server['username'], ci_server['password']) builds += cc.builds end @failed_builds, @success_builds = builds.partition { |build| build.failure? } erb ’builds.html'.to_sym end
![Page 13: DevOps Days India 2013: Build Radiator on Raspberry Pi](https://reader033.fdocuments.us/reader033/viewer/2022051611/54b372224a7959a1298b45b8/html5/thumbnails/13.jpg)
View – builds.html.erb<html> <head> !!! </head> <ul class="builds"> <% @failed_builds.each do |build| %> <li class="build <%= build.status.downcase %>"> <span class="name"><%= build.name %></span> </li> <% end %> <% @success_builds.each do |build| %> <li class="build <%= build.status.downcase %>"> <span class="name"><%= build.name %></span> </li> <% end %> </ul> <html>
![Page 14: DevOps Days India 2013: Build Radiator on Raspberry Pi](https://reader033.fdocuments.us/reader033/viewer/2022051611/54b372224a7959a1298b45b8/html5/thumbnails/14.jpg)
View – builds.html.erb<html> <head> <script> window.setTimeout(function() { window.location.reload(true); }, 10000); </script> </head> <ul class="builds"> <% @failed_builds.each do |build| %> <li class="build <%= build.status.downcase %>"> <span class="name"><%= build.name %></span> </li> <% end %> <% @success_builds.each do |build| %> <li class="build <%= build.status.downcase %>"> <span class="name"><%= build.name %></span> </li> <% end %> </ul> <html>
![Page 15: DevOps Days India 2013: Build Radiator on Raspberry Pi](https://reader033.fdocuments.us/reader033/viewer/2022051611/54b372224a7959a1298b45b8/html5/thumbnails/15.jpg)
Deploy to your pi$ git clone your-build-radiator-repo.git $ bundle install $ bundle exec rackup
![Page 16: DevOps Days India 2013: Build Radiator on Raspberry Pi](https://reader033.fdocuments.us/reader033/viewer/2022051611/54b372224a7959a1298b45b8/html5/thumbnails/16.jpg)
Deploy to your pi$ git clone your-build-radiator-repo.git $ bundle install $ bundle exec rackup
!Open your browser on the pi and navigate to localhost:9292
![Page 17: DevOps Days India 2013: Build Radiator on Raspberry Pi](https://reader033.fdocuments.us/reader033/viewer/2022051611/54b372224a7959a1298b45b8/html5/thumbnails/17.jpg)
The result
![Page 18: DevOps Days India 2013: Build Radiator on Raspberry Pi](https://reader033.fdocuments.us/reader033/viewer/2022051611/54b372224a7959a1298b45b8/html5/thumbnails/18.jpg)
Advantages
• Get fast feedback for your builds • Save money • Save electricity • Its cool! ☺
![Page 19: DevOps Days India 2013: Build Radiator on Raspberry Pi](https://reader033.fdocuments.us/reader033/viewer/2022051611/54b372224a7959a1298b45b8/html5/thumbnails/19.jpg)
Thank youYou can checkout the code at: https://github.com/akshaykarle/simple_build_radiator