Skip to content

Instantly share code, notes, and snippets.

@samrocketman
Created January 28, 2014 16:44
Show Gist options
  • Select an option

  • Save samrocketman/8671404 to your computer and use it in GitHub Desktop.

Select an option

Save samrocketman/8671404 to your computer and use it in GitHub Desktop.
I created this quick snippet of how to install GitLab on RHEL6 for my own reference and for others.

Gitlab Installation Instructions on RHEL6/CentOS6

Installation Procedure

Bits of this were taken from the unofficial guide for CentOS 6.

User

If you plan on installing the user by default in /home then just add a user as you normally would. I customized the git user home to a different volume.

semanage fcontext -a -t user_home_dir_t '/app/gitlab(/.*)?'
useradd gitlab --home /app/gitlab
su - gitlab
ssh-keygen

Install build tools

yum groupinstall "Development tools"
yum groupinstall "Debugging Tools"
yum install libxslt-devel libyaml-devel libxml2-devel gdbm-devel libffi-devel zlib zlib-devel openssl-devel libyaml-devel readline readline-devel curl-devel openssl-devel pcre-devel git memcached-devel valgrind-devel mysql-devel ImageMagick-devel ImageMagick libicu libicu-devel libffi-devel make bzip2 autoconf automake libtool bison iconv-devel redis mysql mysql-devel mysql-server mysql-server-devel
service redis start
chkconfig redis on
cd /usr/local/src/

Ruby

Install Ruby by compiling it.

gem install bundler
gem install charlock_holmes --version '0.6.9'

Git

Install Git by compiling it.

gitlab-shell

Log in as git user and work from the home directory.

git clone https://github.com/gitlabhq/gitlab-shell.git
cd gitlab-shell
cp config.yml.example config.yml #edit this file and put repository and user location in /app/git
./bin/install
./bin/check

gitlab

Note: I run all commands logged in as the git user using sudo -i -u git or sudo su - git. In RHEL, not all of the sudo provided commands by gitlabhq work so logging into the git user with a session is the best method.

git clone https://github.com/gitlabhq/gitlabhq.git gitlab
cd gitlab
git checkout 6-0-stable
cd config
cp gitlab.yml.example gitlab.yml
cp unicorn.rb.example unicorn.rb
cp database.yml.mysql database.yml

Execute the bundle commands from ~git/gitlab logged in as the git user.

bundle install --deployment --without development test postgres aws
bundle exec rake gitlab:setup RAILS_ENV=production
bundle exec rake assets:precompile RAILS_ENV=production

After installing the init.d script be sure to start gitlab and then run a diagnostic test.

bundle exec rake gitlab:env:info RAILS_ENV=production
bundle exec rake gitlab:check RAILS_ENV=production

Upgrading gitlab

I have published my workflow for upgrading Gitlab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment