git 树莓派和 GitLab
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19606735/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Raspberry Pi and GitLab
提问by Jamesking56
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?
有没有办法在运行 Raspbian 的 Raspberry Pi 设备上运行 GitLab(http://gitlab.org/gitlab-ce)和 GitLab CI(http://gitlab.org/gitlab-ci)?
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?
我想拥有自己的内部 Git 盒子,我可以在其中存储代码,并可能允许其他朋友也可以上传他们的代码。是否可以?
Thanks.
谢谢。
采纳答案by Ariel M.
Official way for the Pi 2
Pi 2 的官方方式
There is a very easy way to install it on the Raspberry Pi 2.
有一种非常简单的方法可以将它安装在 Raspberry Pi 2 上。
wget https://s3-eu-west-1.amazonaws.com/downloads-packages/raspberry-pi/gitlab_7.9.0-omnibus.pi-1_armhf.deb
sudo dpkg -i gitlab_7.9.0-omnibus.pi-1_armhf.deb
You might prefer to go to the official pagein order to get latest version. It's fast and easy, they recommend at least 1Gb swap.
您可能更愿意访问官方页面以获取最新版本。它既快速又简单,他们建议至少 1Gb 交换。
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.
在 Pi B 和 B+ 上,您很快就会达到内存限制并随着增长而降低性能,但在 Pi 2 上它运行良好,特别是如果您将存储库安装在外部 USB 硬盘上。
回答by user3883624
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.
可以在 Raspberry Pi 上安装 GitLab。您将需要 Raspberry pi Model B reversion 2012 或 Model B+(512mb 的 RAM)。安装 GitLab 需要很长时间。
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
获取最新 Raspbian 的全新副本并扩展文件系统。一定要启动到文本模式。
通过键入释放空间:
sudo apt-get purge xorg lxde xinit openbox lightdm && sudo apt-get autoremove && sudo apt-get clean
通过键入添加更多交换空间:(
sudo dd if=/dev/zero of=/swapfile1 bs=1024 count=524288
这将需要一分钟左右)通过键入激活交换空间
sudo mkswap /swapfile1 && sudo chmod 0600 /swapfile1 && sudo swapon /swapfile1
获取外部硬盘驱动器并将其格式化为ext4。(很重要)
添加 Git 用户:
sudo adduser --disabled-login --gecos 'GitLab' git
删除 /home/git 中的所有内容
sudo rm -rf /home/git/* && sudo rm -rf /home/git/.*
在 /etc/fstab 中添加以下内容: (
sudo editor /etc/fstab
)/swapfile1 none swap defaults 0 0 /dev/sda1 /home/git ext4 defaults 0 0
重启:
sudo reboot
按照此处的说明获取最新版本的 gitlab(当前为 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.
注意:在“安装 Gems”步骤中,当您键入 时sudo -u git -H bundle install --deployment --without development test mysql aws
,将需要几个小时,尤其是在获取 gem 源和安装“kgio”时。您可以在此过程中忽略所有不兼容消息。
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.
另外需要注意的是,在 GitLab 中创建项目需要很长时间。如果超过一分钟,只需返回仪表板。
回答by Arthur
You can find GitLab requirementshere. If you have Raspberry Pi model B (512MB of RAM), I think that you can run GitLab but you might encounter performance issue.
您可以在此处找到GitLab 要求。如果你有树莓派 B 型(512MB 内存),我认为你可以运行 GitLab,但你可能会遇到性能问题。
I'd suggest that you take a look hereto find lighter systems.
我建议你看看这里找到更轻的系统。
回答by Mauvis Ledford
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
我在小型服务器上使用 Gitolite,它非常棒。没有网络用户界面。Gitolite 本身只是一个 git repo,您可以推送和拉取更改以控制访问
回答by bomba
On your expanded, up-to-date raspbian, edit the swap space config file:
在您扩展的最新 raspbian 上,编辑交换空间配置文件:
sudo vi /etc/dphys-swapfile
Change CONF_SWAPSIZE from 100 to 1000
将 CONF_SWAPSIZE 从 100 更改为 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
目前按照最新的 GitLab 的说明进行操作:https: //gitlab.com/gitlab-org/gitlab-ce/blob/8-14-stable/doc/install/installation.md
Happy gitting!
快乐的吉丁!