ビルドパイプラインツールをGoで作った話

E32fe793290d1e72b0a78648da9c687b?s=47 Naoki Ainoya
November 30, 2014

 ビルドパイプラインツールをGoで作った話

A build pipeline tool written in go

E32fe793290d1e72b0a78648da9c687b?s=128

Naoki Ainoya

November 30, 2014
Tweet

Transcript

  1. ϏϧυύΠϓϥΠϯπʔϧΛ GoͰ࡞ͬͨ࿩ GoCon 2014 Autumn @naokiainoya https://github.com/tenntenn/gopher-stickers/blob/master/png/28.png

  2. ࣗݾ঺հ ૬໺୩ ௚थ ainoya ~2013.09 mixi ~ݱࡏ ϦΫϧʔτςΫϊϩδʔζ APιϦϡʔγϣϯG ओͳ࢓ࣄ:

    ɹ ৽ٕज़ͷಋೖݕূͳͲ
  3. IUUQBUMSFDSVJUUFDIDPKQCMPH IUUQBJOPZBJPXBMUFS “ϏϧυύΠϓϥΠϯπʔϧ”

  4. πʔϧͷػೳ • CIͰͷϏϧυύΠϓϥΠϯͷ࣮ߦ੍ޚΛ͢Δπʔϧ • Jenkinsʹ͋ΔϏϧυύΠϓ
 ϥΠϯϓϥάΠϯͷ୅ସ • ઃఆϑΝΠϧ(YAMLܗࣜ)ʹ
 δϣϒ(࣮ߦ୯Ґ)ͷॲཧ಺༰ͱ
 δϣϒͷ࣮ߦॱংΛهड़

  5. πʔϧͷػೳ • CIܥαʔϏεͬΆ͍ઃఆϑΝΠϧʹ࣮ߦ಺༰ͱॱংΛهड़

  6. πʔϧͷػೳ • CIܥαʔϏεͬΆ͍ઃఆϑΝΠϧʹ࣮ߦ಺༰ͱॱংΛهड़

  7. πʔϧͷػೳ • CIܥαʔϏεͬΆ͍ઃఆϑΝΠϧʹ࣮ߦ಺༰ͱॱংΛهड़

  8. πʔϧͷػೳ • CIܥαʔϏεͬΆ͍ઃఆϑΝΠϧʹ࣮ߦ಺༰ͱॱংΛهड़

  9. πʔϧͷػೳ • CIܥαʔϏεͬΆ͍ઃఆϑΝΠϧʹ࣮ߦ಺༰ͱॱংΛهड़

  10. GoͰॻ͍ͨཧ༝ HPSPVUJOFͰδϣϒ࣮ߦ DIBOOFMͰ࣮ߦ݁ՌΛ࣍ ʹ఻͑Δ DIBOOFM͔Βϝοηʔδ ड৴ͨ͠Β࣮ߦ channel/goroutineͰ͍͍ײ͡Ͱॻ͚ͦ͏

  11. GoͰॻ͍ͨཧ༝ • όΠφϦ୯ମͰ഑෍Մೳ • werckerͰΫϩείϯύΠϧˠ
 GitHub Releases΁ͷΞοϓϩʔυ·Ͱ
 ϫϯΫϦοΫͰ • motemen/ghqΛࢀߟʹ

    IUUQTHJUIVCDPNXBMUFSDEXBMUFSCMPCNBTUFSXFSDLFSZNM
  12. ͦͷଞtips ϓϩδΣΫτߏ੒ • coreos/etcdΛࢀߟʹͨ͠ • {$project-root}/${package-name}/ҎԼʹ
 .goϑΝΠϧΛ഑ஔ͍ͯ͘͠ϧʔϧͰ • Ϣχοτςετ΋ຊମͱಉ͡σΟϨΫτϦ഑ஔ •

    build/test͸shell scriptͰ https://github.com/walter-cd/walter
  13. ͦͷଞtips ύοέʔδ؅ཧ • ࠷ॳ͸submoduleͰ؅ཧ • ґଘ͕૿͑ͯอकͮ͠Β͘ͳͬͨ • ࠓ͸GodepΛར༻ • /Godeps/Godeps.jsonʹґଘؔ܎هड़

    https://github.com/tools/godep
  14. ͦͷଞtips ϩάग़ྗ • ༻్ʹ߹͏ϩάग़ྗϥΠϒϥϦ͕ͳ͔ͬͨ • ଞͷϓϩδΣΫτ͸ݢฒΈࣗલͰ༻ҙ • golang/glogΛforkͯ͠ϩάϑΥʔϚοτ Λม͑ͯར༻

  15. GoͰॻ͍ͨॴײ

  16. “golang way” • "Is Go an object-oriented language?" 
 ɹɹɹɹɹɹɹɹɹɹɹ--

    "yes and no" • No type hierarchy • Interfaces can be very lightweight
 
 
 https://golang.org/doc/faq#Is_Go_an_object-oriented_language
  17. “golang way” • "Share memory by communicating,
 don't communicate by

    sharing memory.” • channelͰॻ͍ͯΈΔ • ॻ͖ͮΒͦ͏ͩͬͨΒSync.Mutex IUUQTDPEFHPPHMFDPNQHPXJLJXJLJ.VUFY0S$IBOOFM IUUQTPOJBDPEFTXPSEQSFTTDPNDIBOOFMTWTTZODQBDLBHF
  18. ࠷ޙʹ • walterͱ͍͏ϏϧυύΠϓϥΠϯπʔϧΛGoͰॻ͍ͨ • όΠφϦ഑෍ָ͕ • goroutine/channelͰδϣϒؒͷϝοηʔδύογϯάΛ͍͍ײ͡ʹ • ·ͩશવͰ͖ͯͳ͍ɽҾ͖ଓ͖ػೳڧԽΛߦ͍͖ͬͯ·͢ •

    ΤϥʔϋϯυϦϯάڧԽetc.. • YAMLܗࣜͷઃఆϑΝΠϧΛ΍Ί͍ͨ
 DSLΛGoͰͲ͏࣮૷͢Δ͔ߟ͑த