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
270
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.3k
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
"優秀な誰か"の下位互換にならないために
yut0naga1_fa
1
1.8k
夫婦で子育てするための育児標準化
codmoninc
PRO
0
460
初海外で注意すべきこと12選!!!安全快適なre:invent生活にするために
yuuuuuuu168
1
180
データエンジニアの次の戦場は "プロセスエンジニアリング"
sansantech
PRO
1
100
Conditional PED-ANOVA: Hyperparameter Importance in Hierarchical & Dynamic Search Spaces
pfn
PRO
0
140
FinOps Agentが生んだ技術負債:コスト自動調査の落とし穴と解消までの道のり
oasis1994liveforever
2
140
AI時代のPRレビューにどう向き合うか?
kairim0
1
240
PHPカンファレンス関西の招待状 / Invitation to PHP Conference Kansai
ykanoh
0
210
JAWS-UGグッズ職人仕事の流儀
kentapapa
0
120
WasmをRustにする
sansantech
PRO
0
280
オントロジーって 結局なにもの? AI エージェントに「意味」を渡す知識設計の話
greenmidori
0
230
Gemini Intelligence 入門 ― AppFunctions と Gemini Nano
takuroabe
0
300
Featured
See All Featured
The agentic SEO stack - context over prompts
schlessera
0
970
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.7k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
WENDY [Excerpt]
tessaabrams
14
40k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
850
Statistics for Hackers
jakevdp
799
230k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
380
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
4 Signs Your Business is Dying
shpigford
187
23k
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 個の並列ジョブ(時間制限なし)を実行可能ら しい