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

StreetVoice 自動化部署演進

StreetVoice 自動化部署演進

Ming Shien Tzang

August 23, 2016
Tweet

More Decks by Ming Shien Tzang

Other Decks in Technology

Transcript

  1. ᛔ㵕玕蟂ᗟᄍ蝱
    @ ModernWeb 2016

    View full-size slide

  2. 橕ෝ
    StreetVoice ᤋ肨牏౯

    View full-size slide

  3. 加缏ᶪ禼ᐒᗭ翕ᒊ
    ݣ傀牏詂჈牏Ӿ㾴

    View full-size slide

  4. 窔稧
    碍֖ᶪ禼咳ᤈ

    View full-size slide

  5. 憎挨य़㿁
    襎憙℄ፓ牏ᶪ禼蔭ᄍ

    View full-size slide

  6. 墋㻌ኞၚ℄
    狶ࡅ稭ጱԪ 虏ࡅ稭ጱԪ磪㰷独

    View full-size slide

  7. tzangms
    ੜၹ, Ո圸ၹ者ቘ

    View full-size slide

  8. Intro
    ࣁ෈獺叨禂牧ग़੝犖ฎ஑蝍穩讨ದ蔩

    View full-size slide

  9. ض藯᯿讨
    StreetVoice ই֜狶ᛔ㵕玕蟂ᗟ

    View full-size slide

  10. 蝫ೲ衔᮷犋አೲ
    master branch ݝᥝ磪ๅ碝,
    纷ୗ疰䨝ᛔ㵕蟂ᗟکྋୗ絑ह

    View full-size slide

  11. 傶֜ᥝᛔ㵕蟂ᗟ
    狶ࡅ稭ጱԪ 虏ࡅ稭ጱԪ磪㰷独
    耆卓ጱԪ眐虏犢ᛔ૩㵕

    View full-size slide

  12. 翕ᒊॡग़
    犋ᛔ㵕蟂ᗟ䨝稴Ոጱ
    30+ instance 20+ instance

    View full-size slide

  13. ᥝ揗揣ጱ翕ᒊ

    View full-size slide

  14. 犋ݝ蝡犚
    螭磪皃㮆ࣁ憒㴟Ӿ …

    View full-size slide

  15. ྯ㮆翕ᒊ螭磪犋ݶ絑ह
    production, staging, development

    View full-size slide

  16. 翕ᒊአکጱ䩚ᥜॡग़
    python
    npm
    nginx
    gunicorn cronjob
    worker
    linux
    etc
    طฎӞ㮆翕ᒊ疰አک盄ग़๐率

    View full-size slide

  17. ֕ฎ౯㮉ݝ磪Ӟ㮆 SA
    犥獮ฎ vinta Ӟ㮆Ո獊۱

    View full-size slide

  18. –౯㮉疑 SA
    ̿ᥝ᯿ୌ SV ܈皃ݣ犋ݶአ蝝ጱ֑๐瑊کӤ娄, ݝ
    襑ᥝ妔౯犋ک 20 獤楮̀

    View full-size slide

  19. ᛔ㵕玕蟂ᗟጱ獮൉
    • ᪃䄪ጱᛔ㵕玕介手
    • ૡ֢窕纷
    • 碻樌

    View full-size slide

  20. 蝢Ꭳ
    蝚螂 Slack Ꭳ螇ಅ磪य़ੜԪ

    View full-size slide

  21. 蟂ᗟᄍ蝱
    • FTP
    • Fabric
    • SaltStack
    • Ansible

    View full-size slide

  22. FTP
    犋ᥝᒞ, ک匍ࣁ螭ฎ磪Ոࣁ FTP

    View full-size slide

  23. Fabric
    ݢ犥አ㬵狶盄ग़Ԫ, ݢฎ吚翕ᒊ᩼虋᩼蕦褾ጱ碻狡 …

    View full-size slide

  24. $ salt “*” state.highstate
    ޷ݞ saltstack 蝱ᤈ蟂ᗟ

    View full-size slide

  25. ፗ矑ࣁ hipchat 矒ګ saltstack
    አ hubot 矒ګ

    View full-size slide

  26. 匍ࣁ䷱Ոቘ hubot ԧ
    ࢩ傶蟂ᗟ᮷ᛔ㵕玕ԧ, 犋螂螨ع苭Ӟ, 犢螭ฎࣁ

    View full-size slide

  27. 蟂ᗟᛔ㵕蝢Ꭳ

    View full-size slide

  28. 傶֜矦 Ansible

    View full-size slide

  29. –౯㮉疑 SA
    ̿穉蚏 saltstack牧ࣗ穉斃੝牧
    戔ਧොୗ墋㻌牏竃༩牐̀

    View full-size slide

  30. 蜢舚ጱ䌃纷ୗ
    䌃纷ୗ
    樄 feature branch 盅
    push Ӥ Github ݚ樄
    Pull Request, ࣁ
    merge 獮, 䨝ض Code
    Review
    㪐Ӥ粚๜矒ګ羬翄
    蝚螂 Travis CI ᪒㻌ز
    介手, ইຎ蝢螂介手,
    Code Review 犖䷱㺔
    氂ጱ扖, ׎䨝 merge
    㻌ز介手
    ইຎ磪纷ୗ merge 蝱
    develop ౲ฎ master
    branch, Travis CI 介
    手蝢螂׎䨝ᛔ㵕޷ݞ
    ansible 樄ত蟂ᗟ
    ᛔ㵕蟂ᗟ
    ansible 䨝಩ಅ磪ፘ
    橕֑๐瑊ጱ纷ୗ牏
    戔ਧ᮷ๅ碝ک磧碝
    ጱ制眲
    ๅ碝纷ୗ牏制眲
    ᛔ㵕玕蟂ᗟ窕纷

    View full-size slide

  31. ဳ఺Ԫ殻
    Ջ讕碻狡犋胼ᛔ㵕蟂ᗟ

    View full-size slide

  32. DB migration
    • ࣁ staging 碝ी䳱֖
    • ࣁ production 㳫ᴻ䳱֖
    NoSQL ጱ๏݋藶᪡螂, 蘛蘛!

    View full-size slide

  33. ᛔ㵕玕盅ݢڥአጱ猻玊

    View full-size slide

  34. 䌕ஞ䌃纷ୗ
    蟂ᗟӤ娄஑缛, 㻌ز介手஑缛, 傶֜犋缛ਠ౮蝢Ꭳ疰অ

    View full-size slide

  35. ֦㮉ᛔ㵕玕ԧ㻟?

    View full-size slide