From eee5ee1fc2c54952346e7ede0744ea72905fe891 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 4 May 2014 17:43:48 +0100 Subject: [PATCH] Gitlab instructions --- beaglebone.txt | 79 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 58 insertions(+), 21 deletions(-) diff --git a/beaglebone.txt b/beaglebone.txt index 0d3837cb..d63ce44c 100644 --- a/beaglebone.txt +++ b/beaglebone.txt @@ -7148,55 +7148,85 @@ You will notice that an icon appears in the top right corner of the browser, whi ** Gitlab +Install some dependencies: + +#+BEGIN_SRC: bash apt-get update -y apt-get upgrade -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 +#+END_SRC +Install bundler + +#+BEGIN_SRC: bash gem install bundler --no-ri --no-rdoc +#+END_SRC +Create a user for running Gitlab. + +#+BEGIN_SRC: bash 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 mysql_secure_installation 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; 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'; quit +#+END_SRC +Obtain the code and install it. + +#+BEGIN_SRC: bash cd /home/git sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-ce.git -b 6-8-stable gitlab cd /home/git/gitlab -sudo -u git -H cp config/gitlab.yml.example config/gitlab.yml -sudo -u git -H editor config/gitlab.yml -chown -R git log/ -chown -R git tmp/ -chmod -R u+rwX log/ -chmod -R u+rwX tmp/ +sudo -u git -H cp /home/git/gitlab/config/gitlab.yml.example /home/git/gitlab/config/gitlab.yml +sudo -u git -H editor /home/git/gitlab/config/gitlab.yml +#+END_SRC + +Set /host/ to your gitlab domain name, /port/ to 443 and /https/ to true, then save and exit. + +#+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 chmod u+rwx,g+rx,o-rwx /home/git/gitlab-satellites -chmod -R u+rwX tmp/pids/ -chmod -R u+rwX tmp/sockets/ -chmod -R u+rwX public/uploads -sudo -u git -H cp config/unicorn.rb.example config/unicorn.rb -sudo -u git -H editor config/unicorn.rb -sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb +chmod -R u+rwX /home/git/gitlab/tmp/pids/ +chmod -R u+rwX /home/git/gitlab/tmp/sockets/ +chmod -R u+rwX /home/git/gitlab/public/uploads +sudo -u git -H cp /home/git/gitlab/config/unicorn.rb.example /home/git/gitlab/config/unicorn.rb +#sudo -u git -H editor /home/git/gitlab/config/unicorn.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.email "gitlab@localhost" sudo -u git -H git config --global core.autocrlf input - -Edit gitlab.yml and unicorn.rb as needed. - -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 cp /home/git/gitlab/config/database.yml.mysql /home/git/gitlab/config/database.yml +sudo -u git -H chmod o-rwx /home/git/gitlab/config/database.yml 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 -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 editor /home/git/gitlab-shell/config.yml 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 assets:precompile RAILS_ENV=production service gitlab start +#+END_SRC +Set up the Apache configuration. + +#+BEGIN_SRC: bash cp lib/support/apache/gitlab /etc/apache2/sites-available/mygitlabdomain editor /etc/apache2/sites-available/mygitlabdomain +#+END_SRC Set your domain name and email accordingly. +#+BEGIN_SRC: bash a2ensite mygitlabdomain +#+END_SRC * Related projects