LoginSignup
6
2

More than 5 years have passed since last update.

GitLab Development Kit で OSS開発 に参加する for MAC 2017

Last updated at Posted at 2017-12-28

GitLab の開発環境は GitLab Development Kit で構築します。
(年々手順が簡単になっているので2017年12月のバージョンで記載します。)

公式の Prepare your computerSet-up GDK に記載されている所から
GitLab Community Edition (CE) の開発環境の構築手順を抜粋しました。

image.png

Install

Ruby package

  • Homebrewrbenv をインストールします。
  • Ruby のバージョンは .ruby-version を参考に決定します。
  • 開発環境を作成するディレクトリでは Ruby のバージョンを指定します。
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew install rbenv ruby-build
$ rbenv install 2.3.6
$ rbenv local 2.3.6
$ gem install bundler
$ rbenv rehash

Other package

  • いろいろな言語やミドルウェアをインストールします。
    • PostgreSQL 10.x系は対応していません。
$ brew install git redis postgresql@9.6 libiconv icu4c pkg-config cmake go openssl node yarn coreutils re2
$ bundle config build.eventmachine --with-cppflags=-I/usr/local/opt/openssl/include

GitLab Development Kit

  • GitLab Community Edition は公式から Fork します。
    • gitlab_repoFork したURLを指定します。
    • Fork ボタンをクリックしてから完了まで意外と時間がかかりました。
$ gem install gitlab-development-kit
$ gdk init
$ cd gitlab-development-kit
$ gdk install gitlab_repo=https://gitlab.com/[name]/gitlab-ce.git
  • *** Setup finished! *** が表示されると完了です。
    • 時間が30分以上はかかりました。特に Seed で時間が使われます。
*********************************************
************** Setup finished! **************
*********************************************
cat HELP
# GitLab Development Kit cheat sheet

gdk run            # Start everything
gdk run db         # Start enough to run tests
gdk run app        # Start GitLab, needs 'gdk run db'

gdk install gitlab_repo=https://my-fork   # Install everything
gdk update                                # Pull application changes from Git
gdk reconfigure                           # Delete and regenerate all config files created by GDK
gdk psql -d gitlabhq_development          # Postgres console
gdk redis-cli                             # Redis console

# Development admin account: root / 5iveL!fe

Start everything

  • gdk run コマンドで GitLab を利用するアプリケーションが開始されます。
$ gdk run
  • http://localhost:3000 にアクセスして root ユーザーのパスワードの入力します。

image.png

Tips

  • 公式のブランチに更新するには support/set-gitlab-upstream コマンドで Upstream ブランチを登録します。
  • そうすると gdk update コマンドでソースコードの更新から再構築まで実行されます。
$ support/set-gitlab-upstream
$ gdk update

Link


この記事を書いている途中に gdk install コマンドで使用される rake dev:setup コマンドにバグが見つかりイシューを登録するとすぐにマージされました。

:calendar: 2018年3月10日のOSS Gate大阪ワークショップではGitLabのイベントを開催します。OSS開発に参加してコントリビュートしましょう!

6
2
1

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
6
2