Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Ship cli tools for cross-platform with Github + wecker
Search
TANABE Ken-ichi
September 26, 2014
Technology
0
1.2k
Ship cli tools for cross-platform with Github + wecker
TANABE Ken-ichi
September 26, 2014
Tweet
Share
More Decks by TANABE Ken-ichi
See All by TANABE Ken-ichi
AAA: An ACME Agent for AWS environment
nabeken
0
3k
Introduction to Terraform
nabeken
0
2.3k
The Twelve-Factor Apps
nabeken
0
47
Go and License
nabeken
8
10k
Other Decks in Technology
See All in Technology
自動テストは何の役に立つのか そして役に立たないのか
undefined_name
2
960
EKSと動的プロビショニングEFSを使ったマルチリージョンDR
daitak
0
190
Guard を利用した AWS Config ルール
yhana
0
220
チームでテストを実装していく / Implementing Tests as a Team
ropqa
0
690
Safie Viewer for iOS の 技術的負債との付き合い方
safie
0
130
10分で完全に理解するGuardDutyのS3マルウェア保護
cmusudakeisuke
0
710
Scala to WebAssembly: Exploring the How and Why
tanishiking
0
290
スマートロック開発におけるSLI/SLOを用いた解錠体験の改善 / Improving the unlocking experience using SLI/SLO in smart lock development
bitkey
PRO
2
130
未知の未知を既知の未知へ / Unknown unknowns to Known unknowns
rhumie
1
2k
Luupの開発組織におけるインシデントマネジメントの変遷
grimoh
2
360
シビックテックによる、社会と民主主義のアップデート
halsk
2
350
AWS Control Towerと HashiCorp Terraformでいい感じにマルチアカウント管理をしよう
chazuke4649
0
400
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1025
450k
Music & Morning Musume
bryan
42
5.7k
Robots, Beer and Maslow
schacon
PRO
155
8k
Building Your Own Lightsaber
phodgson
101
5.8k
KATA
mclloyd
18
12k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
19
1.7k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
27
2.4k
The Invisible Side of Design
smashingmag
294
50k
Practical Orchestrator
shlominoach
183
9.8k
The MySQL Ecosystem @ GitHub 2015
samlambert
244
12k
Become a Pro
speakerdeck
PRO
13
4.7k
Fireside Chat
paigeccino
23
2.7k
Transcript
Ship cli tools for cross- platform w/Github + wecker 2014/09/26@HDE
MTS TANABE Ken-ichi
動機 • OS X, Linux, Windows向けにcliツールを配布 したい • 開発者以外にも使ってほしい ◦
APIを叩いて何か処理をしたり ◦ 簡単なサーバを起動してデータをやりとりしたり • いつものようにCIしつつビルド、リリースまで自動 化したい
道具 • Go ◦ クロスプラットフォーム (OS X, Linux, Windows, BSD)
◦ 単一バイナリ ◦ 豊富な標準ライブラリ (syscallからnet/httpまで) • Github ◦ ソースコードリポジトリ • Wercker ◦ ビルド環境を自由に作成できるCI as a Service ◦ goxcを使い、クロスコンパイル ◦ 成果物をGithub Releasesへデプロイ
goxc • goxcを使うと以下を自動的に実行 ◦ 各プラットフォーム向けツールチェインのビルド (必要なら) ◦ クロスコンパイル ◦ プラットフォーム毎にアーカイブ
• goxcももちろんGoで書かれていてダウンロードする だけで動作する goxc -tasks='xc archive' -bc 'linux,amd64,386 darwin,amd64,386'
wercker (workerと読む) • Dockerのコンテナのように ビルド環境をboxとして自 由に構築、共有できる • 成果物のデプロイプロセス も定義できる •
サービスはまだベータの 位置付け
wercker (build) • YAMLでビルドプ ロセスを定義 • go {get, build, test,
fmt} • 最後にgoxcでビ ルド
wercker (one-click deployment) herokuなどのPaaS にもデプロイ可能
wercker (deploy) • UIから手動デプロイ • 特定ブランチへの pushに応じて自動 デプロイ
参考文献 • “pecoのバイナリ配布の話” http://lestrrat.ldblog.jp/archives/39736492.html • “Wercker で Go のプロジェクトをクロスコンパイルし、 Github
にリリースする” http://motemen.hatenablog. com/entry/2014/06/27/xcompile-go-and-release-to- github-with-wercker • nabeken/docker-cleaner (上をまねて作った) https://github.com/nabeken/docker-cleaner