Gitlab Install Debian Wheezy

GitLab auf Debian Wheezy Installieren


GitLab
ist eine Open Source Git Managment Software geschrieben in Ruby. Mir gefällt es recht gut da es unter anderem Sehr an GitHub angelegt ist. Und eine Ähnlichkeit mit dem Stash von Atlassian hat.

Für dieses Howto Nutze ich eine Separate Debian VM und eine bereits laufenden MySQL Percona Cluster.
Man kann natürlich auch einen localen MySQL Server laufen lassen.

Packete Installieren

apt-get update
apt-get upgrade
apt-get install screen sudo vim dialog build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev curl git-core openssh-server redis-server checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libicu-dev python-docutils python mysql-client libmysqlclient-dev

Screen session Starten

screen -U -S gitlab-install

Python check muss größer 2.5 und kleiner 3.0+ sein

python –version

Ruby Installation

mkdir -p /opt/ruby && cd /opt/ruby
curl –progress ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz | tar xz
cd ruby-2.0.0-p247
export CONCURRENCY_LEVEL=4
./configure
make
make install

Wenn Ruby installiert ist dann bundler installieren mit diesem Kommando

gem install bundler –no-ri –no-rdoc

Als nächstes den GIT user als System User anlegen

adduser –disabled-login –gecos ‚GitLab‘ git

Jetzt holen wir uns die gitlap-shell

cd /home/git
sudo -u git -H git clone https://github.com/gitlabhq/gitlab-shell.git
cd gitlab-shell
sudo -u git -H git checkout v1.7.1
sudo -u git -H cp config.yml.example config.yml
sudo -u git -H nano config.yml

Hier darauf achten die gitlab_url mit der eigenen zu ersetzen

sudo -u git -H ./bin/install

MySQL Vorbereitung

mysql -h ha-proxy01.dmz-fra.secretisland.de -u root -p

MySQL User und Datenbank anlegen

CREATE DATABASE IF NOT EXISTS `gitlabDB` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
GRANT ALL ON `gitlabDB`.* TO ‚gitlab’@’%‘ identified by ‚MYSQL_PASSWORD‘;

Gitlab install

cd /home/git
sudo -u git -H git clone https://github.com/gitlabhq/gitlabhq.git gitlab
cd /home/git/gitlab
sudo -u git -H git checkout 6-0-stable

Wenn keine Fehler gekommen sind kann man hier weiter machen. Ich musste noch ein Fehlendes Paket nachinstallieren. Aber das hab ich oben mit aufgenommen.

cd /home/git/gitlab
sudo -u git -H cp config/gitlab.yml.example config/gitlab.yml
sudo -u git -H nano config/gitlab.yml

Ändern der URL nicht vergessen

Direcktory Permissions Setzen

chown -R git log/
chown -R git tmp/
chmod -R u+rwX log/
chmod -R u+rwX tmp/
sudo -u git -H mkdir /home/git/gitlab-satellites
sudo -u git -H mkdir tmp/pids/
sudo -u git -H mkdir tmp/sockets/
chmod -R u+rwX tmp/pids/
chmod -R u+rwX tmp/sockets/
sudo -u git -H mkdir public/uploads
chmod -R u+rwX public/uploads

unicorn HTTP Server Konfigurieren

sudo -u git -H cp config/unicorn.rb.example config/unicorn.rb
sudo -u git -H nano config/unicorn.rb

Schlussentlich git Config

sudo -u git -H git config –global user.name „GitLab“
sudo -u git -H git config –global user.email „gitlab@git.dmz-home.secretisland.de“
sudo -u git -H git config –global core.autocrlf input

Datenbank Setup

sudo -u git cp config/database.yml.mysql config/database.yml
sudo -u git -H nano config/database.yml

In der Production Secktion das so ändern

database: gitlabDB
username: gitlab
password: "MYSQL_PASSWORD"
host: ha-proxy01.dmz-fra.secretisland.de

Rechte Setzen

sudo -u git -H chmod o-rwx config/database.yml

Weitere benötigte ruby gems installieren

cd /home/git/gitlab
gem install charlock_holmes –version ‚0.6.9.4‘
sudo -u git -H bundle install –deployment –without development test postgres aws

Datenbank initialisieren

sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production

Hier darauf achten ‚yes‚ einzugeben wenn man gefragt wird

Start Script kopieren

cp lib/support/init.d/gitlab /etc/init.d/gitlab
chmod +x /etc/init.d/gitlab
update-rc.d gitlab defaults 21

Gitlab Aplication prüfen und Starten

sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
service gitlab start

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

*