Skip to content

Instantly share code, notes, and snippets.

@chobie
Created January 5, 2015 12:46
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chobie/54df60090336e050bdf5 to your computer and use it in GitHub Desktop.
Save chobie/54df60090336e050bdf5 to your computer and use it in GitHub Desktop.
gem install fpm --no-ri --no-rdoc
# packagesディレクトリ以下をまとめてpackagingする
go build -o YOURAPP yourapp.go
mkdir -p pakcages/usr/local/YOURAPP/{bin,etc}
cp yourapp packages/usr/local/YOUARPP/bin/yourapp
(cd packages; fpm -s dir -t deb -n YOURAPP -v 0.1.0 .)
ls -la packages
  • 大半のgo applicationならdependsはないからfpmはとても楽な選択
  • --post-install optionなどでpackage install後の制御もできるので便利
  • Goは色々なplatform向けにバイナリが作れますが、必ず動作確認しましょう

unit testとは別に該当プラットフォームでapplicationの自動テストができると楽 (環境変わった時にビルドミスってないかとかチェックできると楽)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment