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

Acquia Cloud Platform入門:開発ワークフローを学ぼう

Acquia Cloud Platform入門:開発ワークフローを学ぼう

More Decks by アクイアジャパン Acquia Japan

Other Decks in Programming

Transcript

  1. Acquia Cloud Platformೖ໳ ɹΞδΣϯμ • ओཁͳ։ൃπʔϧ • ίʔυϕʔεΛཧղ͢Δ • ґଘؔ܎ͷ؅ཧ

    • Drupalͷίʔυن໿ • Acquia Cloud PlatformͰ։ൃΛߦ͏ͨΊ ͷϕετϓϥΫςΟε • Q&A • ͓஌Βͤ ։ൃϫʔΫϑϩʔΛֶ΅͏
  2. Acquia Cloud Platformೖ໳΢ΣϏφʔγϦʔζ • Acquia Cloud Platform͸ɺDrupalΞϓϦέʔγϣϯΛߏஙɺ؅ ཧ͢ΔͨΊͷεέʔϥϒϧͰ҆શͳϓϥοτϑΥʔϜͰ͢ɻ 
 •

    ຊ΢ΣϏφʔγϦʔζͰ͸ɺAcquia Cloud Platform͕ͲΜͳ΋ ͷ͔ڵຯ͕͋Δํɺ͜Ε͔Β࢖͍࢝ΊΔํ޲͚ʹɺAcquia Cloud PlatformͰߦ͏DrupalΞϓϦέʔγϣϯ։ൃߏஙํ๏΍ ศརͳπʔϧͳͲΛ͝঺հ͠·͢ɻ
  3. աڈ์ૹ • Acquia Cloud Platformͱ͸ͳʹ͔ • DrupalΞϓϦέʔγϣϯ։ൃΛ࢝ΊΔ [ϩʔΧϧฤ] • DrupalΞϓϦέʔγϣϯ։ൃΛ࢝ΊΔ

    [Cloud IDEฤ] • ΞϓϦέʔγϣϯ؅ཧํ๏Λֶ΅͏ • Ϣʔβʔ؅ཧํ๏Λֶ΅͏ Acquia Cloud Platformೖ໳΢ΣϏφʔγϦʔζ
  4. Drush • Drupal 4͔Βଘࡏ͢ΔCLIπʔϧ • ΩϟογϡΫϦΞɺߏ੒ઃఆͷΠϯϙʔτɺ৽͍͠Ϣʔβʔͷ࡞੒ɺϞδϡʔ ϧͷ༗ޮԽͳͲΛߦ͏ • Drush͸ Drupal

    Shell ͷུশ • ίϚϯυྫ • Ϟδϡʔϧͷ༗ޮԽ 
 drush pm:enable admin_toolbar • ΩϟογϡΫϦΞ 
 drush cache:rebuild
  5. Acquia CLI • ΞΫΠΞ͕ఏڙ͢ΔCLIπʔϧͰɺAcquia Cloud Platformͷૢ࡞͕ߦ͑·͢ • ίϚϯυྫ • SSHΩʔͷ࡞੒ͱΞοϓϩʔυ

    >> acli ssh-key:create-upload • SSHΞΫηε >> acli remote:ssh povjapan3.dev • DrushίϚϯυͷ࣮ߦ >> acli remote:drush povjapan3.dev cr • Acquia Cloud IDEͷ࡞੒ >> acli ide:create • LandoͷacquiaϨγϐͰAcquia CLIίϚϯυ͕࢖༻Ͱ͖·͢ https://docs.acquia.com/acquia-cli/
  6. • Build and Launch Tool ͷུশ • DrupalΞϓϦέʔγϣϯͷςετɺߏஙɺىಈ͢ΔͨΊͷࣗಈԽϨΠ ϠʔΛఏڙ͢ΔΦʔϓϯιʔεͷCLIπʔϧ •

    ίϚϯυྫ • ΞΫΠΞ؀ڥ΁ΞʔςΟϑΝΫτΛσϓϩΠ 
 blt artifact:deploy • ࣗಈςετͷ࣮ߦ 
 blt tests Acquia BLT https://docs.acquia.com/blt/
  7. • Acquia Pipelines • ΞΫΠΞͰఏڙ͢ΔCI/CDπʔϧ • Acquia Cloud CDͱηοτͰ࢖༻͠·͢ •

    Gitͷίϛοτ΍ϓϧϦΫΤετΛτϦΨʔʹϏϧυɺςετɺσϓϩΠΛߦ͍·͢ • ॲཧதͷϩά΍ςετ݁Ռ͸Acquia CloudͷUI·ͨ͸pipeline CLIπʔϧʹͯ֬ೝͰ͖ ·͢ 
 • Acquia Cloud Platform CD • Acquia Cloud CD͸ओʹ։ൃऀ͕ίʔυ΍ઃఆͷ֬ೝʹ࢖༻͢Δ؀ڥͰ͢ • ίϯςφٕज़Ͱຊ൪؀ڥʹྨࣅͨ͠ඇຊ൪؀ڥΛ࡞੒͠ɺPipeline͔ΒϏϧυ͞Εͨ ϒϥϯνͷ֬ೝʹ࢖༻͞Ε·͢ • CD؀ڥɺCDEsͱݺ͹ΕΔ͜ͱ͕͋Γ·͢ CI/CDπʔϧ
  8. ϦϙδτϦͷσΟϨΫτϦߏ੒ your Drupal project roo t ᵓ── bl t ᵓ──

    confi g ᵓ── drus h ᵓ── docroo t ᵓ── hook s ᵓ── patche s ᵓ── test s └── vendor - Acquia BLTͷઃఆϑΝΠϧؚ͕·ΕΔ - Drupalͷߏ੒ϑΝΠϧ܈ؚ͕·ΕΔ - DrushͷαΠτΤΠϦΞεϑΝΠϧؚ͕·ΕΔ - DrupalͷυΩϡϝϯτϧʔτ - Cloud HooksͷεΫϦϓτϑΝΠϧؚ͕·ΕΔ - ϓϥΠϕʔτύονϑΝΠϧؚ͕·ΕΔ - ϓϩδΣΫτϨϕϧͷςετϑΝΠϧؚ͕·ΕΔ - Πϯετʔϧͨ͠ύοέʔδؚ͕·ΕΔ https://docs.acquia.com/blt/developer/repo-architecture/
  9. docrootͷσΟϨΫτϦߏ੒ your Drupal project roo t ᵓ── docroo t │

    ᵓ── module s │ │ ᵓ── contri b │ │ └── custo m │ ᵓ── profile s │ ᵓ── site s │ │ ᵓ── defaul t │ │ └── mult i │ └── themes - Ϟδϡʔϧ܈ؚ͕·ΕΔ - ίϯτϦϏϡʔτϞδϡʔϧؚ͕·ΕΔ - ΧελϜϞδϡʔϧؚ͕·ΕΔ - αΠτͷϕʔεͱͳΔػೳ΍ߏ੒ؚ͕·ΕΔ - DrupalͷઃఆϑΝΠϧͳͲؚ͕·ΕΔ - ओͱͳΔDrupalαΠτͷઃఆϑΝΠϧؚ͕·ΕΔ - αϒαΠτͷઃఆϑΝΠϧؚ͕·ΕΔ - ςʔϚ܈ؚ͕·ΕΔ
  10. ྫ͑͹͜Μͳ࣌͸ • GitΛ࢖༻ͯ͠શͯͷίʔυมߋΛσϓϩ Π͢Δ 
 • ڊେͳϑΝΠϧΛGitϦϙδτϦʹίϛο τ͢Δ 
 •

    master΍։ൃϒϥϯνʹ௚઀ίϛοτ͢Δ • vendorσΟϨΫτϦ౳͸ϝΠϯϒϥϯν ʹϓογϡͤͣʹΞʔςΟϑΝΫτΛར༻ ͢Δ 
 • େ༰ྔͷϝσΟΞϑΝΠϧ͸Drupalͷύϒ ϦοΫϑΝΠϧσΟϨΫτϦΛ࢖༻͢Δ 
 • ϑΟʔνϟʔϒϥϯν΍ϓϧϦΫΤετΛ ࢖༻͠·͢
  11. composerͷૢ࡞৭ʑ • ґଘؔ܎ͷΠϯετʔϧ 
 
 composer require drupal/[module] 
 •

    ґଘؔ܎ͷߋ৽ 
 ʢίΞɺϓϩϑΝΠϧɺϞδϡʔϧɺςʔϚɺϥΠϒϥϦʣ 
 
 composer update drupal/[module] --with-dependencies 
 • ґଘؔ܎ͷ࡟আ 
 
 composer remove drupal/[module] ίϚϯυ࣮ߦޙ͸ɺ 
 composer.jsonͱcomposer.lock 
 ͷϑΝΠϧมߋΛ ๨Εͣʹίϛοτ͢Δ https://support-acquia.force.com/s/article/360048081273-Using- Composer-to-manage-dependencies-in-Drupal-8-and-9
  12. ґଘؔ܎Λ؅ཧ͢ΔͨΊʹ • શͯͷґଘؔ܎͸composer΍npm/yarnΛ࢖༻֤ͯ͠ݻ༗ͷґଘؔ܎Λ؅ཧ͢Δඞཁ͕͋Γ·͢ • ίϯτϦϏϡʔτϞδϡʔϧɺςʔϚɺϓϩϑΟʔϧɾɾ • Ϟδϡʔϧ/ςʔϚ/ϓϩϑΟʔϧ͸ՄೳͰ͋Ε͹ͳΔ΂҆͘ఆ൛Λ࢖༻͠·͢ • ඇ҆ఆ൛͸DrupalͷηΩϡϦςΟΞυόΠβϦʔͷର৅֎Ͱ͢ •

    શͯͷ؀ڥʹ͓͍ͯɺґଘؔ܎ͷ؅ཧʹಉ͡ϫʔΫϑϩʔઓུΛ࢖༻͠·͢ • /vendor౳ͷ؅ཧ͞Εͨґଘؔ܎͸։ൃϦϙδτϦʹίϛοτ͞ΕΔ΂͖Ͱ͸͋Γ·ͤΜ͕ɺΞΫΠΞ؀ڥʹσ ϓϩΠ͢ΔͨΊͷΞʔςΟϑΝΫτʹ͸ඞཁͰ͢ • composer.json ͱ composer.lock ྆ํͷϑΝΠϧΛϦϙδτϦʹίϛοτ͢Δඞཁ͕͋Γ·͢ • ։ൃऀ͸ܾͯ͠खಈͰlockϑΝΠϧΛฤू͢Δ΂͖Ͱ͸͋Γ·ͤΜ • ։ൃऀ͸ composer.json ϑΝΠϧΛߋ৽ͯ͠ɺcomposerΛ࢖༻ͯ͠lockϑΝΠϧΛߋ৽͠·͢
  13. Drupalͷίʔυن໿ ίʔυن໿ͱ͸ • ίʔυͷॻ͖ํ΍ܗࣜͳͲɺ͞·͟·ͳܾ·ΓࣄΛఏࣔ͢ΔϓϩάϥϚ޲͚ͷҰ࿈ͷϧʔϧ • ม਺΍ؔ਺ͳͲͷ໋໊نଇɺېࢭࣄ߲ɺΠϯσϯτɺεϖʔεɺׅހ΍ԋࢉࢠͳͲͷه߸ͷ഑ஔͷ࢓ํͳ ͲΛఆٛ • ίʔυͷදه๏ΛίʔσΟϯάن໿ͱͯ͠౷Ұ͓ͯ͘͠ͱɺՄಡੑ΍อकੑ͕ߴ·Γɺ։ൃޮ཰͕޲্ •

    ओͳݺͼํɿCode StandardsɺCoding StandardsɺίʔσΟϯάن໿ɺίʔσΟϯάϧʔϧɾɾ Drupalʹ͓͚Δίʔυن໿ • PEARίʔυن໿͕ϕʔεͱͳ͍ͬͯ·͢ • Drupalͷίʔυن໿͸ίΞόʔδϣϯؔ܎ͳ͘ɺৗʹ࠷৽ͷίʔυن໿ʹै͏ඞཁ͕͋Γ·͢ https://www.drupal.org/docs/develop/standards
  14. Drupalίʔυن໿ͷҰྫ • Πϯσϯτͱۭന • λϒͳ͠Ͱɺ2ͭͷεϖʔεͷΠϯσϯτΛ࢖༻ • ߦͷ࠷ޙʹۭനΛೖΕͳ͍ 
 • ߦͷ௕͞

    • 80จࣈ͕໨҆ 
 • ԋࢉࢠ • ԋࢉࢠʢ=, -, +, *, =>, . ͳͲʣ͸ৗʹ1ͭͷεϖʔεΛ͚ͭΔ • …etc https://www.drupal.org/docs/develop/standards/coding-standards
  15. ΞΫΠΞ͕ਪ঑͢ΔϕετϓϥΫςΟε • Drupalίʔυن໿ʹै͏ • DrupalίΞϑΝΠϧΛมߋ͠ͳ͍ • σʔλϕʔεΫΤϦͷύϑΥʔϚϯεΛߟྀ͢Δ • ϑΝΠϧγεςϜ΁ͷແବͳΞΫηεΛආ͚Δ •

    ΩϟογϡΛద੾ʹ࢖༻͢Δ • ϝϞϦϑοτϓϦϯτ͸ՄೳͳݶΓখ͘͢͞Δ • …etc https://docs.acquia.com/cloud-platform/onboarding/developing/
  16. Acquia Cloud Platformೖ໳ ɹΞδΣϯμ • ओཁͳ։ൃπʔϧ • ίʔυϕʔεΛཧղ͢Δ • ґଘؔ܎ͷ؅ཧ

    • Drupalͷίʔυن໿ • Acquia Cloud PlatformͰ։ൃΛߦ͏ͨΊ ͷϕετϓϥΫςΟε • Q&A • ͓஌Βͤ ։ൃϫʔΫϑϩʔΛֶ΅͏
  17. ͓஌ΒͤɾʮDrupalCamp DEN 2022 Osakaʯ1݄29೔(౔)։࠵ʂ ։࠵֓ཁ ೔࣌ɿ2022೥1݄29೔(౔) 13:00 - 17:30 ࢀՃඅɿແྉ

    ഑৴ܗࣜɿΦϯϥΠϯ഑৴ (Youtube) ͓ਃ͠ࠐΈ͸ͪ͜Βʂ https://drupal-meetup-den.connpass.com/event/229256/