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

Unity開発現場を支えるJenkins

Cygames
November 30, 2015

 Unity開発現場を支えるJenkins

2015/11/15 Cygames Tech Fes

Cygames

November 30, 2015
Tweet

More Decks by Cygames

Other Decks in Programming

Transcript

  1. 自己紹介 • ݹֶؓ ΤϯδχΞ • ήʔϜۀք೥ • ωΠςΟϒΞϓϦͷݱ৔ʹೖΓ௚઀αϙʔτɻ ΫϥΠΞϯτϝΠϯɻαʔόʔ΋؀ڥߏங΋ϦʔμʔͰ΋ ඞཁͰ͋Ε͹ԿͰ΋ɻ

    • ࠷ۙ͸िҰࣾ಺ษڧձͱ͔։͍ͨΓ $POGJEFOUJBM $PQZSJHIU ˜$ZHBNFT *OD "MM3JHIUT3FTFSWFE   
  2. Gendarme ルール w (FOEBSNF3VMFT#BE1SBDUJDF w (FOEBSNF3VMFT$PODVSSFODZ w (FOEBSNF3VMFT$PSSFDUOFTT w (FOEBSNF3VMFT%FTJHO

    w (FOEBSNF3VMFT%FTJHO(FOFSJD w (FOEBSNF3VMFT%FTJHO-JOR w (FOEBSNF3VMFT&YDFQUJPOT w (FOEBSNF3VMFT*OUFSPQFSBCJMJUZ w (FOEBSNF3VMFT.BJOUBJOBCJMJUZ w (FOEBSNF3VMFT/BNJOH w (FOEBSNF3VMFT1FSGPSNBODF w (FOEBSNF3VMFT1PSUBCJMJUZ w (FOEBSNF3VMFT4FDVSJUZ w (FOEBSNF3VMFT4FDVSJUZ$BT w (FOEBSNF3VMFT4FSJBMJ[BUJPO w (FOEBSNF3VMFT4NFMMT w (FOEBSNF3VMFT6J http://www.mono-­‐project.com/docs/tools+libraries/tools/gendarme/ ɾόουϓϥΫςΟε ɾϝϯςφϯεੑ ɾύϑΥʔϚϯεੑͳͲ Ҏ্ͷϧʔϧʂ 大カテゴリ $POGJEFOUJBM $PQZSJHIU ˜$ZHBNFT *OD "MM3JHIUT3FTFSWFE   
  3. PreferStringIsNullOrEmptyRule Bad QVCMJDCPPM4FOE.FTTBHF TUSJOHNFTTBHF \ JG NFTTBHFOVMM cc NFTTBHF-FOHUI \

    SFUVSOGBMTF ^ SFUVSO4FOE.FTTBHF &ODPEF NFTTBHF  ^ QVCMJDCPPM4FOE.FTTBHF TUSJOHNFTTBHF \ JG 4USJOH*T/VMM0S&NQUZ NFTTBHF \ SFUVSOGBMTF ^ SFUVSO4FOE.FTTBHF &ODPEF NFTTBHF  ^ Maintainability 4USJOHͷ/VMMۭνΣοΫ͕޷·͘͠ͳ͍ Good $POGJEFOUJBM $PQZSJHIU ˜$ZHBNFT *OD "MM3JHIUT3FTFSWFE   
  4. AvoidUncalledPrivateCodeRule Bad QVCMJDDMBTT.Z$MBTT\ QSJWBUFWPJE.BLF4VGG \  ^ QVCMJDWPJE.FUIPE \ $POTPMF8SJUF-JOF

    'PP  ^ ^ QVCMJDDMBTT.Z$MBTT\ QVCMJDWPJE.FUIPE \ $POTPMF8SJUF-JOF 'PP  ^ ^ QSJWBUFͳͷʹݺ͹Ε͍ͯͳ͍ Performance Good $POGJEFOUJBM $PQZSJHIU ˜$ZHBNFT *OD "MM3JHIUT3FTFSWFE   
  5. Gendarme for Unity w (FOEBSNF3VMFT#BE1SBDUJDF w (FOEBSNF3VMFT$PODVSSFODZ w (FOEBSNF3VMFT$PSSFDUOFTT w

    (FOEBSNF3VMFT%FTJHO w (FOEBSNF3VMFT%FTJHO(FOFSJD w (FOEBSNF3VMFT%FTJHO-JOR w (FOEBSNF3VMFT&YDFQUJPOT w (FOEBSNF3VMFT*OUFSPQFSBCJMJUZ w (FOEBSNF3VMFT.BJOUBJOBCJMJUZ w (FOEBSNF3VMFT/BNJOH w (FOEBSNF3VMFT1FSGPSNBODF w (FOEBSNF3VMFT1PSUBCJMJUZ w (FOEBSNF3VMFT4FDVSJUZ w (FOEBSNF3VMFT4FDVSJUZ$BT w (FOEBSNF3VMFT4FSJBMJ[BUJPO w (FOEBSNF3VMFT4NFMMT w (FOEBSNF3VMFT6J https://github.com/fderudder/unity-­‐gendarme w 6OJUZ3VMFT1FSGPSNBODF w 6OJUZ3VMFT.BJOUBJOBCJMJUZ ベースルール Unity独自ルール $POGJEFOUJBM $PQZSJHIU ˜$ZHBNFT *OD "MM3JHIUT3FTFSWFE   
  6. AvoidEmptyComponentsMethodsRule QVCMJDDMBTT.Z$MBTT.POP#FIBWJPVS\ WPJE"XBLF \ ^ WPJE4UBSU \ %FCVH-PH l4UBSU 

    ^ ^ QVCMJDDMBTT.Z$MBTT.POP#FIBWJPVS\ WPJE4UBSU \ %FCVH-PH l4UBSU  ^ ^ Unity.Rules.Performance .POP#FIBWJPVSͷۭϝιουݺͼग़͠ Bad Good $POGJEFOUJBM $PQZSJHIU ˜$ZHBNFT *OD "MM3JHIUT3FTFSWFE    Φʔόʔϔου͕͔͔Δ
  7. AvoidUsingFindObjectInUpdateRule Bad QVCMJDDMBTT.Z$MBTT.POP#FIBWJPVS\ WPJE6QEBUF \ (BNF0CKFDUSPPU(BNF0CKFDU'JOE lNBJOSPPUz  ^ ^

    Good QVCMJDDMBTT.Z$MBTT.POP#FIBWJPVS\ WPJE6QEBUF \ (BNF0CKFDUSPPU@SPPU ^ ^ 'JOE0CKFDUܥ͸6QEBUFܥͰݺ͹ͳ͍ํ͕ྑ͍ Unity.Rules.Performance $POGJEFOUJBM $PQZSJHIU ˜$ZHBNFT *OD "MM3JHIUT3FTFSWFE    'JOE0CKFDUܥ͸଎౓ʹ೉͋Γ
  8. 結果 ղੳʹ͔͔ͬͨओͳ΋ͷ ༗ྉΞηοτ͕݁ߏͻ͔͔ͬΔ • ະ࢖༻QSJWBUFϝιου • /6--νΣοΫ͕ແ͍ • 4ZTUFN4USJOHͱ 4ZTUFN$IBSͷ࿈݁

    $POGJEFOUJBM $PQZSJHIU ˜$ZHBNFT *OD "MM3JHIUT3FTFSWFE    *HOPSFࢦఆΛؤுΔʜ
  9. ④インストール genymotion インストール&起動 インストール :  adb  install  app.apk 起動 :

     adb  shell  am  start  -­‐n  {packagename}/{mainActivity} ⑤起動 GitHub $POGJEFOUJBM $PQZSJHIU ˜$ZHBNFT *OD "MM3JHIUT3FTFSWFE   
  10. ⑤ログの書き出し .log ログ :  adb  logcat  Unity:V  *:S  >  output.log

      logcat ؂ࢹεΫϦϓτ͔ΒMPHDBUͰϩάΛॻ͖ग़͢ ϩάͷதʹIFBSUCFBUΛ࢓ࠐΈɺ؂ࢹεΫϦϓτͰݕ஌͢Δ heart beat GitHub heartbeatの検知 $POGJEFOUJBM $PQZSJHIU ˜$ZHBNFT *OD "MM3JHIUT3FTFSWFE   
  11. 失敗通知 • ࣾ಺4/4΁౤ߘ • BGQMBZͰԻΛ໐Β͢ • CMJOL  Ͱ-&%ΛޫΒͨ͠Γ •

    "SVEVJOPͰ૊ΜͰΈͨΓ ざわ…ざわ… $POGJEFOUJBM $PQZSJHIU ˜$ZHBNFT *OD "MM3JHIUT3FTFSWFE   
  12. まとめ • ඼࣭ͷվળʹ͸࣮֬ʹܨ͕Δ ɾ ίʔυϨϏϡʔͷෛ୲ܰݮ ɾ Πʔδʔϛεͷ௿Լ ɾ ݟ͑ΔԽͰ཰ઌͯ͠௚͕ͨ͠Δਓ΋ग़Δ •

    ҰͭͰ΋֬ೝ࡞ۀΛࣗಈԽͰݮΒ͢ ɾ ࡞ͬͯྑ͔ͬͨͱࢥ͏͕࣌ඞͣདྷΔ $POGJEFOUJBM $PQZSJHIU ˜$ZHBNFT *OD "MM3JHIUT3FTFSWFE