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

Orbs開発の流れ ~はじめの一歩から、組織的にメンテしていくための環境構築まで / Flow of Orbs Development

Orbs開発の流れ ~はじめの一歩から、組織的にメンテしていくための環境構築まで / Flow of Orbs Development

CircleCI ユーザーコミュニティミートアップ #4
https://circleci.connpass.com/event/125622/

More Decks by 株式会社ヌーラボ

Other Decks in Technology

Transcript

  1. $JSDMF$*ϢʔβʔίϛϡχςΟϛʔτΞοϓ
    /VMBC*OD5PNPOBSJ/",".63" !JLJLLP


    0SCT։ൃͷྲྀΕd͸͡ΊͷҰา͔Β
    ૊৫తʹϝϯς͍ͯͨ͘͠Ίͷ؀ڥߏங·Ͱd

    View full-size slide

  2. ࣗݾ঺հ
    w໊લɿதଜ஌੒ !JLJLLP

    wॴଐɿψʔϥϘ
    wਪ͠ϝϯɿͬ͞͠ʔ

    View full-size slide

  3. ࡞ͬͨ0SC
    w5ZQFUBML0SC
    https://www.typetalk.com/ja/blog/how-to-integrate-circleci-with-typetalk-to-automatically-notify-of-build-results/

    View full-size slide

  4. ࡞͖͔͚ͬͨͬ
    wʮ$IBUXPSLʹ௨஌Λߦ͏$JSDMF$*0SC
    Λ࡞ͬͨʯΛݟͨ
    w͋ɺ͜Εಉ͡Α͏ʹνϟοτʹ௨஌͢Δ
    ΍ͭ࡞Εͦ͏
    w(8Ͱ࡞ͬͪΌ͑
    ࣮૷ɿ ೔
    ݖݶपΓؚΉϦϦʔε
    ͷௐ੔ɿ ೔

    View full-size slide

  5. ΞδΣϯμ
    wεςοϓɿ·ͣ͸ࣗ෼͚ͩͰಈ࡞֬ೝ
    wεςοϓɿQVCMJTIͯ͠ɺଞͷਓʹ΋
    ࢖ͬͯ΋Β͓͏
    wεςοϓɿΈΜͳͰϝϯς͍͚ͯ͠Δ
    Α͏ʹ

    View full-size slide

  6. ·ͣ͸ಈ࡞֬ೝ
    wΠϯϥΠϯ0SC͕͓खܰ
    w
    version: 2.1
    orbs:
    example:
    commands:
    my_command:
    parameters:
    my_name:
    type: string
    steps:
    - run: echo "hello <>"
    jobs:
    build:
    docker:
    - image: circleci/node:4.8.2
    steps:
    - example/my_command:
    my_name: ikikko
    ΠϯϥΠϯͰల։
    ͍ͯ͠Δ෦෼

    View full-size slide

  7. ·ͣ͸ಈ࡞֬ೝ
    wखݩͰ࣮ߦ
    # OrbΛల։ʢ2019/05࣌఺ɺOrbΛϩʔΧϧͰ௚઀࣮ߦͰ͖ͳ͍ͨΊʣ
    $ circleci config process .circleci/config.yml >
    .circleci/processed.config.yml
    # ల։͞ΕͨϑΝΠϧΛϩʔΧϧͰ࣮ߦ
    $ circleci local execute -c .circleci/processed.config.yml
    ͜͜·Ͱɺ$JSDMF$*Λ௨
    ৗͲ͓Γར༻͢Δ஌ࣝͩ
    ͚Ͱʢ΄΅ʣରԠՄೳ

    View full-size slide

  8. ΞδΣϯμ
    wεςοϓɿ·ͣ͸ࣗ෼͚ͩͰಈ࡞֬ೝ
    wεςοϓɿQVCMJTIͯ͠ɺଞͷਓʹ΋
    ࢖ͬͯ΋Β͓͏
    wεςοϓɿΈΜͳͰϝϯς͍͚ͯ͠Δ
    Α͏ʹ

    View full-size slide

  9. QVCMJTIͯ͠ΈΑ͏
    wηοτΞοϓ

    View full-size slide

  10. QVCMJTIͯ͠ΈΑ͏
    wηοτΞοϓ
    # namespaceͷ࡞੒
    $ circleci namespace create
    $ circleci namespace create nulab github nulab
    # orbͷ࡞੒
    $ circleci orb create /
    $ circleci orb create nulab/typetalk-orb

    View full-size slide

  11. QVCMJTIͯ͠ΈΑ͏
    w1VCMJTI
    w
    # खݩͰorbͷಈ࡞֬ೝ͕औΕͨΒɺorb.ymlʹ੾Γग़͓ͯ͘͠
    # ։ൃ༻όʔδϣϯͷpublish
    $ circleci orb publish /@
    $ circleci orb publish orb.yml nulab/typetalk-orb@dev:alpha
    # ຊՔಇ༻όʔδϣϯͷpublish
    $ circleci orb publish promote /@
    $ circleci orb publish promote nulab/typetalk-orb@dev:alpha major
    4FN7FSʹͷͬͱ͍ͬͯΔ
    NBKPSNJOPSQBUDI

    View full-size slide

  12. ΞδΣϯμ
    wεςοϓɿ·ͣ͸ࣗ෼͚ͩͰಈ࡞֬ೝ
    wεςοϓɿQVCMJTIͯ͠ɺଞͷਓʹ΋
    ࢖ͬͯ΋Β͓͏
    wεςοϓɿΈΜͳͰϝϯς͍͚ͯ͠
    ΔΑ͏ʹ

    View full-size slide

  13. ΈΜͳͰϝϯςͰ͖ΔΑ͏ʹ
    wओʹɺେ࿮ͷྲྀΕΛ࿩͠·͢
    wࡉ͔͍ઃఆ಺༰͸ɺιʔείʔυͱݟൺ
    ΂ͳ͕Βฉ͍͍ͯͩ͘͞
    w IUUQTHJUIVCDPNOVMBCUZQFUBMLPSC

    View full-size slide

  14. ΈΜͳͰϝϯςͰ͖ΔΑ͏ʹ
    wσϑΝΫτͳύοέʔδߏ੒
    w
    src
    ├── @orb.yml
    ├── commands
    │ ├── notify.yml
    │ └── status.yml
    ├── examples
    │ ├── notify.yml
    │ └── status.yml
    ├── executors
    │ └── ...
    └── jobs
    └── ...
    # 1ϑΝΠϧ΁ύοέʔδԽʢޙड़ͷCI/CDϫʔΫϑϩʔதͰࣗಈͰద༻͞ΕΔʣ
    $ circleci config pack src > orb.yml

    View full-size slide

  15. ΈΜͳͰϝϯςͰ͖ΔΑ͏ʹ
    wσϑΝΫτ
    ͳ$*$%ͷϫʔΫϑϩʔ
    w ެࣜ0SCͷ൒෼Ҏ্͕͜ͷϫʔΫϑϩʔʹԊ͍ͬͯΔ

    View full-size slide

  16. ΈΜͳͰϝϯςͰ͖ΔΑ͏ʹ
    wσϑΝΫτ
    ͳ$*$%ͷϫʔΫϑϩʔ
    w ެࣜ0SCͷ൒෼Ҏ্͕͜ͷϫʔΫϑϩʔʹԊ͍ͬͯΔ

    View full-size slide

  17. ϫʔΫϑϩʔ

    View full-size slide

  18. ϫʔΫϑϩʔ

    View full-size slide

  19. ϫʔΫϑϩʔ

    View full-size slide

  20. ϫʔΫϑϩʔ

    View full-size slide

  21. ࢀߟυΩϡϝϯτ
    w $JSDMF$*0SCT։ൃ׬શΨΠυ೥౓൛ʛ
    UJNBLJOʛOPUF
    w ༗ྉOPUF͚ͩͲɺ͘͢͝Α͘·ͱ·͍ͬͯΔɻ
    ίʔυ௥͏ͷ͕େมͳΒɺ໎Θͣ՝ۚ͠Α͏
    w :`trigger-integration-workflow`ͷ`cleanup-
    tags: true`ΦϓγϣϯͰɺUBHΛஞ࣍੔ཧͰ͖Δ
    w :`test-in-builds`Λ࢖Θͣͱ΋ɺDPOpHZNM಺Ͱ΂ͨ
    ॻ͖ͯ͠΋Αͦ͞͏

    View full-size slide

  22. ࢀߟυΩϡϝϯτ
    w $SFBUJOHBVUPNBUFECVJME UFTU BOEEFQMPZ
    XPSLqPXTGPSPSCT QBSU$JSDMF$*#MPH
    w ͜ͷϫʔΫϑϩʔΛ͸͡Ίɺ0SC࡞੒Λิॿ͢Δ
    0SC PSCUPPMTPSC
    Λ࡞ͬͨਓ͕ॻ͍ͨϒϩά
    w ӳޠ͕ۤ͡Όͳ͚Ε͹ɺͪ͜ΒͰ΋

    View full-size slide

  23. ΞδΣϯμ
    wεςοϓɿ·ͣ͸ࣗ෼͚ͩͰಈ࡞֬ೝ
    wεςοϓɿQVCMJTIͯ͠ɺଞͷਓʹ΋
    ࢖ͬͯ΋Β͓͏
    wεςοϓɿΈΜͳͰϝϯς͍͚ͯ͠Δ
    Α͏ʹ

    View full-size slide

  24. ॴײ
    wɿࣗ෼Ҏ֎ͷਓ΋৮ΔՄೳੑ͕͋Δϓ
    ϩδΣΫτʹɺಛʹ༗ޮ
    w ݸਓϓϩδΣΫτͰ͸ͳ͍ɺձࣾ૊৫ͷ0SCͳͲ
    w ܰඍͳमਖ਼ʹ͍ͭͯ͸ɺ(JU)VC্Ͱ13ग़ͯ͠
    Ϛʔδ͢Δ͚ͩͰे෼ରԠՄೳ
    w ʢ஍ຯʹ೴಺ϝϞϦ࢖͏ʣϦϦʔε൪߸ͷ෇༩΋
    Φʔτ࠾൪

    View full-size slide

  25. ॴײ
    wɿࣗ෼Ҏ֎ͷਓ΋৮ΔՄೳੑ͕͋Δϓ
    ϩδΣΫτʹɺಛʹ༗ޮ
    w ௨ৗͳΒɺ(JU)VCͷPXOFSͰͳ͍ͱຊՔಇ༻όʔ
    δϣϯ͸QVCMJTIͰ͖ͳ͍͕
    w PXOFSݖݶͷUPLFOΛ$JSDMF$*্ʹຒΊࠐΜͰ͓͚
    ΔͷͰ
    w13ΛϚʔδͰ͖Δਓ͸୭Ͱ΋QVCMJTIՄೳʹ

    View full-size slide

  26. ॴײ
    wར༻ऀͷ੠ʢ$JSDMF$*ॳΊͯͷਓʣ

    View full-size slide

  27. ॴײ
    wɿϫʔΫϑϩʔ͕ͪΐͬͱෳࡶʜ
    w ϫʔΫϑϩʔ͕ͭʹ෼͔ΕͯͯɺͦΕΛͭͳ͙ͷ
    ʹ(JUͷUBHΛ࢖͍ͬͯͯɺ௚ײతʹ෼͔ΓͮΒ͍
    w ಉ͡Α͏ͳهड़͕ෳ਺͋ͬͯɺ৑௕

    View full-size slide

  28. ॴײ
    wɿ(JUͷϦϦʔεͱ0SCͷόʔδϣϯͷ
    ඥ͚͕ͮ෼͔ΓͮΒ͍
    w ҰԠɺ(JUͷλά෇͚͸͞ΕΔͷͰɺϦϦʔεϖʔ
    δ͔Β௥͏͜ͱ͸Ͱ͖Δ

    View full-size slide


  29. 0SCࣗ਎ͷ$*$%Λ੔͑ͯ
    ΈΜͳͰ0SCΛ৮͍ͬͯ͜͏

    View full-size slide