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

とある業務オペレーション自動化の話

onigra
October 09, 2015

 とある業務オペレーション自動化の話

StackOverflow DevDays in Japan 2015.10.09

onigra

October 09, 2015
Tweet

More Decks by onigra

Other Decks in Technology

Transcript

  1. • Web Application Developer • DevOps • Rubyist • My

    favorite episode of Joel on Software: My First BillG Review
  2. We buy at Japanese EC on your behalf and ship

    the items to your address overseas.
  3. Blue-Green Deployment • Auto Scaling Groupʹର͢ΔELBͷ෇͚֎͕͠Ͱ͖ΔΑ͏ʹͳͬͨͷͰಋ ೖ • ௨ৗͷDeploy͸Capistranoɺϛυϧ΢ΣΞ౳ͷΞοϓσʔτΛߦͬͨࡍ ʹ͸BG

    Deploy • PackerͰAnsible͕࢖͍ͮΒ͔ͬͨΓɺLaunch Config࡞੒΍Auto Scaling Groupͷ੾ସΛࣗಈͰ΍Γ͔ͨͬͨͷͰࣗ࡞ͷPacker clone cliΛ࡞੒ • http://github.com/onigra/tsudura • https://speakerdeck.com/onigra/about-tsudura
  4. class WorkerSession attr_reader :session def initialize tempfile = Tempfile.new(prefix, path)

    Capybara.register_driver :poltergeist do |app| Capybara::Poltergeist::Driver.new( app, phantomjs_options: [ "--cookies-file=#{tempfile.path}", ] ) end @session = Capybara::Session.new(:poltergeist) end end
  5. class ExampleRunner def initialize(param) @param = param @capybara = WorkerSession.new

    end def run login access_to_checkout select_shipping_method select_payment_method submit ensure logout delete_session end end
  6. ։ൃ։͔࢝ΒϦϦʔε·Ͱ • ։ൃ։͔࢝Β2ि͙ؒΒ͍ͰϦϦʔε • جຊ1ਓͰ։ൃɺΠϯϑϥɺӡ༻ • ϑΝʔετϦϦʔε͸Ұ෦ػೳͷΈ • ϑΝʔετϦϦʔεޙɺগͣͭ͠ଞͷਓʹख఻ͬͯ΋ΒͬͨΓ •

    ܧଓతʹϦϦʔεΛߦ͍ɺ࠷ऴతʹۀ຿ଆ͕΍Γ͍ͨ͜ͱΛશ෦࣮ݱɻͦ ͷܭըΛͪΌΜͱۀ຿୲౰ऀͱѲͬͨ • CIͱσϓϩΠͷ࢓૊ΈΛ͔ͬ͠Γ੔උͯͨ͠ͷͰɺҰਓͰ΋͏·͍ͬͨ͘
  7. class ExampleRunner def initialize(param) @param = param @capybara = WorkerSession.new

    end def run login access_to_checkout select_shipping_method select_payment_method submit ensure logout delete_session end end ͜͜΋ବ໨