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

複数プラットフォームにGo言語のツールを配布する #hikarie_go

taichi nakashima
June 17, 2014
3.3k

複数プラットフォームにGo言語のツールを配布する #hikarie_go

taichi nakashima

June 17, 2014
Tweet

Transcript

  1. Distribute Golang Tool
    to Multiple Platform

    View Slide

  2. I’m Taichi Nakashima
    Twitter ID is @deeeet

    View Slide

  3. http://deeeet.com/writing

    View Slide

  4. docc
    dmux
    https://github.com/tcnksm/dmux
    https://github.com/tcnksm/docc
    - docker + tmux = dmux !
    - docc open your project document

    View Slide

  5. GoݴޠͰ࡞ͬͨπʔϧΛෳ਺ϓϥοτϑΥʔϜʹ഑෍͢Δ

    View Slide

  6. Why start to write golang?
    ࣗ෼͕࡞ͬͨπʔϧΛ࢖ͬͯ΋Β͏ͨΊͷ
    োนΛԼ͍͛ͨɻgem? pip ? Λͳ͍ͨ͘͠ɻ

    View Slide

  7. $ brew tap tcnksm/docc
    $ brew install docc
    OSX

    View Slide

  8. hashicorp

    View Slide

  9. View Slide

  10. View Slide

  11. Cross-Compile, Upload, Install
    How?

    View Slide

  12. Cross-Compile

    View Slide

  13. Basic
    $ GOOS=linux GOARCH=amd64 go build hikarie.go

    View Slide

  14. mitchellh/gox
    $ gox
    !
    --> darwin/386: github.com/tcnksm/hikarie
    --> darwin/amd64: github.com/tcnksm/hikarie
    --> linux/386: github.com/tcnksm/hikarie
    --> linux/amd64: github.com/tcnksm/hikarie
    --> linux/arm: github.com/tcnksm/hikarie
    --> freebsd/386: github.com/tcnksm/hikarie
    --> freebsd/amd64: github.com/tcnksm/hikarie
    --> openbsd/386: github.com/tcnksm/hikarie
    --> openbsd/amd64: github.com/tcnksm/hikarie

    View Slide

  15. mitchellh/gox
    $ gox
    !
    --> darwin/386: github.com/tcnksm/hikarie
    --> darwin/amd64: github.com/tcnksm/hikarie
    --> linux/386: github.com/tcnksm/hikarie
    --> linux/amd64: github.com/tcnksm/hikarie
    --> linux/arm: github.com/tcnksm/hikarie
    --> freebsd/386: github.com/tcnksm/hikarie
    --> freebsd/amd64: github.com/tcnksm/hikarie
    --> openbsd/386: github.com/tcnksm/hikarie
    --> openbsd/amd64: github.com/tcnksm/hikarie

    View Slide

  16. • laher/goxc
    • davecheney/golang-crosscompile
    Else

    View Slide

  17. Upload

    View Slide

  18. https://github.com/tcnksm/docc/releases

    View Slide

  19. https://bintray.com

    View Slide

  20. REST API
    $ curl -T \
    -utcnksm: \
    https://api.bintray.com/content/tcnksm/dmux/dmux/
    /

    View Slide

  21. Install

    View Slide

  22. $ brew tap tcnksm/docc
    $ brew install docc
    OSX

    View Slide

  23. 1. GitHub ϨϙδτϦ homebrew- Λ࡞੒
    2. Formula .rb Λ࡞੒
    How

    View Slide

  24. Formula
    require "formula"
    !
    class Docc < Formula
    homepage "https://github.com/tcnksm/docc"
    version ‘0.1.1'
    url "https://github.com/tcnksm/docc/v0.1.1/docc_0.1.1_darwin_amd64.zip"
    sha1 "eaad2915415c5ceb3e3fb613420be62a856da46a"
    !
    depends_on :arch => :intel
    !
    def install
    bin.install 'docc'
    end
    end

    View Slide

  25. Demo

    View Slide