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

Acquia Cloud Platform入門:Drupalアプリケーション開発を始める [ローカル編]

Acquia Cloud Platform入門:Drupalアプリケーション開発を始める [ローカル編]

Transcript

  1. Acquia Cloud Platformೖ໳ ɹΞδΣϯμ • Landoͱ͸ • ϩʔΧϧ։ൃ؀ڥΛߏஙͯ͠ΈΑ͏ • Ϋϥ΢υ؀ڥʹσϓϩΠͯ͠ΈΑ͏

    • Q&A DrupalΞϓϦέʔγϣϯ։ൃ Λ࢝ΊΔ [ϩʔΧϧฤ]
  2. Acquia Cloud Platformೖ໳΢ΣϏφʔγϦʔζ • Acquia Cloud Platform͸ɺDrupalΞϓϦέʔγϣϯΛߏஙɺ؅ ཧ͢ΔͨΊͷεέʔϥϒϧͰ҆શͳϓϥοτϑΥʔϜͰ͢ɻ 
 •

    ຊ΢ΣϏφʔγϦʔζͰ͸ɺAcquia Cloud Platform͕ͲΜͳ΋ ͷ͔ڵຯ͕͋Δํɺ͜Ε͔Β࢖͍࢝ΊΔํ޲͚ʹɺAcquia Cloud PlatformͰߦ͏DrupalΞϓϦέʔγϣϯ։ൃߏஙํ๏΍ ศརͳπʔϧͳͲΛ͝঺հ͠·͢ɻ
  3. ຊ೔ͷεϐʔΧʔ ΞΫΠΞδϟύϯ 
 ؛ढ़ฌ ιϦϡʔγϣϯΤϯδχΞ ΞΫΠΞδϟύϯ 
 ؙࢁͻ͔Δ ςΫχΧϧτϥϯεϨʔλʔ ͰͿͪΌΜͶΔ

  4. Landoͱ͸

  5. Acquia Cloud PlatformͰDrupal։ൃΛߦ͏ ΞΫΠΞͱͯ͠ਪ঑͢Δํ๏͸࣍ͷ2ͭͰ͢ɻ 1. LandoͰϩʔΧϧ։ൃ؀ڥΛ༻ҙ͢Δ ←ࠓճ͝঺հ 
 2. Cloud

    IDEͰϦϞʔτʹ։ൃ؀ڥΛ༻ҙ͢Δ
  6. Lando ͱ͸ • DrupalͰ͸༷ʑͳϩʔΧϧ։ൃ؀ڥ͕ར༻͞Ε͓ͯΓɺ Lando΋ͦͷҰͭͰ͢ • Lando͸ɺΦʔϓϯιʔε੡ͷΫϩεϓϥοτϑΥʔϜͷ ϩʔΧϧ։ൃ؀ڥߏஙπʔϧ • Linux,

    Windows, MacOSͰར༻Ͱ͖·͢ • ϓϩδΣΫτ։ൃʹඞཁͳ؀ڥΛDocker্ʹల։͠·͢ • ಛఆͷ։ൃϢʔεέʔεʢDrupalɺPythonɺLaravelͳͲʣ Λຬͨ͢αʔϏεͱπʔϧͷҰൠతͳ૊Έ߹ΘͤΛʮϨ γϐʯ͔Β؆୯ʹηοτΞοϓͰ͖·͢ 
 • ཁ͸ɾɾɾdockerfile΍docker composeͰ௚઀ߦ͏ΑΓ΋ ؆୯ʹ؀ڥΛ্ཱͪ͛ΒΕ·͢ • ϓϩΩγɺURLɺωοτϫʔΩϯάɺϑΝΠϧڞ ༗ɺίϯςφ͝ͱͷSSLূ໌ॻͷॲཧɺetc... https://www.jeffgeerling.com/blog/2020/2020-drupal-local-development-survey-results DrupalͷϩʔΧϧ։ൃʹؔ͢Δௐࠪ(2020೥౓) .lando.yml ϑΝΠϧͷྫ
  7. LandoͱΞΫΠΞͷ౷߹ • 2020೥6݄ʹAcquia Dev Desktop͕αϙʔτऴྃΛܴ ͑·ͨ͠ • ΞΫΠΞ͕ఏڙ͢Δ։ൃ؀ڥͱͯ͠ɺCloud IDE͕ొ৔ •

    Ҿ͖ଓ͖ϩʔΧϧ؀ڥͰ։ൃ͍ͨ͠ਓ޲͚ʹɺLando Λ௨ͯ͡ϩʔΧϧ։ൃͷΦϓγϣϯΛఏڙ • LandoͷϨγϐʹʮAcquiaʯ͕௥Ճ͞Ε·ͨ͠ • ΞΫΠΞ؀ڥͷίʔυɺσʔλϕʔεɺϑΝΠϧΛ Lando؀ڥͱಉظͰ͖·͢ https://docs.lando.dev/config/acquia.html#getting-started/ AcquiaϨγϐʹؔ͢ΔυΩϡϝϯτ(Lando) https://dev.acquia.com/blog/acquia-cloud-lando-integration-tale-tryst
  8. ϩʔΧϧ։ൃ؀ڥΛߏஙͯ͠ΈΑ͏

  9. LandoͷAcquiaϨγϐ × Acquia CMSͰߏங͢Δ 
 ϩʔΧϧ։ൃ؀ڥ LandoͷAcquiaϨγϐΛ࢖༻ͯ͠ɺϩʔΧϧ؀ڥͰAcquia CMSΛىಈ͢Δํ๏Λ͝঺հ͠·͢ɻ ओͳྲྀΕΛղઆ͢ΔͨΊʹɺඞཁ࠷௿ݶͷઃఆɾखॱͰߦ͍͖ͬͯ·͢ɻ 


    1. LandoͷઃఆϑΝΠϧ(.lando.yml)ͷ࡞੒ 2. DrupalϓϩδΣΫτͷ࡞੒ 3. αΠτͷΠϯετʔϧ 4. Site Studioͷॳظઃఆ 5. Acquia CMS StarterϞδϡʔϧͷ༗ޮԽ ※Acquia CMSͰ͸Site StudioΛ࢖༻͍ͯ͠·͢ɻSite StudioͷAPIΩʔΛࣄલʹ͝༻ҙ͍ͨͩ͘ඞཁ͕͋Γ·͢ɻProfessionalϓ ϥϯͷ৔߹ɺAcquia CMSͰ͸ͳ͘ɺૉͷDrupalɺٴͼଞσΟετϦϏϡʔγϣϯΛ࢖༻͍ͨͩ͘ͱಉ͡खॱͰ࣮ߦՄೳͰ͢ɻ
  10. 1. LandoͷઃఆϑΝΠϧ(.lando.yml)ͷ࡞੒ʢ̍ʣ • ࡞ۀσΟϨΫτϦΛ༻ҙͯ͠ɺσΟϨΫτϦʹҠಈ͓͖ͯ͠·͢ 
 $ mkdir my-demo-ace-pov3 && cd

    my-demo-ace-pov3
 • lando initίϚϯυΛ࣮ߦͯ͠ɺ.lando.ymlϑΝΠϧΛੜ੒͠·͢ 
 $ lando init
 
 ͍͔ͭ͘ͷϓϩϯϓτ͕දࣔ͞Ε·͢ ? From where should we get your app's codebase?ʢίʔυϕʔεͷ৔ॴʣ 
 → current working directoryʢݱࡏͷσΟϨΫτϦʣ 
 ? What recipe do you want to use?ʢར༻͢ΔϨγϐʣ 
 → acquia 
 ? Select an Acquia Cloud Platform API tokenʢAcquia Cloud PlatformͷAPIτʔΫϯʣ 
 → xxxxxx 
 ? Which site?ʢσϓϩΠ͢Δର৅ͷAcquia Cloud PlatformͷΞϓϦέʔγϣϯʣ 
 → povjapan3ʢର৅ͷΞϓϦέʔγϣϯͷ໊લΛબ୒͍ͯͩ͘͠͞ɻ͜͜Ͱ͸Ծʹ povjapan3 ͱ͠·͢ʣ • ͜ΕͰϓϩδΣΫτσΟϨΫτϦ௚Լʹ .lando.yml ϑΝΠϧ͕ੜ੒͞Ε·ͨ͠ https://docs.lando.dev/config/acquia.html
  11. • .lando.ymlϑΝΠϧΛ2Օॴ͍͡Γ·͢ 1. LandoͷઃఆϑΝΠϧ(.lando.yml)ͷ࡞੒ʢ̎ʣ • ϓϩδΣΫτσΟϨΫτϦ௚Լʹ .env ϑΝΠϧΛ࡞੒ͯ͠ɺͦ͜ʹDBͷೝূ৘ใΛೖΕ·͢ 
 DBͷೝূ৘ใ͸

    lando info ίϚϯυͰ֬ೝͰ͖·͢ 
 ※ ͜ͷ.envϑΝΠϧ͸.gitignoreʹ๨Εͣʹ௥Ճ͓͖ͯ͠·͢ name: povjapan3 recipe: acquia config : acli_version: latest ah_application_uuid: xxxxxxxx ah_site_group: povjapan3 php: '7.4' # 1. ͜͜Λ7.3͔Β7.4ʹ # 2. ؀ڥม਺Ληοτ͢Δ env_file : - .env DB_HOST=databas e DB_NAME=acqui a DB_USER=acqui a DB_PASS=acquia
  12. • ίϚϯυϥΠϯͰ࣍ͷίϚϯυΛ࣮ߦ͠·͢ 
 ΞΫΠΞ͕ఏڙ͢Δ acquia/drupal-recommended-project ͰdrupalϓϩδΣΫτΛ࡞੒͠·͢ 
 
 $ lando

    star t $ lando composer create-project acquia/drupal-recommended-project tmp && cp -r tmp/. . && rm -rf tm p 
 • sites/default/settings/local.settings.php ͷDBͷೝূ৘ใΛ؀ڥม਺͔Βऔͬͯ͘ΔΑ͏ʹमਖ਼͠·͢ 2. DrupalϓϩδΣΫτͷ࡞੒ $databases['default']['default'] = [ 'database' => getenv('DB_NAME') , 'username' => getenv('DB_USER') , 'password' => getenv('DB_PASS') , 'host' => getenv('DB_HOST') , 'port' => '3306' , 'driver' => 'mysql' , 'prefix' => '' , ];
  13. • Acquia CMSσΟετϦϏϡʔγϣϯ(acquia_cms)Λࢦఆͯ͠αΠτΛΠϯετʔϧ͠·͢ 
 lando drush site:install acquia_cms --yes --account-pass=admin

    --account-mail=xxx@example.com --account-name=admi n • ͜ΕͰϩʔΧϧʹAcquia CMSͰΠϯετʔϧͨ͠αΠτ͕ىಈ͢ΔͷͰɺΞΫηε͠·͢ 
 http://povjapan3.lndo.site 
 
 ※ϩʔΧϧ؀ڥͷΞϓϦέʔγϣϯURL 
 ͸ lando info ίϚϯυͰ֬ೝͰ͖·͢ 3. αΠτͷΠϯετʔϧ ίϚϯυͷΦϓγϣϯͰࢦఆͨ͠ Ϣʔβʔ໊ͱύεϫʔυͰϩάΠϯ ίϯςϯπ͸·ͩԿ΋ͳ͍ঢ়ଶͰ͢
  14. • ؅ཧը໘͔ΒɺSite StudioͷAPI KeyɺAgency KeyΛઃఆ͠·͢ 
 URLύε: /admin/cohesion/configuration/account-settings 
 


    [Save and import assets] ΛΫϦοΫͯ͠ઃఆΛ൓өͤ͞ΔͷͰ͕͢ɺ 
 Site StudioͷϏϧυʹ͍͕͔͔࣌ؒ͢͝ΔͷͰ஫ҙ͍ͯͩ͘͠͞ 
 ͜Ε͕ऴΘΔͱαΠτͰSite Studio͕ར༻Ͱ͖ΔΑ͏ʹͳΓ·͢ 4. Site Studioͷॳظઃఆ
  15. • Acquia CMSͰ͸ɺSite StudioΛ͙͢ʹ࢖͍࢝ΊΒΕΔΑ͏ʹɺςϯϓ ϨʔτͱσϞίϯςϯπ͕ηοτ͞Εͨ 
 Acquia CMS StarterϞδϡʔϧ͕༻ҙ͞Ε͍ͯΔͷͰ 


    ͔ͤͬ͘ͳͷͰ༗ޮԽ͠·͢ • ϞδϡʔϧΛ༗ޮԽ͢Δલʹɺ؅ཧϝχϡʔͷ[Tour] > [Get started]͔Β Google MapsͷAPIΩʔ͚ͩઃఆ͓͖ͯ͠·͢ 
 ͜ΕΛ͓͔ͯ͠ͳ͍ͱϞδϡʔϧ͕༗ޮԽͰ͖·ͤΜ 
 
 Google MapsͷAPIΩʔ͸࣍ͷURL͔ΒऔಘͰ͖·͢ 
 https://developers.google.com/maps/documentation/javascript/get-api-key • ؅ཧϝχϡʔͷ[Extend]͔ΒAcquia CMS StarterϞδϡʔϧΛ༗ޮԽ͠· ͢ 5. Acquia CMS StarterϞδϡʔϧͷ༗ޮԽ
  16. ͜ͷΑ͏ʹɺσϞαΠτͷΑ͏ͳ΋ͷ্ཱ͕͕ͪΓ·͢ɻ ࣄલʹ༻ҙ͞ΕͨSite StudioͷςϯϓϨʔτ΍ίϯϙʔωϯτΛ࢖ͬͯϖʔδ ͕ϨΠΞ΢τ͞Ε͍ͯ·͢ɻ

  17. LandoͷAcquiaϨγϐ × Acquia CMSͰߏங͢Δ 
 ϩʔΧϧ։ൃ؀ڥɾσϞ 1. LandoͷઃఆϑΝΠϧ(.lando.yml)ͷ࡞੒ 2. DrupalϓϩδΣΫτͷ࡞੒

    3. αΠτͷΠϯετʔϧ 4. Site Studioͷॳظઃఆ 5. Acquia CMS StarterϞδϡʔϧͷ༗ޮԽ
  18. Ϋϥ΢υ؀ڥʹσϓϩΠͯ͠ΈΑ͏

  19. Acquia CLIͱAcquia BLTΛ࢖༻ͯ͠ɺϩʔΧϧ؀ڥͰىಈͨ͠DrupalαΠτΛɺΫϥ΢υଆͷDev؀ ڥʹखಈͰσϓϩΠ͢Δํ๏Λ͝঺հ͠·͢ɻओͳྲྀΕΛղઆ͢ΔͨΊʹɺඞཁ࠷௿ݶͷઃఆɾ खॱͰߦ͍͖ͬͯ·͢ɻ 1. ϦϞʔτgitϦϙδτϦͷઃఆ 2. Acquia BLTͷઃఆ

    3. Ϋϥ΢υ؀ڥʹΞʔςΟϑΝΫτΛσϓϩΠ 4. Acquia CLIͰDBɺϑΝΠϧΛίϐʔ Acquia CLIͱAcquia BLTΛ࢖༻ͨ͠σϓϩΠ
  20. 1. ϦϞʔτgitϦϙδτϦͷઃఆ • ΞϓϦέʔγϣϯͷGit URL͕֬ೝͰ͖ͨΒɺίϚϯυϥΠϯ͔ΒϦϞʔτGitϦϙδτϦͱͯ͠ొ࿥͠·͢ 
 $ git remote add

    acquia povjapan3@svn-00000.prod.hosting.acquia.com:povjapan3.git • Acquia Cloud PlatformͰ͸ΞϓϦέʔγϣϯ͝ͱʹɺίʔυϕʔεΛ؅ཧ͢ΔͨΊͷGitϦϙδτϦ͕༻ҙ͞Ε͍ͯ·͢ 
 GitϦϙδτϦͷURLΛ֬ೝ͢Δʹ͸ɺAcquia Cloud Platformͷ؅ཧը໘ʹͯɺର৅ͷΞϓϦέʔγϣϯͷը໘͔Βɺը໘ӈ্ͷ[Actions] > [View Git Information] ΛॱʹΫϦοΫ͍͖ͯ͠·͢
  21. 2. Acquia BLTͷઃఆ project : machine_name: my-demo-ace-pov 3 git :

    default_branch: master remotes : cloud: 'povjapan3@svn-00000.prod.hosting.acquia.com:povjapan3.git' • acquia/drupal-recommended-projectʹ͸Acquia BLT͕ಉࠝ͞Ε͍ͯ·͢ 
 Acquia BLTͱ͸ɺDrupalͷςετɾϏϧυɾσϓϩΠΛࣗಈԽ͢ΔͨΊͷίϚϯυϥΠϯπʔϧͰ͢ 
 ϓϩδΣΫτ௚Լͷ blt/blt.yml ϑΝΠϧΛ࣍ͷΑ͏ʹमਖ਼͠·͢
  22. • ϩʔΧϧͷίʔυϕʔεͷ಺༰ΛϦϞʔτgitϦϙδτϦʹڧ੍ϓογϡ͠·͢ 
 $ git push -f acquia master 


    ※ࣄલʹSSHΩʔͷઃఆΛߦ͏ඞཁ͕͋Γ·͢ 
 • ࣍ͷίϚϯυͰɺϏϧυΞʔςΟϑΝΫτͷ࡞੒ͱσϓϩΠΛ͓͜ͳ͍·͢ 
 ࣍ͷίϚϯυྫͰ͸ɺdevelop-build ϒϥϯνʹʮBLT-000: ίϛοτϝοηʔδʯͱ͍͏ίϛοτϝοηʔδͱڞʹɺੜ੒͞ΕͨϏϧυΞʔςΟϑΝ ΫτΛίϛοτ͍ͯ͠·͢ 
 $ vendor/bin/blt artifact:deploy --commit-msg 'BLT-000: ίϛοτϝοηʔδ' --branch 'develop-build' --no-interactio n 
 ੒ޭ͢Δͱɺ؅ཧը໘ͷ Task Log ʹ࣍ͷΑ͏ʹϩά͕දࣔ͞Ε·͢ 3. Ϋϥ΢υ؀ڥʹΞʔςΟϑΝΫτΛσϓϩΠ
  23. • Ϋϥ΢υ؀ڥͷDev؀ڥʹίʔυΛσϓϩΠ͠·͢ 
 Acquia Cloud Platform؅ཧը໘ͷର৅ͷΞϓϦέʔγϣϯը໘͔ΒɺDev؀ڥͷ [Code] ΛΫϦοΫ͠ɺઌ΄Ͳϓογϡͨ͠develop-buildϒϥϯνΛબ୒ ͯ͠ίʔυΛεΠον͠·͢ 3.

    Ϋϥ΢υ؀ڥʹΞʔςΟϑΝΫτΛσϓϩΠ
  24. • LandoͷAcquiaϨγϐͰ͸ɺAcquia CLI͕σϑΥϧτͰར༻Ͱ͖ΔΑ͏ʹͳ͍ͬͯ·͢ 
 Acquia CLIΛ࢖༻ͯ͠ίϚϯυϥΠϯͰϩʔΧϧ؀ڥͷσʔλϕʔεͱϑΝΠϧ΋Ϋϥ΢υ؀ڥʹϓογϡ͠·͢ 
 
 ·ͣ͸Acquia Cloud

    PlatformΞΧ΢ϯτʹରͯ͠ೝূΛ͓͜ͳ͍·͢ 
 $ lando acli auth:logi n ࣍ͷίϚϯυͰɺLando؀ڥͷσʔλϕʔεͱϑΝΠϧΛΫϥ΢υ؀ڥʹϓογϡͰ͖·͢ 
 ίϚϯυͷୈҰҾ਺ͰɺϓογϡઌͷΞϓϦέʔγϣϯͷΤΠϦΞεΛࢦఆ͍ͯ͠·͢ $ lando acli push:database povjapan3.de v $ lando acli push:files povjapan3.dev
 
 drushίϚϯυ΋ɺlando acli remote:drush [ΤΠϦΞε] [drushίϚϯυ] ͷܗࣜͰϩʔΧϧ؀ڥ͔Β࣮ߦͰ͖·͢ 
 ࣍ͷίϚϯυͰ͸ɺ͋ΔΞϓϦέʔγϣϯͷDev؀ڥʹରͯ͠ΩϟογϡΛ࠶ߏங͠·͢ $ lando acli remote:drush povjapan3.dev cr 4. Acquia CLIͰDBɺϑΝΠϧΛίϐʔ
  25. ͜ΕͰɺϩʔΧϧ؀ڥͰߏஙͨ͠αΠτΛΫϥ΢υ؀ ڥʹσϓϩΠ͢Δ͜ͱ͕Ͱ͖·ͨ͠ αΠτͷURL͸؅ཧը໘͔Β֬ೝͰ͖·͢

  26. 1. ϦϞʔτgitϦϙδτϦͷઃఆ 2. Acquia BLTͷઃఆ 3. Ϋϥ΢υ؀ڥʹΞʔςΟϑΝΫτΛσϓϩΠ 4. Acquia CLIͰDBɺϑΝΠϧΛίϐʔ

    ϩʔΧϧ͔ΒΫϥ΢υͷDev؀ڥʹσϓϩΠɾσϞ
  27. Acquia Cloud Platformೖ໳ ɹΞδΣϯμ • Landoͱ͸ • ϩʔΧϧ։ൃ؀ڥΛߏஙͯ͠ΈΑ͏ • Ϋϥ΢υ؀ڥʹσϓϩΠͯ͠ΈΑ͏

    • Q&A DrupalΞϓϦέʔγϣϯ։ൃ Λ࢝ΊΔ [ϩʔΧϧฤ]
  28. • LandoͷAcquiaϨγϐͷ࢖͍ํ 
 https://docs.lando.dev/config/acquia.html#getting-started/ • acquia/drupal-recommended-project (github) 
 https://github.com/acquia/drupal-recommended-project •

    acquia/acquia-cms-project (github) 
 https://github.com/acquia/acquia-cms-project • Acquia CLI υΩϡϝϯτ 
 https://docs.acquia.com/acquia-cli/ • Acquia BLT υΩϡϝϯτ 
 https://docs.acquia.com/blt/ ࢀߟࢿྉ
  29. None