SlideShare ist ein Scribd-Unternehmen logo
1 von 38
Downloaden Sie, um offline zu lesen
УПРАВЛЕНИЕ РАБОЧИМ
             ОКРУЖЕНИЕМ С VAGRANT.
                БЫСТРО И ПРОСТО
                       SPB RUG Meetup 5



Friday, March 22, 13
ДЕРЯБИН
                  АНДРЕЙ
            @aderyabin
     aderyabin@evilmartians.ru




Friday, March 22, 13
Личный опыт




Friday, March 22, 13
КЛАВИАТУРА
       или история о недопитом
             кофе и сыне




Friday, March 22, 13
TURBO PASCAL
              или история о своей
                    сборке




Friday, March 22, 13
PORTABLE
                 или история одной
                      флешки




Friday, March 22, 13
def default_adapter

          MULTI_JSON
                                  return :oj if defined?(::Oj)
                                  return :yajl if defined?(::Yajl)
                                  return :json_gem if defined?(::JSON)
     или история о потерянном     return :gson if defined?(::Gson)
             времени              // ...
                                end




Friday, March 22, 13
BOLGENOS
         или история о новой ОС




Friday, March 22, 13
CONTINUOUS INTEGRATION
    •   Самотестируемая сборка
    •   Автоматизация сборки
    •   Единый репозиторий
    •   Быстрая сборка
    •   Доступ до последней сборки
    •   Каждое изменение в репозитории должно включаться в сборку на
        интеграционном сервере
    •   Автоматическое развертывание
    •   Производите тестирование в копии среды реальной
        эксплуатации
    •   Простой доступ к файлам последней сборки

Friday, March 22, 13
ВОПРОСЫ




Friday, March 22, 13
СКОЛЬКО ВРЕМЕНИ
     НЕОБХОДИМО ДЛЯ
     РАЗВЕРТЫВАНИЯ?




Friday, March 22, 13
ИЗОЛИРОВАНО ЛИ
     ОКРУЖЕНИЕ?




Friday, March 22, 13
ВОЗМОЖНА ЛИ
                       АВТОМАТИЗАЦИЯ?




Friday, March 22, 13
МОЖЕТЕ ЛИ
    ЭКСПЕРИМЕНТИРОВАТЬ?
Friday, March 22, 13
РЕШЕНИЕ



                       +        +




Friday, March 22, 13
$ gem   install vagrant
                       $ gem   install chef
                       $ gem   install librarian

                                                   Бандлер для рецептов




Friday, March 22, 13
УПРАВЛЕНИЕ
       ОБРАЗАМИ


      $ vagrant box list
      $ vagrant box add {title} {url}
      $ vagrant box remove {title}




Friday, March 22, 13
Тут можно расслабиться
   и пойти заварить кофе




Friday, March 22, 13
ПЕРВАЯ
          УСТАНОВКА


                 $ vagrant init base
                 $ vagrant up




Friday, March 22, 13
ПЕРВАЯ
          УСТАНОВКА


                 $ vagrant init base
                 $ vagrant up




Friday, March 22, 13
СТРУКТУРА




Friday, March 22, 13
ПОЛЕЗНЫЕ НАСТРОЙКИ
                        Vagrant::Config.run do |config|                  Прокидываем ssh-ключи
                         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

                                                                          Прокидываем папки


Friday, March 22, 13
НАСТРАИВАЕМ 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




Friday, March 22, 13
НАСТРАИВАЕМ CHEF-SOLO




Friday, March 22, 13
НАСТРАИВАЕМ 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', :guthub => 'express42-cookbooks/
                       postgresql'




Friday, March 22, 13
ЗАПУСК


                 $ librarian-chef install
                 $ vagrant reload




Friday, March 22, 13
ПРОВЕРКА


                 $ librarian-chef install
                 $ vagrant reload




Friday, March 22, 13
ДОПОЛНЕНИЯ
                       AWS support
                       VMware support
                       gem vewee
                       gem vagrantboxes




Friday, March 22, 13
ENGINE YARD
         LOCAL



Friday, March 22, 13
EY LOCAL
                       команды




Friday, March 22, 13
СХЕМЫ РАБОТЫ




Friday, March 22, 13
ОДИН КО МНОГИМ




Friday, March 22, 13
ОДИН К ОДНОМУ




Friday, March 22, 13
ЧТО ПОЛУЧАЕМ?




Friday, March 22, 13
ЧТО ПОЛУЧАЕМ?
                       ✓   Быстрое развертывание на любой OС

                       ✓   Отделение среды разработки от привязки к ноутбуку

                       ✓   Портабельность

                       ✓   Прозрачность

                       ✓   Быстрый доступ

                       ✓   Плацдарм для экспериментов

                       ✓   Новый опыт

Friday, March 22, 13
СПАСИБО ЗА ВНИМАНИЕ




Friday, March 22, 13
СПИСОК ЛИТЕРАТУРЫ


    •   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




Friday, March 22, 13
ВОПРОСЫ?




Friday, March 22, 13

Weitere ähnliche Inhalte

Empfohlen

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Empfohlen (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Vagrant

  • 1. УПРАВЛЕНИЕ РАБОЧИМ ОКРУЖЕНИЕМ С VAGRANT. БЫСТРО И ПРОСТО SPB RUG Meetup 5 Friday, March 22, 13
  • 2. ДЕРЯБИН АНДРЕЙ @aderyabin aderyabin@evilmartians.ru Friday, March 22, 13
  • 4. КЛАВИАТУРА или история о недопитом кофе и сыне Friday, March 22, 13
  • 5. TURBO PASCAL или история о своей сборке Friday, March 22, 13
  • 6. PORTABLE или история одной флешки Friday, March 22, 13
  • 7. def default_adapter MULTI_JSON return :oj if defined?(::Oj) return :yajl if defined?(::Yajl) return :json_gem if defined?(::JSON) или история о потерянном return :gson if defined?(::Gson) времени // ... end Friday, March 22, 13
  • 8. BOLGENOS или история о новой ОС Friday, March 22, 13
  • 9. CONTINUOUS INTEGRATION • Самотестируемая сборка • Автоматизация сборки • Единый репозиторий • Быстрая сборка • Доступ до последней сборки • Каждое изменение в репозитории должно включаться в сборку на интеграционном сервере • Автоматическое развертывание • Производите тестирование в копии среды реальной эксплуатации • Простой доступ к файлам последней сборки Friday, March 22, 13
  • 11. СКОЛЬКО ВРЕМЕНИ НЕОБХОДИМО ДЛЯ РАЗВЕРТЫВАНИЯ? Friday, March 22, 13
  • 12. ИЗОЛИРОВАНО ЛИ ОКРУЖЕНИЕ? Friday, March 22, 13
  • 13. ВОЗМОЖНА ЛИ АВТОМАТИЗАЦИЯ? Friday, March 22, 13
  • 14. МОЖЕТЕ ЛИ ЭКСПЕРИМЕНТИРОВАТЬ? Friday, March 22, 13
  • 15. РЕШЕНИЕ + + Friday, March 22, 13
  • 16. $ gem install vagrant $ gem install chef $ gem install librarian Бандлер для рецептов Friday, March 22, 13
  • 17. УПРАВЛЕНИЕ ОБРАЗАМИ $ vagrant box list $ vagrant box add {title} {url} $ vagrant box remove {title} Friday, March 22, 13
  • 18. Тут можно расслабиться и пойти заварить кофе Friday, March 22, 13
  • 19. ПЕРВАЯ УСТАНОВКА $ vagrant init base $ vagrant up Friday, March 22, 13
  • 20. ПЕРВАЯ УСТАНОВКА $ vagrant init base $ vagrant up Friday, March 22, 13
  • 22. ПОЛЕЗНЫЕ НАСТРОЙКИ Vagrant::Config.run do |config| Прокидываем ssh-ключи 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 Прокидываем папки Friday, March 22, 13
  • 23. НАСТРАИВАЕМ 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 Friday, March 22, 13
  • 25. НАСТРАИВАЕМ 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', :guthub => 'express42-cookbooks/ postgresql' Friday, March 22, 13
  • 26. ЗАПУСК $ librarian-chef install $ vagrant reload Friday, March 22, 13
  • 27. ПРОВЕРКА $ librarian-chef install $ vagrant reload Friday, March 22, 13
  • 28. ДОПОЛНЕНИЯ AWS support VMware support gem vewee gem vagrantboxes Friday, March 22, 13
  • 29. ENGINE YARD LOCAL Friday, March 22, 13
  • 30. EY LOCAL команды Friday, March 22, 13
  • 35. ЧТО ПОЛУЧАЕМ? ✓ Быстрое развертывание на любой OС ✓ Отделение среды разработки от привязки к ноутбуку ✓ Портабельность ✓ Прозрачность ✓ Быстрый доступ ✓ Плацдарм для экспериментов ✓ Новый опыт Friday, March 22, 13
  • 37. СПИСОК ЛИТЕРАТУРЫ • 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 Friday, March 22, 13