ÔõÑùÔÚRedHatÇéÐÎÏÂ×°ÖÃGitLab
½üÄêÀ´£¬gitlab×÷Ϊһ¸ö¿ªÔ´µÄgit¿âÖÎÀí¹¤¾ß£¬Êܵ½ÁËÔ½À´Ô½¶àµÄ¹Ø×¢ºÍʹÓá£Óë github Ïà±È£¬gitlab ÓµÓиü¶àµÄ×ÔÓÉ£¬Äܹ»Öª×ãרҵ¿ª·¢Ö°Ô±µÄÐèÇ󡣶øredhat×÷Ϊһ¿îlinux²Ù×÷ϵͳ£¬Ò²ÔÚÖڶ࿪·¢ÕßµÄÐÄÄ¿ÖÐÓµÓв»¿ÉÌæ»»µÄְλ¡£½ñÌìÎÒÃǽ«ÏÈÈÝÔõÑùÔÚredhatÇéÐÎÏÂ×°ÖÃgitlab¡£
×°ÖÃÒÀÀµ
Ê×ÏÈÐèҪװÖÃһЩÐëÒªµÄ¹¤¾ßºÍ¿â£¬Èçcurl¡¢policycoreutils-pythonµÈ£º
sudo yum install curl policycoreutils-python openssh-server sudo systemctl enable sshd sudo systemctl start sshd sudo firewall-cmd --permanent --add-service=http sudo systemctl restart firewalld
µÇ¼ºó¸´ÖÆ
×°ÖÃÓʼþЧÀÍÆ÷
ΪÁËÄÜ·¢ËÍÓʼþ¸øÓû§£¬ÐèҪװÖÃÓʼþЧÀÍÆ÷£º
sudo yum install postfix sudo systemctl enable postfix sudo systemctl start postfix
µÇ¼ºó¸´ÖÆ
×°ÖÃGitLab
ͨ¹ýÏÂÁÐÏÂÁîÌí¼ÓGitLab¿ÍÕ»²¢¸üУº
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash sudo yum install gitlab-ee
µÇ¼ºó¸´ÖÆ
ÉèÖÃGitLab
×°ÖÃÍê³Éºó£¬ÐèÒª¾ÙÐÐһЩ»ù±¾µÄÉèÖá£Ê×ÏÈÐèÒªÐÞ¸Ä /etc/gitlab/gitlab.rb¡£¿ÉÒÔͨ¹ý±à¼Æ÷»òÕßÏÂÁîÐÐÐ޸ģ¬Æ¾Ö¤ÇéÐÎÑ¡ÔñÏìÓ¦µÄ·½·¨£º
sudo nano /etc/gitlab/gitlab.rb »òÕß sudo sed -i 's/external_url 'http:\/\/gitlab.example.com'/external_url 'http:\/\/yourdomain.com'/g' /etc/gitlab/gitlab.rb
µÇ¼ºó¸´ÖÆ
½« external_url ¸Ä³ÉÄã×Ô¼ºµÄGitLabµØµã¡£
½Ó×Å£¬ÐèÒªÖØÐÂÉèÖò¢Æô¶¯ GitLab£º
sudo gitlab-ctl reconfigure sudo gitlab-ctl start
µÇ¼ºó¸´ÖÆ
ÔÚÖØÐÂÉèÖÃʱ´ú¿ÉÄÜÐèҪһЩʱ¼ä£¬ÇëÄÍÐÄÆÚ´ý¡£
怬GitLab
×°Öò¢Æô¶¯GitLabÖ®ºó£¬ÐèÒªÔÚä¯ÀÀÆ÷ÉϵǼ¡£ÔÚä¯ÀÀÆ÷ÖÐÊäÈëÄãÉèÖõÄÍⲿµØµã http://yourdomain.com£¬¼´¿É¿´µ½GitLabµÄµÇ¼½çÃæ¡£µÚÒ»´Î½øÈëʱÐèÒªÉèÖÃÖÎÀíÔ±Õ˺źÍÃÜÂ룬ÉèÖúú󼴿ɵǼ²¢×îÏÈʹÓÃGitLab¡£
Óöµ½µÄÎÊÌâ
ÔÚ×°ÖÃÀú³ÌÖÐÓÐһЩ³£¼ûÎÊÌâÐèҪעÖØ£º
Q1£º×°ÖÃÀú³ÌÖп¨ÔÚ¡®Running handlers¡¯
ÕâÊÇÓÉÓÚЧÀÍÆ÷¿Õ¼ä̫СµÄÔµ¹ÊÔÓɵ¼Öµģ¬¿ÉÒÔÔÚ×°ÖÃÇ°ÏȾÙÐÐÓÅ»¯¡£
Q2£ºÎÞ·¨»á¼ûGitLabЧÀÍÆ÷
¿ÉÒÔʹÓÃcurlÏÂÁî¼ì²éGitLabЧÀÍÊÇ·ñÔËÐУ¬Ò²¿ÉÒÔ¼ì²éLinux·À»ðǽ£¬ÊÇ·ñ×èÖ¹ÁË»á¼ûGitLabЧÀÍ¡£¿ÉÒÔʹÓÃÏÂÃæÏÂÁî½â¾ö£º
sudo firewall-cmd --zone=public --permanent --add-port=80/tcp sudo firewall-cmd --zone=public --permanent --add-port=22/tcp sudo firewall-cmd --reload
µÇ¼ºó¸´ÖÆ
Q3£ºGitLabÀú³ÌÍß½â
ÓÉÓÚGitLabÀú³ÌÔËÐеÄʱ¼ä¹ý³¤£¬¿ÉÄÜ»áÓÉÓÚ¹ý¶àµÄÀú³Ìµ¼ÖÂÍ߽⡣¿ÉÒÔʹÓÃÏÂÃæÏÂÁîÖØÆôGitLab£º
sudo gitlab-ctl restart
µÇ¼ºó¸´ÖÆ
ÔÚ±¾ÎÄÖУ¬ÎÒÃÇÏÈÈÝÁËÔÚºìñ(RedHat)ÇéÐÎÏÂ×°ÖÃGitLabµÄÀú³Ì£¬²¢ÁгöÁ˳£¼ûÎÊÌâµÄ½â¾öÒªÁ졣ʹÓÃGitLab¿ÉÒÔÓÐÓõØÖÎÀí´úÂ룬ÍŶӳÉÔ±¿ÉÒÔ¸üºÃµØÏàÖú£¬Ìá¸ßÈí¼þ¿ª·¢Ð§ÂÊ¡£Í¨¹ý±¾ÆªÎÄÕµÄÏÈÈÝ£¬Ï£Íû¸÷ÈË¿ÉÒÔ¸üºÃµØʹÓÃGitLabÀ´¿ªÕ¹ÊÂÇé¡£
ÒÔÉϾÍÊÇÔõÑùÔÚRedHatÇéÐÎÏÂ×°ÖÃGitLabµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡