このCircle CIがすごい 中央線Meetup #1 /circle ci sugoi

Bfdc891851e466251d4e7bca34dc4057?s=47 dmnlk
August 03, 2018

このCircle CIがすごい 中央線Meetup #1 /circle ci sugoi

中央線Meetup #1 で使う資料です

Bfdc891851e466251d4e7bca34dc4057?s=128

dmnlk

August 03, 2018
Tweet

Transcript

  1. ͜ͷCircleCI͕͍͢͝ தԝઢMeetup #1 @dmnlk

  2. ୭ʁ • dmnlk • ौ୩ͷWebاۀͷόοΫΤϯυΤϯδχΞ • લ৬Java,ݱ৬PHPϝΠϯ,ͪΐͬͱGolang • Πϯϑϥ΋৮Γ·͢

  3. தԝઢͱΘͨ͠ • 2017೥11݄͔Β੢Ԯࡏॅ • ͜ͷձ৔͔Βెา5minݍ಺ • ੢ԮબΜͩͷ΋͍͍ҿΈ԰͕ଟͦ͏͔ͩΒ… • ߴԁࣉɾத໺͋ͨΓͰ΋ͨ·ʹҿΜͰ͍·͢

  4. ຊ୊ʹೖΔલʹ

  5. None
  6. CakeFest2019 ೔ຊͰ։࠵ܾఆ

  7. CakeFestͱ͸ • PHPͷWebApplicationFrameworkͰ͋ΔCakePHPʹϑΥʔΧεͨ͠ ΧϯϑΝϨϯε • 2018೥͸ΞϝϦΧ։࠵༧ఆ͚ͩͬͨͲॾࣄ৘Ͱ։࠵ͤͣ • 2019೥ͷ։࠵஍ީิʹ೔ຊ্͕͕͍ͬͯͨ • ౤ථͰ೔ຊʹ։࠵ܾఆ

    • ίΞνʔϜ΋೔ຊʹདྷͯ͘ΕΔ͸ͣ • Laravelʹෛ͚ΔͳؤுΕCakePHPʢฐࣾͰ࠾༻͍ͯ͠·͢ʣ
  8. ຊ୊

  9. None
  10. CircleCIͱ͸ • SaaSܕͷCIαʔϏε • Continuous IntegrationΛߦ͏ • push͞ΕΔ౓ʹTestΛ࣮ߦͱ͔ • ωΠςΟϒΞϓϦͷϏϧυͱ͔

    • ྨࣅSaaSʹTravisCI,ShippableͳͲ
  11. CircleCIͷಛ௃ • 1ܥͱ2ܥ͕͋Δ͕ɺ1ܥ͸͋ͱ1ϲ݄Ͱࢮ͵ͷͰׂѪ • .circleci/config.ymlʹYAMLͰjobͷఆٛΛॻ͘ • Docker imageΛར༻ͯ͠jobΛ࣮ߦ͢Δ • ແྉ࿮΋͋Γprivate

    repoͰ΋ར༻Ͱ͖ΔͷͰ͓ࢼ͠΍͍͢ • Dockerͷ஌͕ࣝଟগ͍ΔͷͰ࠷ॳ͸ͱ͖ͬͭͮΒ͍͔΋ • macOSίϯςφ΋͋ΔͷͰiOSΞϓϦͷϏϧυʹ΋࢖͑·͢ʢແྉ࿮ͳ ͠
  12. Jenkinsʹ͍ͭͯ • લ৬Ͱ͸ΦϯϓϨαʔόʔʹJenkins • Jenkinsࣗମͷϝϯςφϯε͕ਏ͍ • ؾͮ͘ͱϝϞϦ৯͍͗ͯ͢ࢮΜͰΔͱ͔ • CIͷઃఆ͕GUIͰॻ͍͍ͯ͘ɻίʔυ؅ཧग़དྷͳ͍ •

    Jenkins2ܥͩͱύΠϓϥΠϯΛίʔυఆٛͰ͖Δ • ϓϥάΠϯ๛෋ͳͷ͸ར఺
  13. config.ymlͷαϯϓϧ version: 2 jobs: build: docker: - image: circleci/<language>:<version TAG>

    steps: - checkout - run: <command> test: docker: - image: circleci/<language>:<version TAG> steps: - checkout - run: <command> workflows: version: 2 build_and_test: jobs: - build - test Ref https://circleci.com/docs/2.0/sample-config/
  14. GitHubͰͷ࿈ܞ΋όονϦ

  15. CircleCIͷTips

  16. ͦͷ1: CircleCI͕༻ҙͨ͠imageΛ࢖͏ • DBͳͲ΋Docker imageΛར༻͢Δඞཁ͕͋Δ • ී௨͸mysql:5.7ͷΑ͏ͳΦϑΟγϟϧimageΛ࢖͍͕ͪ • ࣮͸CircleCI͕༻ҙͨ͠࠷దԽimage͕͋Δ •

    circleci/mysqlͱࢦఆ͢Δ͚ͩͰ଎͘ͳΔʢ͍͢͝ • ଞʹ΋͋ΔͷͰࢼͯ͠ΈΔͱྑ͍(https://hub.docker.com/u/ circleci/)
  17. ͦͷ2: jobؒͰϑΝΠϧΛड͚౉͢ • workflowΛར༻͢Δͱෳ਺ͷjobΛฒྻʹ࣮ߦͰ͖ͨΓ͢Δ • ͔͠͠ιʔεͷcheckout΍ґଘϞδϡʔϧͷinstallͳͲ΋ͦ ΕͧΕ΍Δඞཁ͕͋Δ • persist_to_workspaceͱattach_workspaceΛ࢖͏͜ͱͰ੒Ռ ෺ͷड͚౉͕͠Ͱ͖Δ

    • ґଘؔ܎ͷղܾjobΛ࣮ߦͯ͠ɺϑϩϯτΤϯυͷtest jobͱ όοΫΤϯυͷtest jobʹड͚౉ͯ͠ฒྻtestͨ͠Γͱ͔
  18. ͦͷ3: Schedule-WorkflowΛ࢖͏ • ͜͜·Ͱͷbuildܖػ͸GitHub΁ͷpush or खಈ • Schedule-Workflowͱ͍͏ػೳ͕͋Δ • ॴҦcron(࣮ࡍcronܗࣜͰॻ͘ʣ

    • ࢝ۀલʹ࣌ؒͷ͔͔Δ੩తղੳjobΛಈ͔͢ • ఆظతʹϚελσʔλΛߋ৽͢Δ etc…
  19. CircleCI͸͍͢͝ʂʂʂ ͕ʂ ͍͔͢͝Βͱ͍ͬͯ ͳΜͰ΋΍Ζ͏ͱ͢Δͱ yak shavingʹͳΔ͔Β ఔʑʹ!!!