Actualités
GITLAB et RBENV Round 1 |
---|
Ecrit par e2ly | 2014-01-10 19:33:56 |
Ce tutoriel a été testé sur Ubuntu 12.04 (mais il n'y a pas de raison que ce soit différent pour une ubuntu 13.xx 14.xx)
apt-get update apt-get install python-software-properties add-apt-repository ppa:git-core/ppa apt-get update apt-get install git
apt-get install zlib1g-dev openssl libopenssl-ruby1.9.1 libssl-dev libicu48 libicu-dev libxml2 libxml2-dev libxslt1-dev libxslt1.1 redis-server
adduser --disabled-login --gecos 'GitLab' git
su - git git clone git://github.com/sstephenson/rbenv.git .rbenv mv ~/.bashrc ~/.bashrc.old echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc echo 'eval "$(rbenv init -)"' >> ~/.bashrc cat ~/.bashrc.old >> ~/.bashrc exec $SHELL mkdir -p ~/.rbenv/plugins cd ~/.rbenv/plugins git clone git://github.com/sstephenson/ruby-build.git rbenv install 2.1.0 rbenv rehash rbenv global 2.1.0 gem install bundler --no-ri --no-rdoc # gem install bundle # to validate if needed
cd git clone https://gitlab.com/gitlab-org/gitlab-shell.git -b v1.8.0 cd gitlab-shell sed -e "s/localhost/$(hostname -f)/g" config.yml.example > config.yml ./bin/install
# W user root exit mysql -u root -p -e " CREATE USER 'git'@'localhost' IDENTIFIED BY 'MY_PASSWORD'; 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'; "
su - git # take latest commit because 6.4 bug with gon 5.0.0 (5.0.1 is working) git clone https://gitlab.com/gitlab-org/gitlab-ce.git gitlab cd /home/git/gitlab sed -e "s/host: localhost/host: $(hostname -f)/g" / -e "s/enabled: true/enabled: false/g" config/gitlab.yml.example > config/gitlab.yml mkdir /home/git/gitlab-satellites /home/git/gitlab/tmp/pids/ /home/git/gitlab/tmp/sockets/ /home/git/gitlab/public/uploads cp /home/git/gitlab/config/unicorn.rb.example /home/git/gitlab/config/unicorn.rb cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb cp config/database.yml.mysql config/database.yml chmod o-rwx config/database.yml bundle install --no-deployment --without development test postgres aws bundle exec rake gitlab:setup RAILS_ENV=production
# Get Login # login.........admin@local.host # password......QSDAZeqsd
# W user root exit cp /home/git/gitlab/lib/support/init.d/gitlab /etc/init.d/gitlab cp /home/git/gitlab/lib/support/init.d/gitlab.default.example /etc/default/gitlab update-rc.d gitlab defaults 21 cp /home/git/gitlab/lib/support/logrotate/gitlab /etc/logrotate.d/gitlab
echo 'export PATH="/home/${app_user}/.rbenv/bin:$PATH" eval "$(rbenv init -)"' >> /etc/default/gitlab
su - git cd gitlab # Check bundle exec rake gitlab:env:info RAILS_ENV=production bundle exec rake assets:precompile RAILS_ENV=production
# W user root exit apt-get install -y nginx sed -e "s/YOUR_SERVER_FQDN/$(hostname -f)/g" /home/git/gitlab/lib/support/nginx/gitlab > /etc/nginx/sites-available/gitlab ln -s /etc/nginx/sites-available/gitlab /etc/nginx/sites-enabled/gitlab vim /etc/nginx/sites-available/gitlab service nginx restart
mv /home/git/gitlab-shell/hooks{,.rb}
#!/bin/bash export PATH="$HOME/.rbenv/bin:$PATH" eval "$(rbenv init -)" $HOME/gitlab-shell/hooks/update.rb $* Et voilà, un beau GitLab chez vous ! Source : |
Commentaires
Aucun commentaire |