Gitlab による ローカルGitサーバ を ubuntu 18.04 上に構築しましたので、下記にメモを残します。
参考サイト
インストール手順
sudo apt install curl openssh-server ca-certificates
sudo apt install postfix
※postfix の設定は Local only
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
※会社内など proxy 環境では上記 curl が失敗する可能性があります。
error:1408F10B:SSL routines:ssl3_get_record:wrong version number
その場合は script.deb.sh をダウンロードしてから bash で直接実行
sudo apt install gitlab-ce
The repository is setup! You can now install packages.
と表示されればリポジトリ登録完了
sudo apt install gitlab-ce
Thank you for installing GitLab!
と表示されればインストール完了
セッティング
sudo vim /etc/gitlab/gitlab.rb
下記2行を変更
external_url 'http://(ローカルアドレス)(:アクセスポート番号)'
※デフォルトだと 80 なので、例えば 9010 など、アクセスするポート番号をローカルで決めて設定
gitlab_rails['time_zone'] = 'Asia/Tokyo'
変更を反映させる
sudo gitlab-ctl reconfigure
初期ユーザ root のパスワードは下記にあり。確認しよう
sudo cat /etc/gitlab/initial_root_password
Password: (初期のランダムパスワードが設定されている)
ブラウザ等でアクセスして確認、ユーザ root、先ほどの Password を入力
あとは GUIベースで設定を変更
以上