×ðÁú¿­Ê±¹ÙÍøµÇ¼

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ЧÀÍÆ÷£¿Ïêϸ°ì·¨·ÖÏíµÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí £¬°æȨÕùÒéÓë±¾Õ¾ÎÞ¹Ø £¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í×ðÁú¿­Ê±¹ÙÍøµÇ¼ÂËÓÍ»úÍø¹Ù·½Ì¬¶È £¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ £¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢ £¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢ £¬ÇëÄúÁ¬Ã¦ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎå £¬9:30-18:30 £¬½ÚãåÈÕÐÝÏ¢

QR code
ÍøÕ¾µØͼ