WordPress x Deployer

WordPress x Deployer

WordBench舞鶴でおはなしした、Deployerのご紹介です。 #wbkyoto #deployer

A73ed5cefbbd84abd2c5e14a5eb4a339?s=128

Ippei Sumida

October 21, 2017
Tweet

Transcript

  1. WordPress x Deployer 2017-10-21 WordBench Maizuru

  2. ࣗݾ঺հ ֯ాɹҰฏʢ͢Έͩɹ͍ͬ΃͍ʣ ϑϦʔϥϯεΤϯδχΞ CoderDojoຕํɹ୅ද !JQQFZ@T *QQFJTVNJEB

  3. Agenda • What is Deployer? • ࢖͍ํ

  4. What is Deployer?

  5. PHP੡σϓϩΠπʔϧ

  6. None
  7. DeployerͰͰ͖Δ͜ͱ Deploy Rollback • ϩʔΧϧ͔ΒCLIͰDeploy • CI͔ΒDeploy • SSH, SFTP,

    GitରԠ • ෳ਺αʔόॲཧՄೳ • αʔόؒॱ࣍ॲཧՄೳ • ϦϞʔτίϚϯυ࣮ߦ • ֤छRecipe͋Γ • ݩʹ໭ͤΔ • ੈ୅؅ཧ • ϦϞʔτίϚϯυ࣮ߦ
  8. Deployerͷ͕͍͍͜͜ʂ

  9. ϩΰ͕͔Θ͍͍

  10. PHP੡ ଞͷݴޠͷΠϯετʔϧෆཁ

  11. CIͰ΋ಈ͘

  12. ಋೖࣄྫ

  13. None
  14. Powered by
 


  15. None
  16. Powered by
 


  17. ΋σϓϩΠͰ͖ΔΑʂ

  18. ࢖͍ํ

  19. ΠϯετʔϧˍॳظԽ

  20. // Πϯετʔϧ composer require deployer/deployer --dev Or composer global require

    deployer/deployer // ઃఆ༻ϑΝΠϧ࡞੒ vendor/bin/dep init
  21. https://gist.github.com/Ippey/ 4c5790cb0811f564822b960ef593e141

  22. Recipe

  23. σϑΥͰ༻ҙ͞Ε͍ͯΔϨγϐ • CakePHP • Laravel • Symfony • Drupal7,8 •

    WordPress • Typo3 • And more…
  24. ௥ՃϨγϐ // Πϯετʔϧ composer require deployer/recipes --dev Or composer global

    require deployer/recipes
  25. ௥ՃͰ͖ΔϨγϐ • npm • yarn • slack • hipchat •

    Newrelic
  26. ͕ͳ͍

  27. ࡞ͬͨ

  28. ௥͍౼ͪϨγϐ // Πϯετʔϧ composer require ippey/deployer-chatwork-recipe —dev Or composer global

    require ippey/deployer-chatwork-recipe
  29.  QIQ UBTL NZ@UBTL GVODUJPO \ XSJUF DPNNFOUNZ@UBTLDPNNFOU  ^

     UBTL NZ@UBTLCFGPSF GVODUJPO \ XSJUF DPNNFOUNZ@UBTLલʹ࣮ߦ͢ΔλεΫDPNNFOU  ^  CFGPSF bNZ@UBTL` bNZ@UBTLCFGPSF`  UBTL NZ@UBTLEPOF GVODUJPO \ XSJUF DPNNFOUNZ@UBTLޙʹ࣮ߦ͢ΔλεΫDPNNFOU  ^  after(‘my_task’, ‘my_task:done’);
  30. 8PSE1SFTT༻ͷϨγϐΛΠϯϙʔτ SFRVJSFSFDJQFXPSEQSFTTQIQ $POpHVSBUJPO TFU SFQPTJUPSZ HJU!HJUIVCDPN*QQFZ8PSE#FODI.BJ[VSVHJU  TFU HJU@UUZ USVF

    <0QUJPOBM>"MMPDBUFUUZGPSHJUPOpSTUEFQMPZNFOU 8PSE1SFTT༻ϨγϐͰఆٛ͞Ε͍ͯΔͷͰෆཁ TFU TIBSFE@pMFT <>  TFU TIBSFE@EJST <>  TFU XSJUBCMF@EJST <> 
  31. )PTUT IPTU bWDDXUFTU ϗετ໊  VTFS bWBHSBOU Ϣʔβ  TFU

    bCSBODI` bNBTUFS` ར༻ϒϥϯνʢઃఆ͍ͨ࣌͠ͷΈʣ  JEFOUJUZ'JMF bWNWBHSBOUNBDIJOFTWDDXUFTUWJSUVBMCPYQSJWBUF@LFZ TTIΩʔ TUBHF bQSPEVDUJPO ؀ڥ໊ TFU EFQMPZ@QBUI bWBSXXXHJU %FQMPZઌ
  32. 5BTLT EFTD %FQMPZZPVSQSPKFDU  UBTL EFQMPZ < EFQMPZQSFQBSF  EFQMPZMPDL

     EFQMPZSFMFBTF  EFQMPZVQEBUF@DPEF  EFQMPZTIBSFE  EFQMPZXSJUBCMF  EFQMPZDMFBS@QBUIT  EFQMPZTZNMJOL  EFQMPZVOMPDL  DMFBOVQ  TVDDFTT >  <0QUJPOBM>JGEFQMPZGBJMTBVUPNBUJDBMMZVOMPDL BGUFS EFQMPZGBJMFE EFQMPZVOMPDL 
  33. ಠࣗλεΫ EFTD BDUJWBUF5XJUUFSQMVHJO  UBTL BDUJWBUFUXJUUFS GVODUJPO \  SVO

    DEWBSXXXHJUDVSSFOU   SVO XQQMVHJOBDUJWBUFUXJUUFSQBUIWBSXXXHJUDVSSFOU  ^  BGUFS EFQMPZTZNMJOL BDUJWBUFUXJUUFS 
  34. https://github.com/Ippey/WordBenchMaizuru/ blob/master/deploy.php

  35. Deploy

  36. vendor/bin/dep deploy [؀ڥ]

  37. Rollback

  38. vendor/bin/dep rollback [؀ڥ]

  39. λεΫ࣮ߦ

  40. vendor/bin/dep [λεΫ໊] [؀ڥ]

  41. ϑΝΠϧߏ଄

  42. 3FMFBTFQBUI DVSSFOU SFMFBTF TIBSFE   XQDPOUFOU VQMPBET

  43. ֤ϑΥϧμʹ͍ͭͯ current • ࠷৽ͷίϯςϯπ • release಺ͷ࠷ऴσϓϩΠ
 όʔδϣϯͷSymlink • rollback=SymlinkషΓ௚͠ release

    • ֤όʔδϣϯ͝ͱͷσʔλ • φϯόϦϯά͞ΕͯΔ • σϑΥϧτ͸5ͭ shared • σϓϩΠ͝ͱʹมΘΒͳ͍
 ϑΝΠϧ • ྫɿwp-content/uploads • current಺ͷಉϑΥϧμʹ
 symlink
  44. ·ͱΊ • Deployer͸PHP੡σϓϩΠπʔϧ • σϓϩΠɾϩʔϧόοΫͷ΄͔
 ίϚϯυ࣮ߦ΋Ͱ͖Δ • ֤छϨγϐΛ૊Έ߹ΘͤΔͱ৭ʑͰ͖Δ

  45. None