macÉÏÔõô´î½¨gitlabЧÀÍÆ÷£¿Ïêϸ°ì·¨·ÖÏí
gitlabÊÇÒ»¿îÇ¿Ê¢µÄÔ´´úÂëÖÎÀí¹¤¾ß£¬¿ÉÒÔÈÃÍŶÓÐ×÷Ô½·¢¸ßЧ¡£ÔÚmacµçÄÔÉϴgitlabЧÀÍÆ÷£¬¿ÉÒÔÈÃÍŶӳÉÔ±Ô½·¢Àû±ãµØ¾ÙÐдúÂë¹²ÏíºÍÐ×÷¡£±¾ÎĽ«ÏÈÈÝÔÚmacµçÄÔÉϴgitlabЧÀÍÆ÷µÄÏêϸ°ì·¨¡£
Ò»¡¢×°ÖÃÐëÒªµÄÈí¼þ
ÔÚMacµçÄÔÉϴGitLabЧÀÍÆ÷£¬ÐèÒªÏÈ×°ÖÃһЩÐëÒªµÄÈí¼þ¡£·¿ªÖնˣ¬Ö´ÐÐÒÔÏÂÏÂÁî×°ÖÃÐëÒªµÄÈí¼þ£º
brew install curl git-core nginx postgresql redis
µÇ¼ºó¸´ÖÆ
×°ÖÃÍê³Éºó£¬¿ÉÒÔͨ¹ýÒÔÏÂÏÂÁîÉó²éÕâЩÈí¼þÊÇ·ñÒѾ׼ȷװÖãº
curl -V git --version nginx -v psql -V redis-server --version
µÇ¼ºó¸´ÖÆ
¶þ¡¢×°ÖÃGitLab
Ö´ÐÐÒÔÏÂÏÂÁÏÂÔØGitLab×°Öðü£º
curl -LO https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-11.8.1-ce.0.el7.x86_64.rpm/download.deb
µÇ¼ºó¸´ÖÆ
×°ÖÃGitLab£º
sudo dpkg -i gitlab-ce-11.8.1-ce.0.el7.x86_64.rpm
µÇ¼ºó¸´ÖÆ
×°ÖÃÍê³Éºó£¬¿ÉÒÔͨ¹ýÒÔÏÂÏÂÁîÆô¶¯GitLab£º
sudo gitlab-ctl start
µÇ¼ºó¸´ÖÆ
Èý¡¢ÉèÖÃNginx
ƾ֤ÒÔÏ°취ÉèÖÃNginx¡£
½¨ÉèÒ»¸öеÄNginxÉèÖÃÎļþ£º
sudo nano /etc/nginx/sites-available/gitlab
µÇ¼ºó¸´ÖÆ
ÔÚеÄÉèÖÃÎļþÖУ¬Ìí¼ÓÒÔÏ´úÂ룺
upstream gitlab-workhorse { server unix:/var/opt/gitlab/gitlab-workhorse/socket fail_timeout=0; } server { listen 80; listen [::]:80; server_name your_domain.com; server_tokens off; root /opt/gitlab/embedded/service/gitlab-rails/public; client_max_body_size 500m; error_page 502 /502.html; location / { # Needed to preserve gitlab components proxy_read_timeout 300; proxy_connect_timeout 300; proxy_redirect off; # Do not buffer Git HTTP responses proxy_buffering off; proxy_http_version 1.1; # Forward all to GitLab proxy_pass http://gitlab-workhorse; # Set headers proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; } error_page 404 /404.html; error_page 422 /422.html; error_page 500 /500.html; error_page 503 /503.html; location ~ ^/(404|422|500|503)\.html$ { root /opt/gitlab/embedded/service/gitlab-rails/public; internal; } }
µÇ¼ºó¸´ÖÆ
ÉúÑIJ¢Í˳öÉèÖÃÎļþ¡£
½¨ÉèÒ»¸ö·ûºÅÁ´½Ó£º
sudo ln -s /etc/nginx/sites-available/gitlab /etc/nginx/sites-enabled/gitlab
µÇ¼ºó¸´ÖÆ
¼ì²éNginxÉèÖÃÎļþÊÇ·ñ׼ȷ£º
sudo nginx -t
µÇ¼ºó¸´ÖÆ
ÈôÊÇÏÔʾ¡°syntax is ok¡±µÈ×ÖÑù£¬Ôò˵Ã÷NginxÉèÖÃÎļþ׼ȷ¡£
ÖØÐÂÆô¶¯Nginx£º
sudo service nginx restart
µÇ¼ºó¸´ÖÆ
ËÄ¡¢½¨ÉèGitLabÖÎÀíÔ±ÕË»§
½¨ÉèÖÎÀíÔ±ÕË»§¿ÉÒÔÈÃÄã¸üºÃµØÖÎÀíGitLabЧÀÍÆ÷¡£
·¿ªä¯ÀÀÆ÷£¬ÊäÈëÄãµÄЧÀÍÆ÷µÄIPµØµã»òÓòÃû£¬²¢»á¼ûGitLabµÄÍøÕ¾¡£
½¨ÉèÖÎÀíÔ±ÕË»§£¬ÊäÈëÓû§ÃûºÍÃÜÂ룬²¢µã»÷Ìá½»°´Å¥¡£
µã»÷¡°½¨ÉèÏîÄ¿¡±°´Å¥£¬½¨ÉèÒ»¸öеÄÏîÄ¿¡£
ÏÖÔÚ£¬ÄãÒѾÀÖ³ÉÔÚMacµçÄÔÉϴÁËGitLabЧÀÍÆ÷£¬¿ÉÒÔÈÃÄãµÄÍŶÓÔ½·¢¸ßЧµØ¾ÙÐдúÂë¹²ÏíºÍÐ×÷¡£
ÒÔÉϾÍÊÇmacÉÏÔõô´î½¨gitlabЧÀÍÆ÷£¿Ïêϸ°ì·¨·ÖÏíµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡