raspberrypi3B+ + Ubuntu18.04LTSにGitLabをインストールして起動


Gitlabをインストール

sudo apt-get install -y curl openssh-server ca-certificates apt-transport-https
sudo curl https://packages.gitlab.com/gpg.key | sudo apt-key add - 
sudo curl -o /etc/apt/sources.list.d/gitlab_ce.list "https://packages.gitlab.com/install/repositories/gitlab/raspberry-pi2/config_file.list?os=debian&dist=jessie" && sudo apt-get update
sudo apt install -y gitlab-ce 

以下の表示が出ればOK



       *.                  *.
      ***                 ***
     *****               *****
    .******             *******
    ********            ********
   ,,,,,,,,,***********,,,,,,,,,
  ,,,,,,,,,,,*********,,,,,,,,,,,
  .,,,,,,,,,,,*******,,,,,,,,,,,,
      ,,,,,,,,,*****,,,,,,,,,.
         ,,,,,,,****,,,,,,
            .,,,***,,,,
                ,*,.

     _______ __  __          __
    / ____(_) /_/ /   ____ _/ /_
   / / __/ / __/ /   / __ `/ __ \
  / /_/ / / /_/ /___/ /_/ / /_/ /
  \____/_/\__/_____/\__,_/_.___/


gitlab: Thank you for installing GitLab!
gitlab: To configure and start GitLab, RUN THE FOLLOWING COMMAND:

Gitlabを起動

$ sudo gitlab-ctl reconfigure 

Gitlabへアクセス

ブラウザから http://[IPアドレス] を入力するとアクセスできる

ユーザ名:root、パスワード:(設定したパスワード) でアクセス

リポジトリ作成してPush

NewGroup作成→NewProject作成(例:myprg)

git clone http://192.168.2.100/root/myprj.git
cd myprj
touch test.txt
git add test.txt
git commit -m "first commit"
git push

test.txtがpushされた事を確認

fatal: unable to access 'http://raspberrypi/root/myprj.git/': Could not resolve host: raspberrypi

ホスト名指定してアクセスしたらなぜか解決できないと言われた。
IPアドレス指定して回避。

$ git clone http://raspberrypi/root/myprj.git
Cloning into 'myprj'...
fatal: unable to access 'http://raspberrypi/root/myprj.git/': Could not resolve host: raspberrypi

502-Whoops, GitLab is taking too much time to respond

GitLabから応答が遅い場合に出るエラー。ラズペリーパイではこれがよく発生する気がする。
(原因は色々あるようですが、私の場合は今までの設定が悪いと思いRaspiOSを再インストールしました)

502-Whoops, GitLab is taking too much time to respond

IPアドレスを入力しても「サーバに接続できません」と表示される

$ sudo gitlab-ctl reconfigure
Chef Client finished, 2/314 resources updated in 01 minutes 11 seconds
gitlab Reconfigured!

の後、すぐにアクセスするとIPアドレスを入力しても「サーバに接続できません」と表示されることがあった。
しばらく放置すると解決していた。

参考

gitlab
「GitLab」と「GitBucket」の概要
OSSのGitサーバ4種類を主観的に比較する
Raspberry Pi 3B+にGitLabをインストール
GitLab の HTTP ポート番号を変更する
502-Whoops, GitLab is taking too much time to respond