Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
仕事でGoで書いたWindows向けの小さなアプリをAppVeyorを使ってCIした話
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Daichi Hioki
March 27, 2019
Technology
280
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
仕事でGoで書いたWindows向けの小さなアプリをAppVeyorを使ってCIした話
第8回ゆるはち.it: CI/CDについてゆるく話す -
https://yuruhachi-it.connpass.com/event/123888/
での LT 資料です。
Daichi Hioki
March 27, 2019
More Decks by Daichi Hioki
See All by Daichi Hioki
Rustで学ぶTOTP
hioki_daichi
0
1.4k
Gopher道場#3を振り返る
hioki_daichi
0
2.6k
Rubyエンジニア多めの現場での Vue.js1系 on Rails
hioki_daichi
5
1.3k
Other Decks in Technology
See All in Technology
SSFの現在地 ― CAEP/RISCからAI Identityへ
oidfj
0
340
Cloudflareの向き先
chimame
1
150
コードレビューをなくして見えたもの
henteko
0
140
GCASアップデート(202607-202610)
techniczna
1
240
eBPF 簡介 2026 版
shunghsiyu
0
190
公共分野での生成AI活用
toru_kubota
1
310
AX時代の自治体支援リソース再配分と役割分担の再構成:戦略とロードマップ(概要)
sishi2026
0
210
HQ駆動開発で最高のAI-Contextを作ろう
sansantech
PRO
1
120
プロダクションコードにおける encoding/json から encoding/json/v2 へのスムーズな移行
sansantech
PRO
1
230
2026 Apache Flink Community Checkpoint
rmetzger
0
210
Agent Harnessはどう作る?事例から学ぶAI Agentの設計思想
sergicalsix
0
230
令和の今、あらためて IAM を考える。アクセスキーを「無くせない現実」との向き合い方
kazzpapa3
0
540
Featured
See All Featured
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
510
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
The Limits of Empathy - UXLibs8
cassininazir
2
770
How to Talk to Developers About Accessibility
jct
2
620
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
A Soul's Torment
seathinner
8
3.9k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
1
300
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Transcript
仕事でGoで書いたWindows 向けの小さなアプリを AppVeyorを使ってCIした話
自己紹介 - 株式会社クリプラでクラウド電子カルテを開発している Rails エンジニア - https://clipla.jp/ - 最近は Go
で Windows 向けアプリを作成中 - こちらにまつわる CI のご紹介
AppVeyor とは - Windows 環境の CI ができるやつ - (Windows 以外も対応してるけど・・)
- 価格 - Public なリポジトリなら無料 - 2019年3月時点で Private なリポジトリ は $29/month
設定方法 - Web からでも YAML でも 設定可能 - Web の場合は→
- YAMLの場合は appveyor.yml で
設定方法 - Web で設定したものを YAML へ Export するこ とも可能
Build Worker Image - 現時点でのデフォルト: - Visual Studio 2015 -
ubuntu 等も選択可能 - ubuntu を Worker Image に 使った Getting started ページも ある - Getting started with AppVeyor for Linux | AppVeyor
Stack (※ 今回は使わず) - stack: go 1.11 のように指定すること で公式の用意した Go
を使える
Build Cache - 指定したディレクトリやファイルの内容をビルド間で保持できる 機能
AppVeyor でテストを行う例
appveyor.yml に変更があったら cache からの restore を skip する こちらは Windows
のコマンド > https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/if if [not] exist <FileName> <Command> [else <Expression>] 公式でまだ Go1.12 がサポートされていないためソースからインストール msiexec /i でインストール https://docs.microsoft.com/ja-jp/windows/desktop/Msi/command-line-options あらかじめ environment の箇所で環境変数 GOBIN を c:\gobin に設定しているため、$ go install した時に c:\gobin 以下にツールをインストールしてくれる どこでもよさそう。Go の Modules 導入以前は制限があったかも。 Go のモジュールシステムが過渡期なのでこのような指定が必要 詳細: https://github.com/golang/go/wiki/Modules
AppVeyor に GoReleaser を組み合わせることで tag を push した時に自動で GitHub Releases
に Publish する例
if %APPVEYOR_REPO_TAG% equ true <コマンド> で tag を push した時だけ実行したいコマンドを定義できる
deploy_script 内での goreleaser release の実行
GoReleaser の設定ファイルは .goreleaser.yaml - builds の goos と goarch で
指定した組み合わせをすべ て生成してくれる - 右の例では 6 通り
GoReleaser には環境変数 GITHUB_TOKEN が必要 - GoReleaser を使ってリリースするためには repo の scope
を 持った GitHub token を環境変数 GITHUB_TOKEN に設定 する必要がある
GitHub token の作成 - https://github.com/settings/tokens/new で作るだけ
AppVeyor で環境変数 GITHUB_TOKEN を指定する
あとは tag を push するだけ - tag を push するだけで
GitHub Releases にリリース が作成される
まとめ
- 話したこと - AppVeyor の概要: - 設定方法、Build Worker Image、Stack、Build Cache
- プロジェクトでの実例: - Go1.12 をソースからインストールして statik もインストールしてテスト - AppVeyor + GoReleaser: - AppVeyor と GoReleaser を組み合わせて、tag を push した時に自動で GitHub Releases に publish - その他 - 今回試していなかったけれど、コードが大きい場合は Azure Pipelines の方が良い かも? - https://azure.microsoft.com/ja-jp/services/devops/pipelines/ - Public なリポジトリなら無料で 10 個の並列ジョブ(時間制限なし)を実行可能ら しい