$30 off During Our Annual Pro Sale. View Details »

CircleCIとwercker

 CircleCIとwercker

ryonext

May 21, 2014
Tweet

More Decks by ryonext

Other Decks in Programming

Transcript

  1. CircleCIͱwercker
    ryonext

    View Slide

  2. ࣗݾ঺հ
    @ryonext
    ࠷ۙiPhoneΛམͱͯ͠ΨϥεΛׂΓ·͠
    ͨ

    View Slide

  3. ϒϩάॻ͖·ͨ͠
    http://ryonext.hatenablog.com/entry/
    2014/05/20/093828

    View Slide

  4. CircleCI

    View Slide

  5. ಋೖʹࢸͬͨܦҢ
    Ҏલ͸Ұ൪͍҆ϓϥϯ($19/݄)ͩͱ1
    private repository͔͠ϏϧυͰ͖ͳ͔ͬ
    ͨͷ͕ɺແ੍ݶʹͳͬͨ
    ಉ࣮࣌ߦδϣϒ਺Ͱ՝ۚʹͳͬͨ

    View Slide

  6. ྑ͍఺
    privateϦϙδτϦΛϏϧυ͢Δͷ͕ϝΠϯͷUXʹͳ͍ͬͯΔ
    ଎͍ʢJenkinsΛ AWS m1.smallͰಈ͔͢ΑΓ2ഒఔ౓଎͍ʣ
    ಋೖ͕؆୯
    JenkinsͷΑ͏ͳWebUIͰͷδϣϒೖྗɺymlͰͷδϣϒొ࿥ͷ྆ํαϙʔ
    τ
    ͓ࢼ͠͸Web͔Β΍ͬͯɺ͏·͘ಈ͍ͨΒymlΛϦϙδτϦʹೖΕΔɺͱ
    ͍͏͜ͱ͕Ͱ͖Δ
    ࡞ͬͨΠϝʔδʹ͠͹Β͘sshͰ͖ΔͷͰղੳ͕ḿΔ
    αϙʔτ͕खް͍

    View Slide

  7. ѱ͍఺
    sudoͰ͖ͳ͍
    ͦͯ͠೔ຊlocale͕ೖͬͯͳ͍

    View Slide

  8. ͦͷଞɺJenkinsൺͰྑ͍

    ӡ༻ͷ৺഑͕ͳ͍
    ֓Ͷඞཁͦ͏ͳػೳ͸࠷ॳ͔Βೖ͍ͬͯ
    ΔʢϏϧυɺ௨஌࿈ܞ౳ʣ
    pushͨ͠Β͙͢ςετͯ͘͠ΕΔͷͰ
    pull req͢Δࠒʹ͸΋͏Ϛʔδͯ͠OK͔
    Θ͔Δ

    View Slide

  9. Jenkins͡Όͳ͍ͱ೉͍͠
    ͱ͜Ζ
    Ϗϧυ࣌ؒʹ੍ݶ͕͋Δ
    ࡉ͔͍ύΠϓϥΠϯࢦఆͳͲ͸Ͱ͖ͳ
    ͍
    cronͱͯ͠࢖͏

    View Slide

  10. wercker΋ࢼͯ͠Έͨ

    View Slide

  11. ྑ͔ͬͨ఺
    sudoՄೳ
    ίϯςφ΍֤࣮ߦίϚϯυ͕ϓϥΨϒϧʹ
    ͳ͓ͬͯΓɺݸਓͷ։ൃऀ͕௥ՃػೳΛ౤
    ߘՄೳ
    ͜Ε͔Β৳ͼ͍͖ͯͦ͏
    ·ͩϕʔλͳͷͰແྉ

    View Slide

  12. ѱ͔ͬͨ఺
    OSSΛओ࣠ʹͨ͠UXɻpublicʹ͢ΔϘλϯ͕ৗʹग़
    ͯΔ
    αΠτ͕མͪΔ
    DB౳͕localhostʹͳ͍
    ؀ڥม਺Ͱࢦఆ͢Δherokuํࣜ
    Ұ෦ͷίϚϯυ͕ಠࣗDSL

    View Slide

  13. ಠࣗDSLৄ͘͠
    bundle install Λ bundle-install ͱॻ͔ͳ
    ͍ͱ͍͚ͳ͍ͱ͔
    ҰԠɺscriptͱ͍͏ͦͷ··γΣϧΛॻ
    ͚ΔίϚϯυ͋Γ

    View Slide

  14. wercker·ͱΊ
    ·ͩϕʔλͳͷͰ҆ఆੑѱ͍ͷ͸࢓ํͳ͍
    ͜Ε͔Β৳ͼͦ͏
    ࠓ೔ݟͨ͜ͷهࣄ໘ന͔ͬͨ
    bitbucketͱwerckerͰ̌ԁCIΛ͢Δ - razokulover
    publog
    http://razokulover.hateblo.jp/entry/
    2014/05/21/000306

    View Slide

  15. ʢJenkinsͰ΋Ͱ͖Δ͚Ͳʣ
    pull reqσϓϩΠ΍ͬͯΈͨ
    naoya͞ΜͷهࣄΛࢀߟʹ
    GitHub ࣌୅ͷσϓϩΠઓུ - naoyaͷ
    ͸ͯͳμΠΞϦʔ http://d.hatena.ne.jp/
    naoya/20140502/1399027655

    View Slide

  16. ͜͏͍͏ͷ
    feature => developʹ pull reqͯ͠Ϛʔδ
    stagingʹσϓϩ Π
    develop => master ʹ pull reqͯ͠Ϛʔδ
    ຊ൪ʹσϓϩΠ

    View Slide

  17. ײ૝
    ͜ͷϘλϯԡͨ͠ΒσϓϩΠ͞ΕΔʂͬ
    ͯͷ͕͍͋ͬͯ͢͝ϫΫϫΫ͢Δɻ

    View Slide

  18. ΍ͬͯΈͨ݁Ռ

    View Slide

  19. Failed!

    View Slide

  20. ͜
    ͷ
    ͋
    ͱ
    ͪ
    Ό
    Μ
    ͱ


    ͠
    ͨ

    View Slide

  21. ·ͱΊ
    AWSͷsmall instanceͰJenkinsͯ͠ΔͳΒ֎෦ͷ
    CIαʔϏε࢖ͬͯΈΔͱྑ͍
    Jenkins࢖ͬͯͳ͍ͳΒͳ͓͞Β
    ϑϧΧελϜJenkinsࢯͷ୅ΘΓʹ͸ͳΓͮΒ͍
    pull reqͯ͠Ϛʔδͯ͠σϓϩΠ͞ΕΔͷϚδͰ
    ྑ͍͔Β΍Δ΂͖

    View Slide