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

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

Ecb3acc2d246962361a4f8b3f7a6dd12?s=47 taichi nakashima
June 17, 2014
3.2k

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

Ecb3acc2d246962361a4f8b3f7a6dd12?s=128

taichi nakashima

June 17, 2014
Tweet

Transcript

  1. Distribute Golang Tool to Multiple Platform

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

  3. http://deeeet.com/writing

  4. docc dmux https://github.com/tcnksm/dmux https://github.com/tcnksm/docc - docker + tmux = dmux

    ! - docc open your project document
  5. GoݴޠͰ࡞ͬͨπʔϧΛෳ਺ϓϥοτϑΥʔϜʹ഑෍͢Δ

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

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

  8. hashicorp

  9. None
  10. None
  11. Cross-Compile, Upload, Install How?

  12. Cross-Compile

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

  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
  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
  16. • laher/goxc • davecheney/golang-crosscompile Else

  17. Upload

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

  19. https://bintray.com

  20. REST API $ curl -T <FILE.EXT> \ -utcnksm:<API_KEY> \ https://api.bintray.com/content/tcnksm/dmux/dmux/

    <VERSION_NAME>/<FILE_TARGET_PATH>
  21. Install

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

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

  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
  25. Demo