Gitlab instructions

This commit is contained in:
Bob Mottram 2014-05-04 17:43:48 +01:00
parent 74f1c954cb
commit eee5ee1fc2
1 changed files with 58 additions and 21 deletions

View File

@ -7148,55 +7148,85 @@ You will notice that an icon appears in the top right corner of the browser, whi
** Gitlab ** Gitlab
Install some dependencies:
#+BEGIN_SRC: bash
apt-get update -y apt-get update -y
apt-get upgrade -y apt-get upgrade -y
apt-get install sudo -y apt-get install sudo -y
apt-get install -y build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev curl openssh-server redis-server checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libicu-dev logrotate git-core apt-get install -y build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev curl openssh-server redis-server checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libicu-dev logrotate git-core
#+END_SRC
Install bundler
#+BEGIN_SRC: bash
gem install bundler --no-ri --no-rdoc gem install bundler --no-ri --no-rdoc
#+END_SRC
Create a user for running Gitlab.
#+BEGIN_SRC: bash
adduser --disabled-login --gecos 'GitLab' git adduser --disabled-login --gecos 'GitLab' git
#+END_SRC
Install mysql (it may already be installed).
#+BEGIN_SRC: bash
apt-get install -y mysql-server mysql-client libmysqlclient-dev apt-get install -y mysql-server mysql-client libmysqlclient-dev
mysql_secure_installation mysql_secure_installation
mysql -u root -p mysql -u root -p
#+END_SRC
CREATE USER 'git'@'localhost' IDENTIFIED BY '$password'; Enter the following commands, substituting /gitlabpassword/ with a password to be used for the Gitlab installation.
#+BEGIN_SRC: bash
CREATE USER 'git'@'localhost' IDENTIFIED BY 'gitlabpassword';
SET storage_engine=INNODB; SET storage_engine=INNODB;
CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`; CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
GRANT SELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'git'@'localhost'; GRANT SELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'git'@'localhost';
quit quit
#+END_SRC
Obtain the code and install it.
#+BEGIN_SRC: bash
cd /home/git cd /home/git
sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-ce.git -b 6-8-stable gitlab sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-ce.git -b 6-8-stable gitlab
cd /home/git/gitlab cd /home/git/gitlab
sudo -u git -H cp config/gitlab.yml.example config/gitlab.yml sudo -u git -H cp /home/git/gitlab/config/gitlab.yml.example /home/git/gitlab/config/gitlab.yml
sudo -u git -H editor config/gitlab.yml sudo -u git -H editor /home/git/gitlab/config/gitlab.yml
chown -R git log/ #+END_SRC
chown -R git tmp/
chmod -R u+rwX log/ Set /host/ to your gitlab domain name, /port/ to 443 and /https/ to true, then save and exit.
chmod -R u+rwX tmp/
#+BEGIN_SRC: bash
chown -R git /home/git/gitlab/log/
chown -R git /home/git/gitlab/tmp/
chmod -R u+rwX /home/git/gitlab/log/
chmod -R u+rwX /home/git/gitlab/tmp/
sudo -u git -H mkdir /home/git/gitlab-satellites sudo -u git -H mkdir /home/git/gitlab-satellites
chmod u+rwx,g+rx,o-rwx /home/git/gitlab-satellites chmod u+rwx,g+rx,o-rwx /home/git/gitlab-satellites
chmod -R u+rwX tmp/pids/ chmod -R u+rwX /home/git/gitlab/tmp/pids/
chmod -R u+rwX tmp/sockets/ chmod -R u+rwX /home/git/gitlab/tmp/sockets/
chmod -R u+rwX public/uploads chmod -R u+rwX /home/git/gitlab/public/uploads
sudo -u git -H cp config/unicorn.rb.example config/unicorn.rb sudo -u git -H cp /home/git/gitlab/config/unicorn.rb.example /home/git/gitlab/config/unicorn.rb
sudo -u git -H editor config/unicorn.rb #sudo -u git -H editor /home/git/gitlab/config/unicorn.rb
sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb sudo -u git -H cp /home/git/gitlab/config/initializers/rack_attack.rb.example /home/git/gitlab/config/initializers/rack_attack.rb
sudo -u git -H git config --global user.name "GitLab" sudo -u git -H git config --global user.name "GitLab"
sudo -u git -H git config --global user.email "gitlab@localhost" sudo -u git -H git config --global user.email "gitlab@localhost"
sudo -u git -H git config --global core.autocrlf input sudo -u git -H git config --global core.autocrlf input
sudo -u git cp /home/git/gitlab/config/database.yml.mysql /home/git/gitlab/config/database.yml
Edit gitlab.yml and unicorn.rb as needed. sudo -u git -H chmod o-rwx /home/git/gitlab/config/database.yml
sudo -u git cp config/database.yml.mysql config/database.yml
sudo -u git -H editor config/database.yml
sudo -u git -H chmod o-rwx config/database.yml
sudo -u git -H bundle install --deployment --without development test postgres aws sudo -u git -H bundle install --deployment --without development test postgres aws
#+END_SRC
Fails here with:
/Could not find libv8-3.16.14.3 in any of the sources/
/Run `bundle install` to install missing gems./
#+BEGIN_SRC: bash
sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production
cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:shell:install[v1.9.3] REDIS_URL=redis://localhost:6379 sudo -u git -H bundle exec rake gitlab:shell:install[v1.9.3] REDIS_URL=redis://localhost:6379
sudo -u git -H editor /home/git/gitlab-shell/config.yml sudo -u git -H editor /home/git/gitlab-shell/config.yml
cp lib/support/init.d/gitlab /etc/init.d/gitlab cp lib/support/init.d/gitlab /etc/init.d/gitlab
@ -7205,13 +7235,20 @@ cp lib/support/logrotate/gitlab /etc/logrotate.d/gitlab
sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production
service gitlab start service gitlab start
#+END_SRC
Set up the Apache configuration.
#+BEGIN_SRC: bash
cp lib/support/apache/gitlab /etc/apache2/sites-available/mygitlabdomain cp lib/support/apache/gitlab /etc/apache2/sites-available/mygitlabdomain
editor /etc/apache2/sites-available/mygitlabdomain editor /etc/apache2/sites-available/mygitlabdomain
#+END_SRC
Set your domain name and email accordingly. Set your domain name and email accordingly.
#+BEGIN_SRC: bash
a2ensite mygitlabdomain a2ensite mygitlabdomain
#+END_SRC
* Related projects * Related projects