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

Capistranoの罠と他人がハマった事例を見て思うこと / capistrano-trap

1741ebf45ce415e49fb0340da9e1ca15?s=47 KSK
July 25, 2018

Capistranoの罠と他人がハマった事例を見て思うこと / capistrano-trap

1741ebf45ce415e49fb0340da9e1ca15?s=128

KSK

July 25, 2018
Tweet

Transcript

  1. Capistranoͷ᠘ͱ ଞਓ͕ϋϚͬͨࣄྫ Λݟͯࢥ͏͜ͱ ksk1030 @Ebisu.rb #17 / 2018.07.25

  2. ࠓ೔ͷ·ͱΊ ɾCapistoranoͰϋϚͬͨϙΠϯτ ɾຊ࣭తͳ໰୊Λߟ͑Δश׳

  3. લఏ

  4. ߏ੒͸ͬ͘͟Γ͜Μͳײ͡ ϦϙδτϦ deployαʔό webαʔό

  5. None
  6. Capistrano-bundle_rsync ɾDeNAͷ @sonots ͞Μ͕࡞֦ͬͨு ɹ- https://github.com/sonots/capistrano-bundle_rsync ɾσϓϩΠݩͷαʔόͰ git pull, bundle

    install ɹͳͲΛ·ͱΊͯߦ͏ ɹ- ಉ͡ॲཧΛ܁Γฦ͞ͳ͍ͷͰૣ͘ͳΔ ɹ- ֤webαʔόʹෛ୲Λ͔͚ͳ͍ ɹ- ϦϙδτϦ΁ͷΞΫηε΋1αʔόͰࡁΉ
  7. None
  8. PM2 ɾNode.js ͷϓϩηεϚωʔδϟ ɹ- http://pm2.keymetrics.io/ ɾࣅͨΑ͏ͳ forever ͱൺֱͯ͠ߴػೳ ɹ- gracefulReload

    ɹ- ΫϥελԽɺϩʔυόϥϯγϯά΋ ɾjson/yaml ͳͲͰઃఆϑΝΠϧΛఆٛ
  9. ϋϚͬͨ CapistranoḿΔΘʔ Ͱ΋ͨ·ʹίέͯΔʁ 8ׂ͘Β͍͸͏·͍͘͘ gracefulReloadͰ ΍ͬͯΔΜ͚ͩͲ…

  10. Կ͕ى͖͍͔ͯͨ ɾσϓϩΠͯ͠΋ݹ͍pm2ͷઃఆϑΝΠϧ͕ ɹಡ·Εଓ͚͍ͯͨ ɹ ɹ ɹreleases
 ɹɹ┣━20180415 ɹɹ┣━20180501 ɹɹ┣━20180515 ɹɹ┣━20180601

    ɹɹ┗━20180615 ‏ ىಈதͷઃఆϑΝΠϧؚ͕·ΕΔ
  11. Կ͕ى͖͍͔ͯͨ ɾσϓϩΠͯ͠΋ݹ͍pm2ͷઃఆϑΝΠϧ͕ ɹಡ·Εଓ͚͍ͯͨ ɹ ɹ ɹreleases
 ɹɹ┣━20180501 ɹɹ┣━20180515 ɹɹ┣━20180601 ɹɹ┣━20180615

    ‏ ىಈதͷઃఆϑΝΠϧؚ͕·ΕΔ ɹɹ┗━20180701
  12. Կ͕ى͖͍͔ͯͨ ɾσϓϩΠͯ͠΋ݹ͍pm2ͷઃఆϑΝΠϧ͕ ɹಡ·Εଓ͚͍ͯͨ ɹ ɹ ɹreleases
 ɹɹ┣━20180515 ɹɹ┣━20180601 ɹɹ┣━20180615 ‏

    ىಈதͷઃఆϑΝΠϧؚ͕·ΕΔ ɹɹ┣━20180701 ɹɹ┗━20180715
  13. ରԠ ɾCapistranoͷੈ୅؅ཧ͔Β֎͍ͨ͠ ɾϓϩδΣΫτ௚ԼʹઃఆϑΝΠϧ͕ ɹஔ͔Εͳ͍ͱ͏·͘ಈ͔ͳ͍ ઃఆϑΝΠϧͷ࣮ଶ͸ ./shared ʹɺ ϓϩδΣΫτ௚Լ͔ΒγϯϘϦοΫϦϯΫ

  14. ͔͜͠͠Εͬͯ…

  15. ൓ল ɾCapistranoͷੈ୅؅ཧͰϋϚͬͨ࿩͸ଟ͍ ɾࠓճ͸pm2΍Capistranoͷ֦ுΛ࢖༻ͯ͠ ɹ͍ͨͷͰͦͬͪʹ໨͕ߦ͍ͬͯͨ ɾϋϚͬͨࣄྫͷຊ࣭తͳ໰୊Λݟ͍ͯΕ͹ ɹ΋ͬͱૣ͘ݪҼʹͨͲΓண͚ͨՄೳੑ

  16. ΋͏Ұ౓·ͱΊ ɾCapistoranoͰϋϚͬͨϙΠϯτ ɹ- ੈ୅؅ཧ × γϯϘϦοΫϦϯΫ ɾຊ࣭తͳ໰୊Λߟ͑Δश׳ ɹ- ද໘্Ͱى͖͍ͯΔ͜ͱͰͳ͘ɺ ɹʮͳͥͦͷ໰୊͕ى͖ͨͷ͔ʁʯ

  17. ࣗݾ঺հ ɾKeisuke Nakatane (@ksk1030) ɾORSO Inc. ৽نࣄۀ։ൃࣨ ɾαʔόɿΞϓϦɿϑϩϯτ ʹɹ̓ɹɿɹ̍ɹɿɹ̎ɹɹ͘Β͍ ɾલ৬͸ژ౎ͷήʔϜ԰Ͱਓࣄ

    ɾΤϯδχΞੵۃ࠾༻தʂʂ
  18. Thank you for listening !!