3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

VirtualBoxのSierra(ゲストOS)をGitLab runnerでService起動

Last updated at Posted at 2017-10-03

はじめに

あらかじめ書いておくと、gitlab runnerの10系以降はservice起動は廃止する方向らしいです。

スクリーンショット 2017-10-03 8.47.10.png https://gitlab.com/gitlab-org/gitlab-runner/issues/2710

runnerのインストール

公式の方法

brewでのインストール

$ brew search gitlab
==> Searching local taps...
gitlab-runner ✔
==> Searching taps on GitHub...
==> Searching blacklisted, migrated and deleted formulae...

困っていたこと

gitlab-runner runでは動くのにgilab-runner startではエラーが発生してました
brewでインストールした場合も同じ。

スクリーンショット 2017-10-03 8.54.15.png

設定

公式の記述

一応かいてくれてはいるんですが、伝わらない。
Sierraをホストでのサービス起動についての明確な記述がない。
理解はLaunchAgentsを使うんだ、くらいでした。

https://docs.gitlab.com/runner/install/osx.html#limitations-on-macos
スクリーンショット 2017-10-03 8.58.02.png

具体的なヒント

スクリーンショット 2017-10-03 8.51.14.png

EnvironmentVariablesの記述についてはこちらを参考にしました
https://qiita.com/kegamin/items/e035304e7295750cdf7d#homebrew_updateplist

~/Library/LaunchAgents/gitlab-runner.plist
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd" >
<plist version='1.0'>
<dict>
<key>Label</key><string>gitlab-runner</string>
<key>ProgramArguments</key>
<array>
・・・省略・・・
</array>
    <key>EnvironmentVariables</key>
    <dict>
        <key>PATH</key>
        <string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
    </dict>


<key>SessionCreate</key><false/>
<key>KeepAlive</key><true/>
<key>RunAtLoad</key><true/>
<key>Disabled</key><false/>
</dict>
</plist>

参考

さいごに

現状でも設定の問題はいくつか残っているのですが、日本語で問題解決しているサイトがググれずGitLabでのCIってまだまだなのかなと。無料で動かせてめちゃ便利ですよ:grinning:

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?