GitLabをパッケージ・インストールする

環境: CentOS7
手段: パッケージインストール, メール/HTTPS未対応

次のサイトの通り。ではないので(誤字+enterpriseではなくcommunityをインストールしたい)、書きます。

https://www.gitlab.jp/installation/#centos-7

sudo yum install -y curl policycoreutils-python openssh-server
sudo systemctl enable sshd
sudo systemctl start sshd
sudo firewall-cmd --permanent --add-service=http
sudo systemctl reload firewalld
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash

バージョンアップの練習をしたいので、いったん古いバージョン(とりあえず10.2.5)でインストールします。存在するバージョンは次のサイトで確認します。

https://packages.gitlab.com/gitlab/gitlab-ce

EXTERNAL_URLはインストールしたマシンのIPまたはホスト名を書きます。

sudo EXTERNAL_URL="http://192.168.xxx.yyy" yum install -y gitlab-ce-10.2.5-ce.0.el7.x86_64

ブラウザでEXTERNAL_URLにアクセスするとrootユーザーのパスワード設定が始まります。

インストール後、URLを変えたい場合は設定ファイルを書き換えて再起動します。

https://docs.gitlab.com/omnibus/settings/configuration.html#enable-relative-url-in-gitlab

sudo gitlab-ctl stop unicorn
sudo gitlab-ctl stop sidekiq

/etc/gitlab/gitlab.rb を開いて external_url を書き換えます。

sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart