ubuntuÔõô´î½¨gitlab
ubuntu´î½¨gitlab
GitLabÊÇÒ»¸öºÜÊÇÊ¢ÐеĿªÔ´´úÂëÍйÜƽ̨¡£ËüÌṩÁËÀû±ãµÄÍŶÓÐ×÷ºÍ°æ±¾¿ØÖƹ¦Ð§£¬Äܹ»¼«´óµØÌá¸ß¿ª·¢ÍŶӵÄÊÂÇéЧÂÊ¡£±¾ÎĽ«ÏÈÈÝÔõÑùÔÚUbuntu²Ù×÷ϵͳÉϴGitLab¡£
×°ÖÃÐëÒªµÄÈí¼þºÍÒÀÀµ
ÔÚ×îÏȴGitLab֮ǰ£¬ÐèÒªÏÈ×°ÖÃһЩÐëÒªµÄÈí¼þºÍÒÀÀµ¡£·¿ªÖն˲¢Ö´ÐÐÒÔÏÂÏÂÁ
sudo apt-get update
sudo apt-get install -y curl openssh-server ca-certificates
sudo apt-get install -y postfix
ÔÚ×°ÖÃPostfixʱ£¬Äú¿ÉÄÜÐèҪƾ֤Äú×Ô¼ºµÄÒªÇóÉèÖÃһЩÉèÖá£ÀýÈ磬ÈôÊÇÄúÏëʹÓÃSMTPЧÀÍÆ÷·¢Ë͵ç×ÓÓʼþ£¬ÔòÐèҪѡÔñ¡°Internet Site¡±Ñ¡Ïî¡£
×°ÖÃGitLab
ÔÚÍê³ÉÐëÒªÈí¼þºÍÒÀÀµÏîµÄ×°Öúó£¬Äú¿ÉÒÔ×îÏÈ×°ÖÃGitLab¡£ÒÔÏÂÊÇ×°ÖÃGitLabµÄ°ì·¨£º
2.1 Ìí¼ÓGitLabÈí¼þÔ´
Ê×ÏÈ£¬ÄúÐèÒª½«GitLabÈí¼þÔ´Ìí¼Óµ½ÄúµÄϵͳÖС£Ö´ÐÐÒÔÏÂÏÂÁ
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | sudo bash
2.2 ×°ÖÃGitLab
Ìí¼ÓÈí¼þÔ´ºó£¬ÏÖÔÚ¿ÉÒÔ×îÏÈ×°ÖÃGitLab¡£Ö´ÐÐÒÔÏÂÏÂÁ
sudo apt-get install gitlab-ee
Õ⽫װÖÃGitLab Enterprise Edition¡£Æ¾Ö¤ÄúµÄÐèÇóÑ¡ÔñÊʵ±µÄ°æ±¾¡£
ÉèÖÃGitLab
ÔÚ×°ÖÃGitLabÖ®ºó£¬ÄúÐèÒª¶ÔÆä¾ÙÐÐһЩÉèÖá£ÒÔÏÂÊÇһЩ³£¼ûµÄÉèÖÃÑ¡Ïî¡£
3.1 ÉèÖÃÓòÃûºÍ¶Ë¿Ú
ĬÈÏÇéÐÎÏ£¬GitLabÔÚ80¶Ë¿ÚÉÏÔËÐС£ÈôÊÇÄúÏë¸ü¸Ä¶Ë¿Ú»òÉèÖÃGitLabʹÓÃ×Ô½ç˵ÓòÃû£¬ÔòÐèÒª¾ÙÐÐÏìÓ¦µÄÉèÖᣱà¼ÒÔÏÂÎļþÒÔÉèÖÃÕâЩѡÏ
sudo nano /etc/gitlab/gitlab.rb
Äú¿ÉÒÔ½«¡°external_url¡±ÉèÖÃΪÄúµÄ×Ô½ç˵ÍøÖ·£¬ÀýÈç¡°http://gitlab.example.com¡±¡£Äú»¹¿ÉÒÔ½«¶Ë¿ÚÉèÖÃΪÆäËû¶Ë¿Ú£¬ÀýÈç8080¡£Íê³ÉÉèÖúó£¬ÔËÐÐÒÔÏÂÏÂÁîÒÔÖØÐÂÉèÖÃGitLab£º
sudo gitlab-ctl reconfigure
3.2 ÉèÖÃÖÎÀíÔ±ÕË»§
ĬÈÏÇéÐÎÏ£¬GitLab»áÒªÇóÄú½¨ÉèÒ»¸öÖÎÀíÔ±ÕË»§¡£ÄúÐèÒªÖ¸¶¨ÖÎÀíÔ±ÕË»§µÄÓû§ÃûºÍÃÜÂë¡£ÔÚÊ״εǼʱ£¬Äú½«ÐèҪʹÓÃÖÎÀíÔ±ÕË»§µÇ¼GitLab¡£
3.3 ÉèÖÃSMTPЧÀÍÆ÷
ÈôÊÇÄúÏëʹÓÃSMTPЧÀÍÆ÷·¢Ë͵ç×ÓÓʼþ£¬ÔòÐèÒªÔÚGitLabÖÐÉèÖÃSMTPЧÀÍÆ÷¡£±à¼ÒÔÏÂÎļþÒÔÉèÖÃSMTPЧÀÍÆ÷£º
sudo nano /etc/gitlab/gitlab.rb
ÔÚÎļþÖÐÌí¼ÓÒÔÏÂÉèÖãº
gitlab_rails[‘smtp_enable’] = true
gitlab_rails[‘smtp_address’] = “smtp.server”
gitlab_rails[‘smtp_port’] = 465
gitlab_rails[‘smtp_user_name’] = “smtp_user”
gitlab_rails[‘smtp_password’] = “smtp_password”
gitlab_rails[‘smtp_domain’] = “smtp.example.com¡±
gitlab_rails[‘smtp_authentication’] = “login”
gitlab_rails[‘smtp_enable_starttls_auto’] = true
gitlab_rails[‘smtp_tls’] = true
Íê³ÉÉèÖúó£¬ÔËÐÐÒÔÏÂÏÂÁîÒÔÖØÐÂÉèÖÃGitLab£º
sudo gitlab-ctl reconfigure
»á¼ûGitLab
ÏÖÔÚÄú¿ÉÒÔ»á¼ûGitLab²¢×îÏÈÍйܴúÂëÁË¡£ÔÚä¯ÀÀÆ÷ÖÐÊäÈëÄúµÄÓòÃû»òIPµØµã£¬È»ºó°´Enter¼ü¡£ÈôÊÇÒ»ÇÐ˳Ë죬Äú½«¿´µ½GitLab½Ó´ýÒ³Ãæ¡£Äú¿ÉÒÔʹÓÃÖÎÀíÔ±ÕË»§µÇ¼GitLab£¬²¢×îÏȽ¨ÉèºÍÖÎÀíÏîÄ¿¡£
×ܽá
ÔÚUbuntu²Ù×÷ϵͳÉϴGitLabÊÇÒ»ÏîÏà¶Ô¼òÆÓµÄÊÂÇ顣ͨ¹ý¼¸¸ö¼òÆӵİ취£¬Äú¾Í¿ÉÒԴһ¸ö¸ßЧµÄ´úÂëÍйÜƽ̨£¬²¢ÈÃÄúµÄÍŶÓÔ½·¢¸ßЧµØÐ×÷ºÍ¿ª·¢¡£
ÒÔÉϾÍÊÇubuntuÔõô´î½¨gitlabµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡