ÔõÑùʹÓÃCentOS GitLabÒ»¼ü×°ÖðüÀ´¾ÙÐÐ×°ÖÃ
ÔÚ¿ª·¢ºÍÔËάÖУ¬´úÂëÖÎÀíºÍÐ×÷ÊǼ«ÎªÖ÷ÒªµÄ»·½Ú£¬Òò´Ë£¬git³ÉΪÁË×îÊܽӴýµÄ°æ±¾¿ØÖÆϵͳ֮һ¡£¶øgitlabÊÇÒ»¸ö»ùÓÚgitµÄwebÔ´´úÂëÖÎÀíºÍ´úÂëÐ×÷¹¤¾ß£¬ËüÌṩÁËÒ»¸öÍêÕûµÄ¿ª·¢Á÷³Ì£¬°üÀ¨ÏîÄ¿ÖÎÀí¡¢´úÂëÉó²é¡¢ÎÊÌâ¸ú×ٵȹ¦Ð§¡£ÎªÁËÀû±ã¿ìËٵشgitlab£¬ÎÒÃÇ¿ÉÒÔʹÓÃcentos gitlabÒ»¼ü×°ÖðüÀ´¾ÙÐÐ×°Öá£
CentOS GitLabÒ»¼ü×°ÖðüÊÇÓÉ GitLab-cn ÉçÇøÐû²¼µÄÒ»¿î×Ô¶¯»¯¾ç±¾£¬Ëü¿ÉÒÔ¿ìËÙ×°ÖúͰ²ÅÅGitLab¡£ÏÂÃ棬ÎÒÃǽ«ÏêϸÏÈÈÝÔõÑùʹÓÃCentOS GitLabÒ»¼ü×°Öðü´î½¨GitLab¡£
ÇéÐÎ×¼±¸
ÔÚ×îÏÈ×°ÖÃ֮ǰ£¬ÎÒÃÇÐèÒªÏÈ×¼±¸ÇéÐΡ£CentOS GitLabÒ»¼ü×°ÖðüÊÊÓÃÓÚCentOS 7ºÍCentOS 8²Ù×÷ϵͳ£¬Òò´ËÎÒÃÇÐèҪȷ±£×ðÁú¿Ê±ÏµÍ³°æ±¾ÎªCentOS 7»òCentOS 8£¬²¢ÇÒÒѾװÖÃÁËGitÈí¼þ°ü¡£¿ÉÒÔͨ¹ýÒÔÏÂÏÂÁî¼ì²éÊÇ·ñÒѾװÖÃÁËGit£º
$ git --version
µÇ¼ºó¸´ÖÆ
ÈôÊÇÏÂÁîÐÐÖÐÏÔʾÁËÀàËÆÓÚ¡°git version 2.22.0¡±µÄÊä³ö£¬Ôò˵Ã÷GitÒѾ׼ȷװÖ㬲¢ÇÒ°æ±¾ºÅΪ2.22.0£¨°æ±¾ºÅ¿ÉÄÜ»áÓÐËù²î±ð£©¡£
ÏÂÔØÒ»¼ü×°Öðü
ÔÚ×¼±¸ºÃÇéÐÎÖ®ºó£¬ÎÒÃÇÐèÒªÏÂÔØCentOS GitLabÒ»¼ü×°Öðü¡£¿ÉÒÔͨ¹ýÒÔÏÂÏÂÁîÏÂÔØ×îаæµÄCentOS GitLabÒ»¼ü×°Öðü£º
$ wget https://gitlab.com/xhang/gitlab/-/raw/master/centos/gitlab-ce.sh
µÇ¼ºó¸´ÖÆ
ÏÂÔØÍê³Éºó£¬ÎÒÃÇ¿ÉÒÔͨ¹ýÒÔÏÂÏÂÁîÉó²éÏÂÔصÄGitLab×°Öðü£º
$ ls -l gitlab-ce.sh
µÇ¼ºó¸´ÖÆ
ÈôÊÇÄܹ»¿´µ½ÀàËÆÓÚ¡°-rwxr-xr-x 1 user user 1098 Jul 29 16:02 gitlab-ce.sh¡±µÄÊä³ö£¬Ôò˵Ã÷GitLab×°ÖðüÒѾÀÖ³ÉÏÂÔØ¡£
ÔËÐÐÒ»¼ü×°Öðü
ÏÂÔØCentOS GitLabÒ»¼ü×°ÖðüÖ®ºó£¬ÎÒÃÇÐèÒªÔËÐÐËüÀ´×°ÖÃGitLab¡£¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÀ´ÔËÐÐ×°Öðü£º
$ sudo bash gitlab-ce.sh
µÇ¼ºó¸´ÖÆ
ÔÚÔËÐÐ×°ÖðüµÄÀú³ÌÖУ¬»áÌáÐÑÎÒÃÇÊäÈëһЩװÖÃÐÅÏ¢£¬ÐèҪƾ֤ÏÖÕæÏàÐξÙÐÐÌîд¡£ÏÂÃæÊÇÒ»¸öÌîдʾÀý£º
Enter Gitlab Domain/IP: gitlab.example.com Install Port: 80 External URL: http://gitlab.example.com Database Password: mypassword
µÇ¼ºó¸´ÖÆ
ÆäÖУ¬¡°Gitlab Domain/IP¡±ÊÇGitLabµÄÓòÃû»òIPµØµã£¬¡°Install Port¡±ÊÇ×°Öö˿ںţ¬¡°External URL¡±ÊÇGitLabµÄÍⲿURL£¬¡°Database Password¡±ÊÇÊý¾Ý¿âÃÜÂ룬ÐèҪעÖØ°ü¹ÜÃÜÂëÇå¾²¡£
ÌîдÍê³Éºó£¬Ò»¼ü×°Öðü¾Í»á×îÏÈ×Ô¶¯×°ÖÃGitLabÁË¡£ÔÚ×°ÖÃÀú³ÌÖУ¬¿ÉÄÜ»áÌáÐÑÊäÈëһЩÐÅÏ¢»òÕßÆÚ´ý¼¸·ÖÖÓ¡£µ±×°ÖÃÍê³Éºó£¬ÎÒÃÇ¿ÉÒÔͨ¹ýä¯ÀÀÆ÷»á¼ûExternal URLÀ´»á¼û¸Õ¸Õ×°ÖõÄGitLab¡£
³£¼ûÎÊÌâ
ÔÚʹÓÃCentOS GitLabÒ»¼ü×°ÖðüµÄÀú³ÌÖУ¬¿ÉÄ᷺ܻÆðһЩÎÊÌâ¡£ÏÂÃæö¾ÙһЩ¿ÉÄܵÄÎÊÌâ¼°½â¾ö¼Æ»®£º
×°ÖðüÎÞ·¨ÔËÐÐ
ÈôÊÇÏÂÔصÄ×°ÖðüÎÞ·¨ÔËÐУ¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÐÞ¸Ä×°ÖðüµÄȨÏÞ£º
$ chmod +x gitlab-ce.sh
µÇ¼ºó¸´ÖÆ
×°ÖÃÀú³Ì¿¨×¡
ÈôÊÇ×°ÖÃÀú³ÌÒ»Ö±ÎÞ·¨Íê³É£¬¿ÉÒÔÉó²é×°ÖÃlogÎļþ£¬È·ÈÏÊÇ·ñÓйýʧÐÅÏ¢¡£logÎļþĬÈÏÉúÑÄÔÚ/var/log/gitlab-ctlĿ¼Ï£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÉó²élogÎļþ£º
$ sudo tail -f /var/log/gitlab-ctl/install.log
µÇ¼ºó¸´ÖÆ
»á¼ûGitLabʧ°Ü
ÈôÊÇÎÞ·¨»á¼ûÐÂ×°ÖõÄGitLab£¬¿ÉÒÔ¼ì²é·À»ðǽÉèÖÃÊÇ·ñ׼ȷ¡£ÐèÒª¿ª·Å×°ÖÃÀú³ÌÖÐÖ¸¶¨µÄ¶Ë¿ÚºÅºÍSSH¶Ë¿ÚºÅ£¨ÈôÊÇ¿ªÆôSSH»á¼û£©¡£
×ܽá
ͨ¹ýCentOS GitLabÒ»¼ü×°Öðü£¬ÎÒÃÇ¿ÉÒÔ¿ìËÙÀû±ãµØ´î½¨GitLab£¬²¢ÇÒ²»ÐèÒªÊÖ¶¯×°ÖúÍÉèÖÃÀú³Ì¡£GitLabÌṩÁËÒ»¸öÍêÕûµÄ¿ª·¢Á÷³Ì£¬²¢ÇÒÓµÓÐÐí¶àÓÅÒìµÄ¹¦Ð§ºÍÀ©Õ¹ÐÔ£¬ÎÞÂÛÊÇСÎÒ˽¼Ò¿ª·¢ÕßÕÕ¾ÉÆóÒµÍŶӣ¬¶¼¿ÉÒÔ´ÓÖÐÊÜÒæ¡£
ÒÔÉϾÍÊÇÔõÑùʹÓÃCentOS GitLabÒ»¼ü×°ÖðüÀ´¾ÙÐÐ×°ÖõÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡