Is there a way I can run GitLab (http://gitlab.org/gitlab-ce) and GitLab CI (http://gitlab.org/gitlab-ci) on a Raspberry Pi device running Raspbian?
I want to have my own internal Git box where I can store code and possibly allow other friends access to upload their code too. Is it possible?
Thanks.
It is possible to install GitLab on the Raspberry Pi. You will need the Raspberry pi model B reversion 2012 or model B+ (512mb of RAM). Installing GitLab takes a very long time.
Steps:
Get a fresh copy of the latest Raspbian and expand the file system. Be sure to boot to text mode.
Free-up space by typing:
sudo apt-get purge xorg lxde xinit openbox lightdm && sudo apt-get autoremove && sudo apt-get clean
Add some more swap space by typing:
sudo dd if=/dev/zero of=/swapfile1 bs=1024 count=524288
(this will take a minute or so)Activate the swap space by typing
sudo mkswap /swapfile1 && sudo chmod 0600 /swapfile1 && sudo swapon /swapfile1
Get an external hard drive and format it as ext4. (very important)
Add the Git user:
sudo adduser --disabled-login --gecos 'GitLab' git
Delete everything in /home/git
sudo rm -rf /home/git/* && sudo rm -rf /home/git/.*
Add the following in /etc/fstab: (
sudo editor /etc/fstab
)/swapfile1 none swap defaults 0 0 /dev/sda1 /home/git ext4 defaults 0 0
Reboot:
sudo reboot
Follow the instructions here for the latest version of gitlab (currently 7.7): https://gitlab.com/gitlab-org/gitlab-ce/blob/7-7-stable/doc/install/installation.md
Notes: On step "Install Gems", when you type
sudo -u git -H bundle install --deployment --without development test mysql aws
, It will take several hours, especially while fetching the gem sources and installing "kgio". You can ignore all incompatibility messages during this process.Another thing to note is that creating a project inside GitLab takes a very long time. Just return to the dashboard if it takes more than a minute.
You can find GitLab requirements here. If you have Raspberry Pi model B (512MB of RAM), I think that you can run GitLab but you might encounter performance issue.
I'd suggest that you take a look here to find lighter systems.
I use Gitolite on a small server and it's pretty awesome. There is no web UI. Gitolite itself is just a git repo you push and pull changes to to control access
https://github.com/sitaramc/gitolite
On your expanded, up-to-date raspbian, edit the swap space config file:
Change CONF_SWAPSIZE from 100 to 1000
Follow the instructions for the latest GitLab, at the moment: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-14-stable/doc/install/installation.md
Happy gitting!
Official way for the Pi 2
There is a very easy way to install it on the Raspberry Pi 2.
You might prefer to go to the official page in order to get latest version. It's fast and easy, they recommend at least 1Gb swap.
On the Pi B and B+ you will hit the memory limit very soon and get degraded performance as you grow, but on the Pi 2 it works nicely, specially if you mount your repos on an external USB hard disk.