Skip to content

Instantly share code, notes, and snippets.

@masahide
Created April 13, 2014 02:14
Show Gist options
  • Save masahide/10566044 to your computer and use it in GitHub Desktop.
Save masahide/10566044 to your computer and use it in GitHub Desktop.
Go言語 drone.ioで自動クロスコンパイル CI環境 #golang ref: http://qiita.com/yamasaki-masahide/items/b4348388267a703b4de5
pkg/os/error_unix.go:11: isExist redeclared in this block
previous declaration at pkg/os/error_posix.go:11
export GOROOT=~/go
export PATH=$GOROOT/bin:$PATH
### go 1.2.1をダウンロードして展開
wget -q https://go.googlecode.com/files/go1.2.1.linux-amd64.tar.gz
tar -C ~/ -xzf go1.2.1.linux-amd64.tar.gz
### クロスコンパイルの準備
pushd ~/go/src
# windows 64bit
GOOS=windows GOARCH=amd64 ./make.bash --no-clean 2> /dev/null 1> /dev/null
# MacOS 64bit
GOOS=darwin GOARCH=amd64 ./make.bash --no-clean 2> /dev/null 1> /dev/null
popd
### go get で get & build (getはbuildも実行されるみたいですね)
GOOS=windows GOARCH=amd64 go get ./...
GOOS=darwin GOARCH=amd64 go get ./...
# アーカイブするために作成したバイナリをコピーする
mkdir artifacts
cp -r `go env GOPATH`/bin artifacts
artifacts/bin/*/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment