Gitの管理で楽をしたかったので、GitLabをインストールしてみた。(もっと楽をするならば、GitHubやBacklogを契約すればいいのだろうけど)
インストール先は、Ubuntu 18.04 Desktop。Serverにしておけばよかった。
最初にGitLabのインストールに必要なツールをインストールする。
sudo apt install openssh-server sudo apt install curl sudo apt install postfix
次に、aptの参照先にgitlabのものを追加する。
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
aptでgitlabをインストールする。
sudo apt install gitlab-ce
gitlabの設定ファイルを編集する。エディタはインストールしている好きなものを指定する。
sudo xemacs21 /etc/gitlab/gitlab.rb
最低限のアクセス用のURLとタイムゾーンを変更する。それ以外は、必要に応じてカスタマイズする。とりあえず動かすだけならば、この2つ。
external_url
gitlab_rails['time_zone'] = 'Asia/Tokyo'
設定を反映させる。
sudo gitlab-ctl reconfigure
実際にアクセスしてみて、Gitlabが表示されればOK。初回のアクセス時にrootユーザのパスワード設定があるので、忘れずに行う。
■インストールしたときのログ。
zen@LAB:~$ curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash Detected operating system as Ubuntu/bionic. Checking for curl... Detected curl... Checking for gpg... Detected gpg... Running apt-get update... done. Installing apt-transport-https... done. Installing /etc/apt/sources.list.d/gitlab_gitlab-ce.list...done. Importing packagecloud gpg key... done. Running apt-get update... done. The repository is setup! You can now install packages. zen@LAB:~$ zen@LAB:~$ zen@LAB:~$ zen@LAB:~$ zen@LAB:~$ sudo apt install gitlab-ce パッケージリストを読み込んでいます... 完了 依存関係ツリーを作成しています 状態情報を読み取っています... 完了 以下のパッケージが新たにインストールされます: gitlab-ce アップグレード: 0 個、新規インストール: 1 個、削除: 0 個、保留: 0 個。 708 MB のアーカイブを取得する必要があります。 この操作後に追加で 1,858 MB のディスク容量が消費されます。 取得:1 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu bionic/main amd64 gitlab-ce amd64 12.3.2-ce.0 [708 MB] 708 MB を 15秒 で取得しました (47.3 MB/s) 以前に未選択のパッケージ gitlab-ce を選択しています。 (データベースを読み込んでいます ... 現在 172865 個のファイルとディレクトリがインストールされています。) .../gitlab-ce_12.3.2-ce.0_amd64.deb を展開する準備をしています ... gitlab-ce (12.3.2-ce.0) を展開しています... gitlab-ce (12.3.2-ce.0) を設定しています ... It looks like GitLab has not been configured yet; skipping the upgrade script. *. *. *** *** ***** ***** .****** ******* ******** ******** ,,,,,,,,,***********,,,,,,,,, ,,,,,,,,,,,*********,,,,,,,,,,, .,,,,,,,,,,,*******,,,,,,,,,,,, ,,,,,,,,,*****,,,,,,,,,. ,,,,,,,****,,,,,, .,,,***,,,, ,*,. _______ __ __ __ / ____(_) /_/ / ____ _/ /_ / / __/ / __/ / / __ `/ __ \ / /_/ / / /_/ /___/ /_/ / /_/ / \____/_/\__/_____/\__,_/_.___/ Thank you for installing GitLab! GitLab was unable to detect a valid hostname for your instance. Please configure a URL for your GitLab instance by setting `external_url` configuration in /etc/gitlab/gitlab.rb file. Then, you can start your GitLab instance by running the following command: sudo gitlab-ctl reconfigure For a comprehensive list of configuration options please see the Omnibus GitLab readme https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md zen@LAB:~$