DIY build radiators on Raspberry Pi

De3b431e5956bcda51bbb9697399806e?s=47 tektalks
November 17, 2013

DIY build radiators on Raspberry Pi

#DevOpsDays India 2013 : DIY build radiators on Raspberry Pi

De3b431e5956bcda51bbb9697399806e?s=128

tektalks

November 17, 2013
Tweet

Transcript

  1. Build Radiator on Raspberry Pi Akshay Karle Snap CI ThoughtWorks,

    Pune
  2. PART I The Basics

  3. What’s a Build Radiator

  4. Raspberry PI

  5. PART II Getting started

  6. Installing Linux on your PI

  7. Installing Linux on your PI $ wget http://downloads.raspberrypi.org/pidora_latest $ unzip

    pidora.zip $ dd if=pidora.img of=/dev/disk1s2 bs=4M
  8. Input - servers.yml - type: Snap url: https://snap-ci.com/secret/cctray.xml

  9. 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
  10. Controller – application.rb require 'yaml’ def ci_servers @ci_servers ||= YAML::load(File.read('config/servers.yml'))

    end
  11. 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
  12. Controller – application.rb require '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
  13. 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>
  14. 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>
  15. Deploy to your pi $ git clone your-build-radiator-repo.git $ bundle

    install $ bundle exec rackup
  16. 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
  17. The result

  18. Advantages • Get fast feedback for your builds • Save

    money • Save electricity • Its cool! 
  19. Thank you You can checkout the code at: https://github.com/akshaykarle/simple_build_radiator