GITLAB6 Macbook pro OS X Mountain Lion 10.8.5 2013/09/30 By Jack http://prometa.seesaa.net
GitLab6 Git Git GitLab Git Git Shell Git Git GitLab6 Xcode Homebrew rbenv ruby-build Ruby Ruby on Rails icu4c MySQL Redis Git GitLab Shell GitLab charlock_holmes python2 Mac SSH Mac GitLab6 Ruby on Rails Ruby Git... brew update
Xcode Xcode MacIDE MAC App Store Xcode Xcode Xcode Xcode Preferences Downloads Command Line Tools ( ) Xcode 2
Mac MAC 3
Homebrew Homebrew Mac Unix Ruby Perl http://brew.sh WEB Install Homebrew WEB Homebrew 0.9.4 ruby -e "$(curl -fssl https://raw.github.com/mxcl/homebrew/go)" root sudo brew -v 4
rbenv ruby-build rbenv Ruby ruby-build rbenv rbenv 0.4.0 Ruby brew update brew install rbenv brew install ruby-build echo 'eval "$(rbenv init -)"' >> ~/.bash_profile. ~/.bash_profile rbenv -v 5
Ruby Ruby Ruby 2.0.0-p247 GitLab6 Ruby 1.8x rbenv install -l Ruby rbenv install 2.0.0-p247 rbenv global 2.0.0-p247 ruby -v gem install bundler bundler rbenv rehash rbenv shims Ruby 6
Ruby on Rails Rails Ruby on Rails Web Ruby on Rails Rails Ruby GitLab6 Rails gem update Ruby gem install rails --no-ri --no-rdoc rbenv rehash gem Ruby --no-ri --no-rdoc gem rdoc --all --ri Rails 4.0.0 rails -v 7
icu4c ICU 4c C Unicode / / / / icu4c GitLab6 charlock_holmes icu4c-51.1 icu4c-51.2 charlock_holmes brew update brew install icu4c brew link icu4c --force 8
MySQL MySQL Git mysql-5.6.13 5.6.13 brew update brew install mysql cd ~/Library/LaunchAgents cp /usr/local/cellar/mysql/5.6.13/homebrew.mxcl.mysql.plist. launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist 9
Redis Redis redis-2.6.16 2.6.16 brew update brew install redis cd ~/Library/LaunchAgents cp /usr/local/cellar/redis/2.6.16/homebrew.mxcl.redis.plist. launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.redis.plist 10
Git 0.9.5 Git brew update brew install git 11
Git dscl. -list /Users UniqueID sort -k 2 -n ID ID ID Git Mac ID ID git ID GroupID Git GroupID dscl. -list /Groups PrimaryGroupID sort -k 2 -n ID ID ID 500 daemon _ Git ID 1000 Git sudo dscl. -create /Groups/git PrimaryGroupID 1000 git 1000 ID UniqueID Git ID 504 Git sudo dscl. -create /Users/git UniqueID 504 sudo dscl. -create /Users/git PrimaryGroupID 1000 sudo dscl. -create /Users/git UserShell /bin/bash sudo dscl. -create /Users/git NFSHomeDirectory /Users/git sudo dscl. -create /Users/git Password "< > sudo mkdir /Users/git sudo chown -R git:git /Users/git git 504 GitLab GitLab 504 505 git gitlab chown git:git gitlab:git Git Git cd /Users/git sudo -u git vi.bash_profile vi export PATH="/usr/local/bin:$PATH" if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi bash ~/.bash_profile Git UniqueID 12
GitLab Shell GitLab Shell Git Git SSH config.yml gitlab_url: "http://0.0.0.0:3000/" repos_path: "/Users/git/repositories" auth_file: "/Users/git/.ssh/authorized_keys" cd /Users/git/gitlab GitLab bundle exec rails s -e production GitLab GitLab control+c sudo -i -u git Git cd ~ Git Home git clone https://github.com/gitlabhq/gitlab-shell.git GitLab Shell cd gitlab-shell vi /Users/git/gitlab-shell/lib/gitlab_config.rb /home/git /Users/git more VERSION VERSION 1.7.1 git checkout v1.7.1 git checkout -b v1.7.1 cp config.yml.example config.yml vi config.yml /Users/git/gitlab-shell./bin/check Check GitLab API access: OK Check directories and files: /Users/git/repositories: OK /Users/git/.ssh/authorized_keys: OK./bin/install GitLab Shell./bin/install:3: undefined method `require_relative' for main:object (NoMethodError) Ruby sudo -i -u git rbenv install 2.0.0-p247 rbenv global 2.0.0-p247 rbenv rehash./bin/install 13
MySQL MySQL GitLab CREATE DATABASE `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`; GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'gitlab'@'localhost'; GitLab quit; MySQL mysql_secure_installation Enter current password for root (enter for none): Set root password? [Y/n] Y sudo -u git -H mysql -u gitlab -p -D gitlabhq_production GitLab MySQL New password: Re-enter new password: Remove anonymous users? Y Disallow root login remotely? Y Remove test database and access to it? Y Reload privilege tables now? Y mysql -u root -p MySQL CREATE USER 'gitlab'@'localhost' IDENTIFIED BY ' '; GitLab SQL SQL SELECT User, Host FROM mysql.user; SQL DROP USER 'gitlab'@'localhost'; 14
GitLab GitLab Git sidekiq sidekiq gem sudo -i -u git cd /Users/git/gilt mkdir tmp/pids exit sudo -u git -H bundle exec rake sidekiq:start RAILS_ENV=production GitLab GitLab sudo -i -u git cd ~ git clone https://github.com/gitlabhq/gitlabhq.git giltlab GitLab mkdir /Users/git/gitlab-satellites sudo -u git -H git config --global user.name "GitLab" sudo -u git -H git config --global user.email "gitlab@localhost" sudo chown -R gitlab /Users/git/gitlab/log sudo chmod -R u+rwx /Users/git/gitlab/log sudo chown -R gitlab /Users/git/gitlab/tmp sudo chmod -R u+rwx /Users/git/gitlab/tmp sudo chown -R gitlab /Users/git/gitlab-satellites sudo chown -R gitlab /Users/git/gitlab/config/gitlab.yml sudo chown -R gitlab /Users/git/gitlab/config/unicorn.rb cp config/gitlab.yml.example config/gitlab.yml cp config/database.yml.mysql config/database.yml cp config/unicorn.rb.example config/unicorn.rb vi config/gitlab.yml user: git gitlab: host: localhost git: bin_path: /usr/bin/git satellites: /home/git/gitlab-satellites/ /Users/git/gitlab-satellites gitlab_shell: repos_path: /home/git/repositories/ /Users/git/repositories/ gitlab_shell: hooks_path: /home/git/gitlab-shell/hooks/ /Users/git/gitlab-shell/hooks/ vi config/database.yml production: username: password: MySQL gitlab host: localhost socket: /tmp/mysql.sock config/unicorn.rb sudo ln -s /usr/bin/python /usr/bin/python2 15
GitLab GitLab Git sudo su mkdir /etc/init.d cd /Users/git/gitlab sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab sudo chmod +x /etc/init.d/gitlab GitLab python2 sidekiq GitLab GitLab sudo -i -u git cd gitlab bundle install --deployment --without development test postgres gem install charlock_holmes rbenv rehash login...admin@local.host password...5ivel!fe Access denied for user 'root'@'localhost' (using password: YES) rake aborted MySQL GitLab gitlab config/database.yml username password sudo -i -u git cd /Users/git/gitlab bundle exec rake gitlab:check RAILS_ENV=production GitLab 16
SSH SSH GitLab sudo -i -u git cd /Users/git/gitlab bundle exec rails s -e production URL URL URL http://0.0.0.0:3000 SSH sudo vi /etc/sshd_config RSAAuthentication yes ubkeyauthentication yes PermitRootLogin no PermitUserEnvironment yes SSH Ruby env grep -E "^(GEM_HOME PATH RUBY_VERSION MY_RUBY_HOME GEM_PATH)=" > /var/tmp/tempenv sudo -u git -H cp /var/tmp/tempenv /Users/git/.ssh/environment SSH sudo -i -u git ssh-keygen -t rsa -C localhost cat ~/.ssh/id_rsa.pub GITLAB6 GitLab admin@local.host 5iveL!fe Welcome to GitLab! GITLAB6 id_rsa.pub Profile [ Add SSH Key ] Title ssh Key [ Add Key ] /Users/git/gitlab-shell/bin/gitlab-shell:8: undefined method `require_relative' for main:object (NoMethodError) which ruby which gem $PATH unless: command not found puts: command not found Mac Ruby Ruby Ruby SSH Mac Ruby 1.8.7 17
GitLab GITLAB6 GitLab sudo -i -u git cd /Users/git/gitlab bundle exec rails s -e production Project name is Namespace gitlab Description [ Create project ] http://0.0.0.0:3000 GITLAB6 [ New Project ] 18
GitLab GitLab Git sudo -i -u git Git cd /Users/git/repositories/root Git mkdir clone_test cd clone_test git clone git@localhost:root/sample_project.git sample_project git@localhost:root/sample_project.git GITLAB6 Jack http://prometa.seesaa.net 19