UbuntuϵͳÉÏÔõôװÖÃGitLab
gitlabÊÇÒ»¸ö»ùÓÚgitµÄ°æ±¾¿ØÖÆƽ̨£¬ËüÊÇʹÓÃruby on rails±à³ÌÓïÑÔ¿ª·¢µÄ×ÔÍйÜgit´æ´¢¿â¡£gitlabÌṩÁËÇ¿Ê¢µÄ´úÂëÖÎÀí¡¢´úÂëÉó²é¡¢ÎÊÌâ×·×ÙºÍÒ»Á¬¼¯³ÉµÄÄÜÁ¦¡£ÔÚ±¾ÎÄÖУ¬ÎÒÃǽ«ÏÈÈÝÔõÑùÔÚubuntu 18.04²Ù×÷ϵͳÉÏ×°ÖÃgitlab¡£
°ì·¨1 ¨C ×°ÖÃÒÀÀµ
ÔÚ×°ÖÃGitLab֮ǰ£¬ÐèÒªÏÈ×°ÖÃһЩÒÀÀµ¡£ÔËÐÐÒÔÏÂÏÂÁî×°ÖÃÒÀÀµ£º
sudo apt-get update sudo apt-get install -y curl openssh-server ca-certificates
µÇ¼ºó¸´ÖÆ
×°ÖÃÍê³Éºó£¬ÎÒÃÇÐèҪװÖÃPostfix£¬¸ÃÈí¼þÓÃÓÚÔÚGitLabÖз¢ËÍÓʼþ֪ͨ¡£
sudo apt-get install -y postfix
µÇ¼ºó¸´ÖÆ
×°ÖÃʱ´ú£¬»áµ¯³öÒ»¸ö¶Ô»°¿ò£¬ÇëÑ¡Ôñ¡°Internet Site¡±Ñ¡Ïî¡£Ëæºó£¬ÄãÐèÒªÊäÈëÄãµÄÓʼþЧÀÍÆ÷µØµã¡£
°ì·¨2 ¨C ×°ÖÃGitLab
×°ÖÃÒÀÀµÖ®ºó£¬ÐèҪʹÓÃcurlÏÂÔØ×°Öþ籾¡£ÊäÈëÒÔÏÂÏÂÁ
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
µÇ¼ºó¸´ÖÆ
×°Öþ籾ÔËÐкó£¬Ä㽫¿´µ½ÒÔÏÂÊä³ö£º
Detected operating system as ubuntu/18.04. Checking for curl... Detected curl... Running apt-get update... done. Installing apt-transport-https... done. Installing /etc/apt/sources.list.d/gitlab_gitlab-ce.list...done. Importing packagecloud gpg key... done. Running apt-get update...done. The repository is setup! You can now install packages.
µÇ¼ºó¸´ÖÆ
¾ç±¾×°ÖÃÍê³Éºó£¬¿ÉÒÔ×îÏÈÖ´ÐÐÏÖʵµÄ×°Öá£ÔËÐÐÒÔÏÂÏÂÁ
sudo apt-get install gitlab-ce
µÇ¼ºó¸´ÖÆ
×°ÖÃʱ´ú£¬Äú½«±»ÒªÇóÊäÈëеÄGitLabÖÎÀíÔ±ÃÜÂë¡£ÊäÈëºÃÃÜÂëºó£¬×°Öý«¼ÌÐø¾ÙÐС£
×°ÖÃÍê³Éºó£¬ÔËÐÐÒÔÏÂÏÂÁîÆô¶¯GitLab£º
sudo gitlab-ctl reconfigure
µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ
Íê³Éºó£¬GitLab½«ÔÚĬÈ϶˿ڣ¨80£©ÉÏÆô¶¯¡£ÈôÊÇÄúµÄЧÀÍÆ÷ÉÏÓзÀ»ðǽ£¬ÐèҪȷ±£GitLabЧÀ͵ÄÈëÕ¾ÅþÁ¬±»ÔÊÐí¡£
Õâʱ£¬Äã¿ÉÒÔ·¿ªWebä¯ÀÀÆ÷²¢»á¼ûhttp://your_server_ipµØµã£¬½«·ºÆðÈçÏÂËùʾµÄGitLabµÇ¼½çÃæ¡£
ͨ¹ýÊäÈë¸Õ¸Õ¾ÓÉÉèÖõÄGitLabÖÎÀíÔ±ÃÜÂ룬Ä㽫±»Öض¨Ïòµ½GitLabµÄ¿ØÖÆÃæ°å¡£
°ì·¨3 ¨C ÉèÖÃ
ÏÖÔÚ£¬ÎÒÃÇÒѾÀֳɵØ×°ÖÃÁËGitLab¡£½ÓÏÂÀ´£¬ÎÒÃǽ«¶ÌÔݵØÏÈÈÝһЩÉèÖÃÑ¡Ïî¡£
ĬÈÏÇéÐÎÏ£¬GitLabÉèÖÃÎļþλÓÚ/etc/gitlab/gitlab.rb¡£¿ÉÒԱ༴ËÎļþÒÔƾ֤×Ô¼ºµÄÐèÇó¸ü¸ÄÉèÖá£
ÆäÖУ¬×î³£¼ûµÄÉèÖÃÑ¡Ïî°üÀ¨£º
gitlab\_url ¨C Ö¸¶¨GitLabµÄ¹«¹²URL¡£
external\_url ¨C Ö¸¶¨GitLabʹÓõÄURL¡£
gitlab\_shell[‘git\_timeout’] ¨C Ö¸¶¨Git²Ù×÷µÄ×î´ó³¬Ê±Ê±¼ä¡£
ÔÚ±à¼ÍêÉèÖÃÎļþºó£¬ÐèÒªÖØÐÂÉèÖÃGitLabÒÔÆôÓøü¸Ä¡£ÔËÐÐÒÔÏÂÏÂÁ
sudo gitlab-ctl reconfigure
µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ
Íê³Éºó£¬ÄãµÄ¸ü¸Ä½«ÉúЧ¡£
×ܽá
ÔÚ±¾ÎÄÖУ¬ÎÒÃÇÏÈÈÝÁËÔõÑùÔÚUbuntu 18.04ÉÏ×°ÖÃGitLab¡£Õâ¸öÁ÷³Ì²¢²»ÖØ´ó£¬×·ËæÉÏÊö°ì·¨¼´¿ÉÀֳɡ£±ðµÄ£¬GitLab»¹ÌṩÁËÐí¶à¹¦Ð§ºÍÉèÖÃÑ¡ÏÒÔ±ãÄúƾ֤×Ô¼ºµÄÐèÇó¾ÙÐж¨ÖÆ¡£
ÒÔÉϾÍÊÇUbuntuϵͳÉÏÔõôװÖÃGitLabµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡