Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Rove

 Rove

Andrey Deryabin

May 31, 2013
Tweet

More Decks by Andrey Deryabin

Other Decks in Technology

Transcript

  1. MULTI_JSON или история о потерянном времени def default_adapter return :oj

    if defined?(::Oj) return :yajl if defined?(::Yajl) return :json_gem if defined?(::JSON) return :gson if defined?(::Gson) // ... end
  2. CONTINUOUS INTEGRATION • Самотестируемая сборка • Автоматизация сборки • Единый

    репозиторий • Быстрая сборка • Доступ до последней сборки • Каждое изменение в репозитории должно включаться в сборку на интеграционном сервере • Автоматическое развертывание • Производите тестирование в копии среды реальной эксплуатации • Простой доступ к файлам последней сборки
  3. ПОЛЕЗНЫЕ НАСТРОЙКИ Vagrant::Config.run do |config| config.vm.box = "debian" config.ssh.forward_agent =

    true config.vm.box_url = "http://f.willianfernandes.com.br/vagrant-boxes/ DebianSqueeze64.box" config.vm.forward_port 3001, 3001 config.vm.forward_port 4000, 4000 config.vm.forward_port 5432, 5432 config.vm.forward_port 4567, 4567 config.vm.share_folder "code", "/code", "~/code", :nfs => true end Прокидываем ssh-ключи Прокидываем порты Прокидываем папки Путь до образа
  4. НАСТРАИВАЕМ CHEF-SOLO (CHEFFILE) # encoding: utf-8 site 'http://community.opscode.com/api/v1' cookbook 'apt'

    cookbook 'rbenv', :git => 'git://github.com/fnichol/chef-rbenv.git' cookbook 'ruby_build', :github => 'fnichol/chef-ruby_build', :ref => 'v0.7.2' cookbook 'postgresql', :github => 'express42-cookbooks/postgresql'
  5. НАСТРАИВАЕМ CHEF-SOLO (VAGRANTFILE) Vagrant::Config.run do |config| config.vm.provision :chef_solo do |chef|

    chef.cookbooks_path = ["cookbooks"] chef.add_recipe "apt" chef.add_recipe 'ruby_build' chef.add_recipe 'rbenv::user' chef.add_recipe 'postgresql' chef.json = { 'rbenv' => { 'user_installs' => [ { 'user' => 'vagrant', 'rubies' => ['1.9.3-p392'], 'global' => '1.9.3-p392' } ] } } end end
  6. PACKAGE #1 Rove.chef_package :sqlite do title 'SQLite' category 'Databases' cookbook

    'sqlite' recipe 'sqlite' end # Vagrantfile config.vm.provision :chef_solo do |chef| chef.cookbooks_path = ["cookbooks"] chef.add_recipe "sqlite" end # Cheffile cookbook 'git'
  7. PACKAGE #2 Rove.chef_package :nodejs do title 'Node.js' category 'Languages' cookbook

    'nodejs', :github => 'mdxp/nodejs-cookbook' recipe 'nodejs' end # Vagrantfile config.vm.provision :chef_solo do |chef| chef.cookbooks_path = ["cookbooks"] chef.add_recipe "nodejs" end # Cheffile cookbook "nodejs", {:github=>"mdxp/nodejs- cookbook"}
  8. PACKAGE #3 Rove.chef_package :git do category 'Version controls' cookbook 'git'

    recipe 'git' input :prefix do default '/usr/local' config {|value| {git: {prefix: value}}} end end
  9. PACKAGE #3 # Vagrantfile chef.add_recipe 'git' chef.json = { :git

    => { :prefix => "/bin" } } # Cheffile cookbook 'sqlite' Rove.chef_package :git do category 'Version controls' cookbook 'git' recipe 'git' input :prefix do default '/usr/local' config {|value| {git: {prefix: value}}} end end
  10. PACKAGE #4 Rove.chef_package :ruby do category 'Languages' cookbook 'ruby_build', :github

    => 'fnichol/chef-ruby_build', :ref => 'v0.7.2' cookbook 'rbenv', :github => 'fnichol/chef-rbenv' recipe 'ruby_build' recipe 'rbenv::user' # ... end end # Cheffile cookbook "ruby_build", {:github=>"fnichol/chef- ruby_build", :ref=>"v0.7.2"} cookbook "rbenv", {:github=>"fnichol/chef-rbenv"} # Vagrantfile chef.add_recipe 'ruby_build' chef.add_recipe 'rbenv::user'
  11. PACKAGE #4 select 'Ruby Manager' do option :rvm do title

    'RVM' cookbook 'build-essential' cookbook 'rvm', :github => 'fnichol/chef-rvm', :ref => 'v0.9.0' recipe 'rvm::vagrant' recipe 'rvm::system' end option :rbenv do title 'rbenv' cookbook 'ruby_build', :github => 'fnichol/chef-ruby_build', :ref => 'v0.7.2' cookbook 'rbenv', :github => 'fnichol/chef-rbenv' recipe 'ruby_build' recipe 'rbenv::user' # ... end end
  12. PACKAGE #5 Rove.chef_package :mysql do title 'MySQL' category 'Databases' cookbook

    'mysql' recipe 'mysql::server' input :password do title 'Superuser password' default 'password' config do |value| { mysql: { server_root_password: value, server_repl_password: value, server_debian_password: value } } end end end
  13. PATTERN #1 Rove.chef_pattern :rails do title 'Rails' package 'ruby', 'rbenv',

    'rbenv_193', 'rbenv_200' package :postgresql package :redis package :git end
  14. СПИСОК ЛИТЕРАТУРЫ • http://www.martinfowler.com/articles/continuousIntegration.html • https://www.virtualbox.org/ • http://virtualboxes.org/images/ • http://www.vagrantup.com/

    • http://www.vagrantbox.es/ • https://www.engineyard.com/products/local • http://yieldthought.com/post/12239282034/swapped-my-macbook-for-an-ipad