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

Rails on CircleCI Tuning

Rails on CircleCI Tuning

Yusaku Omasa

May 24, 2018
Tweet

More Decks by Yusaku Omasa

Other Decks in Technology

Transcript

  1. ג ࣜ ձ ࣾ Ϧ ϒη ϯε  w 

       ೥  ݄  " O B M Z U J D T άϧ ʔϓ 
                  ػ ց ֶ श Τ ϯ δχΞ ݟ श ͍  w     ೥  ݄  σ ʔ λ Τ ϯ δχ Ξ Ϧ ϯ ά ν ʔϜ 
                  σ ʔ λ Τ ϯ δχΞ  w     ೥  ݄  ब ׆ ձ ٞ Ϣ χ ο τ 
                  8 F C Τ ϯ δχΞ :VTBLV0NBTB ! @ F V S L  U B J T F
  2. ໨ඪܭଌ w ໨ඪ஋ΛܾΊΔ w zMJOUͱςετͰ෼ɺσϓϩΠؚΊͯ෼z w Ϝμʹ͓ۚ΍࣌ؒΛ͔͚ͯ͠·Θͳ͍Α͏࠷ॳʹܾΊΔ w ύϑΥʔϚϯενϡʔχϯάͱಉ͡ w

    ܭଌ w ͬ͘͟Γͱͨ͠ॲཧ࣌ؒ͸$JSDMF$*্Ͱ֬ೝ͢Δ w $*ॲཧͰγΣϧʹ·ͱ·͍ͬͯΔ΋ͷ͸ɺ
 AEBUFAίϚϯυΛࠩ͠ࠐΜͩΓͯ͠ܭଌ͢Δ
  3. 3BJMTΞϓϦͷ$*δϣϒྫ δϣϒ ॲཧ಺༰ྫ ฒྻ෼ׂ ࣮ߦ࣌ؒ ϓϩϏδϣχϯά • bundle install •

    yarn • pip install awscli ✕ Ұఆ lint • rubocop • haml-lint • scss-lint • eslint ̋ ίʔυྔʹൺྫͯ͠
 ࣮ߦ࣌ؒ૿ ςετ • rspec • karma + mocha ̋ ςετέʔεʹൺྫͯ͠
 ࣮ߦ࣌ؒ૿ σϓϩΠ • assets:precompile • zip + AWS S3 put • AWS CodeDeploy ✕ ΄΅Ұఆ
  4. $JSDMF$*ͷฒྻ࣮ߦ $JSDMF$*͸ෳ਺ίϯςφͰฒྻ࣮ߦ͕Մೳ w ۚͷ஄ؙ͕݁Ռతʹz͍҆z͜ͱ΋ଟ͍ w ฒྻ෼ׂՄೳͳδϣϒͷ৔߹ɺ࠷దԽʹ͔͚Δ޻਺ΑΓ΋
 ίϯςφ௥Ճ  ͷํ͕ૣ͍͍҆͠ w

    αʔϏε։ൃظؒͷܦաͱͱ΋ʹ࣮ߦ͕࣌ؒ৳ͼ͕ͪͳδϣϒ
 MJOU΍ςετ ͸ɺίϯςφ௥ՃͰߴ଎ԽͰ͖ΔΑ͏ʹ͓͖͍ͯͨ͠ w ब׆ձٞͰ͸YYͰӡ༻ίϯςφΛฒྻ w ฒྻʹ૿΍͢͜ͱͰςετͷ࣮ߦ࣌ؒ͸୹ॖͰ͖ͨ ෼ˠ෼
  5. w ίετ w ແݶʹίϯςφ૿΍͍͕ͨ͠ɺແݶʹ͓ۚ͸ͳ͍ w Ϩʔϯ਺ w $*ͷಉ࣮࣌ߦ਺ΛϨʔϯ਺ͱ͢Δ w Ωϡʔ଴͕ͪ૿͑ͨΒϨʔϯ਺Λ૿΍͢

    w ฒྻ਺ w ϨʔϯͰ࢖͑Δίϯςφ਺ w ճͷ$*͕࣌ؒ୹͘ͳΔ w Ωϡʔ଴ͪ࣌ؒΑΓ΋࣮ߦΩϡʔ͕ۭ͍͍ͯΔ࣌ؒͷํ͕௕͍ࣄ͕ଟ͍ͷͰɺ
 Ϩʔϯ਺Λ૿΍͢ΑΓɺฒྻ਺Λ૿΍ͯ͠ճͷ$*࣌ؒΛ୹ॖͨ͠΄͏͕ɺ
 Ϧιʔείετޮ཰͕ྑ͘ͳ͍ͬͯ͘ $*ͷτϨʔυΦϑ ྫ YY ίϯςφ ฒྻ Ϩʔϯ
  6. ೚ҙͷλΠϛϯάͰ߱ͬͯ͘ΔλεΫΛͲ͏ࡹ͔͘
 ίϯςφΛ࠷େݶʹ׆༻͢Δ $*ͷॲཧೳྗ ίϯςφ਺ ࣌ؒ ϓϩ
 Ϗδϣ
 χϯά Lint ςετ

    σϓϩΠ ϓϩ
 Ϗδϣ
 χϯά Lint ςετ σϓϩΠ ϓϩ
 Ϗδϣ
 χϯά Lint ςετ σϓϩΠ Ωϡʔ଴ͪ
  7. $JSDMF$*ͷػೳ w δϣϒΛখ෼͚ʹ͢Δ͜ͱͰɺۭ͍͍ͯΔϦιʔεΛ
 ༗ޮ׆༻Ͱ͖Δ w ฒྻ਺΋δϣϒ͝ͱʹࢦఆͰ͖Δ w ෼͚Δ΄ͲϓϩϏδϣχϯάͷ
 ίετ͕ຖճ͔͔ΔͷͰɺ
 Ωϟογϡ͸͏·͘࢖͍ͭͭ


    ͪΐ͏Ͳ͍͍αΠζʹ෼ׂΛཹΊΔ 8PSLqPXTͰδϣϒΛ෼ׂ ίϯςφ਺ ࣌ؒ ϓϩ
 Ϗδϣ Lint ςετ σϓϩΠ ϓϩ
 Ϗδϣ ςετ ϓϩ
 Ϗδϣ ϓϩ
 Ϗδϣ Lint ςετ σϓϩΠ ϓϩ
 Ϗδϣ ςετ ϓϩ
 Ϗδϣ ςετ ϓϩ
 Ϗδϣ
  8. w $BDIF w ಉҰͷδϣϒؒͰɺࢦఆͨ͠
 σΟϨΫτϦΛอଘɾల։Ͱ͖Δ $JSDMF$*ͷΩϟογϡ w 8PSLTQBDF w ࣮ߦલޙͷδϣϒؒͰɺࢦఆͨ͠


    σΟϨΫτϦΛอଘɾల։Ͱ͖Δ SFG$JSDMF$*%PDT$BDIJOH%FQFOEFODJFT SFG$JSDMF$*%PDT0SDIFTUSBUJOH8PSLqPXT $JSDMF$*ͷػೳ
  9. w δϣϒͷDBDIF͸࠷େݶ׆༻͢Δ w WFOEPSCVOEMF΍OPEF@NPEVMFTͳͲ w &MBTUJDTFBSDI΋σΟϨΫτϦ͝ͱΩϟογϡ͢Δ w 8PSLqPXTͷDBDIF XPSLTQBDF ͸׆༻Ͱ͖Ε͹࢖͏

    w ઌߦδϣϒΑΓ΋ɺޙଓδϣϒͷฒྻ౓͕ߴ͍৔߹͸࢖͑ͳ͍ w BUUBDIͰ͖ΔXPSLTQBDF͕଍Γͳͯ͘ΤϥʔʹͳΔʜ w Φʔόʔϔουͱ࣌ؒ୹ॖͷόϥϯε w XPSLTQBDFΛѹॖͯ͠ετϨʔδʹΞοϓͯ͠ɺ࣍ͷδϣϒͰ
 μ΢ϯϩʔυͯ͠ల։͢Δͷ΋Φʔόʔϔου $JSDMF$*ͷΩϟογϡ