LoginSignup
24
25

More than 5 years have passed since last update.

MacにGitLabの開発環境を構築する(2015年6月版)

Last updated at Posted at 2015-06-24

久しぶりにGitLabへのcontributeを再開しようというモチベーションが高まったので、取り急ぎGitLabの開発環境を構築する方法を調べました。

以前はvagrantで開発環境が提供されていましたが、VMだと遅いという問題があるので、現在はGitLab Development Kitを使用してネイティブに環境を構築することが推奨されているようです。

GitLab Development Kitのドキュメントの通りにすれば構築出来るかと思いますが、若干躓いたので作業ログを残しておきます。

環境

  • OS: OS X 10.10.3
  • Ruby: 2.1.6(rbenv)

構築手順

rubyをインストール

まずは、この辺を参考にrbenvをインストールします。続いて、rbenvでruby 2.1.6をインストールする

$ rbenv install 2.1.6
$ rbenv global 2.1.6
$ gem install bundler
$ rbenv rehash

必要なパッケージをインストール

次に、必要なパッケージをbrewでインストールし、必要な設定を行います。

$ brew tap homebrew/dupes
$ brew tap homebrew/versions
$ brew install git redis postgresql phantomjs198 libxml2 libxslt libiconv icu4c pkg-config cmake nodejs
$ brew link --force libxml2 libxslt libiconv phantomjs198
$ bundle config build.nokogiri --use-system-libraries --with-iconv-dir="$(brew --prefix libiconv)"

GitLab Development Kitのセットアップ

GitLab Development Kitリポジトリをクローンしてきて、セットアップ作業を行います。

$ git clone https://gitlab.com/gitlab-org/gitlab-development-kit.git
$ cd gitlab-develop-kit
$ make

Makefileにより、リポジトリのクローンとgemのインストールと基本的な初期設定が実行されます。

インストール後の作業

rootディレクトリで以下のコマンドを実行し、RedisとPostgreSQLを開始します。

$ bundle exec foreman start

上記のコマンドを実行したまま、別のセッションウィンドウを開いて以下のコマンドを実行し、GitLabのrailsアプリケーションを起動します。

$ cd gitlab && bundle exec rake db:create dev:setup
bundle exec foreman start

この状態で http://localhost:3000 をブラウザで開くと、開発環境のログイン画面が表示されます。開発用のアカウントroot、パスワード5iveL!feを使用して、ログインできることを確認して下さい。

もう少し手間をかけるとGitLab CIの開発環境も一緒に構築できますが、とりあえず今回はGitLabの開発環境の構築までにしておきます。

関連リンク

24
25
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
24
25