ÔõôÔÚUbuntuϵͳÉÏ×°ÖÃGitLab
ubuntu gitlab×°ÖÃ
GitLabÊÇÒ»¸ö»ùÓÚWebµÄGit¿ÍÕ»ÖÎÀí¹¤¾ß£¬¿ÉÒÔÌṩ´úÂë¿ÍÕ»¡¢´úÂëÉóºË¡¢ÎÊÌâ¸ú×Ù¡¢CI/CD¡¢WikiµÈ¹¦Ð§¡£ËüÊÇÒ»¸ö×ÔÍйܵÄGit¿ÍÕ»£¬¿ÉÒÔÔÚÔÆƽ̨»òÍâµØ×°ÖÃÀ´ÖÎÀí×Ô¼ºµÄ´úÂë¡£
±¾ÎĽ«Îª¸÷ÈËÏÈÈÝÔÚUbuntuϵͳÉÏ×°ÖÃGitLabµÄÏêϸ°ì·¨¡£
Ò»¡¢×°ÖÃÒÀÀµ
ÔÚ×°ÖÃGitLab֮ǰ£¬ÐèҪװÖÃһЩÒÀÀµ°ü¡£·¿ªÖն˲¢ÔËÐÐÒÔÏÂÏÂÁ
sudo apt-get update
sudo apt-get install -y curl openssh-server ca-certificates postfix
×°ÖÃÀú³ÌÖУ¬ÐèÒªÉèÖÃÓʼþЧÀÍÆ÷µÄÉèÖ᣽¨ÒéÑ¡Ôñ¡°Internet Site¡±ÉèÖá£
¶þ¡¢×°ÖÃGitLab
1.Ìí¼ÓGitLab¿ÍÕ»
ÔÚÏÂÁîÐÐÖÐÌí¼ÓGitLab¿ÍÕ»£º
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
2.×°ÖÃGitLab
ÏÖÔÚ£¬Í¨¹ýÔËÐÐÒÔÏÂÏÂÁîÀ´×°ÖÃGitLab£º
sudo apt-get install gitlab-ce
×°ÖÃÀú³Ì¿ÉÄÜÐèÒªÒ»¶Îʱ¼ä£¬ÇëÄÍÐÄÆÚ´ý¡£
3.ÉèÖÃGitLab
×°ÖÃÍê³Éºó£¬¿ÉÒÔͨ¹ýÒÔÏÂÏÂÁîÆô¶¯GitLab£º
sudo gitlab-ctl reconfigure
Æô¶¯ºó£¬¿ÉÒÔͨ¹ýä¯ÀÀÆ÷»á¼ûhttp://localhost»á¼ûGitLab¡£
Èý¡¢ÉèÖÃGitLab
1.¸ü¸ÄÖÎÀíÔ±ÃÜÂë
·¿ªä¯ÀÀÆ÷²¢»á¼ûhttp://localhost¡£ÊäÈë³õʼÖÎÀíÔ±Óû§ÃûrootºÍÃÜÂë5iveL!fe¡£
µÚÒ»´ÎµÇ¼ºó£¬GitLab½«ÒªÇó¸ü¸ÄÃÜÂë¡£
2.Ìí¼ÓSSHÃÜÔ¿
Òª½«ÍâµØ´úÂëÉÏ´«µ½GitLab£¬ÇëÌí¼ÓSSHÃÜÔ¿¡£
ÔÚÍâµØÅÌËã»úÉÏ·¿ªÖնˡ£ÈôÊÇÄúÒѾÓÐSSHÃÜÔ¿¶Ô£¬ÇëÌø¹ý´Ë°ì·¨¡£²»È»£¬ÌìÉúSSHÃÜÔ¿¶Ô£º
ssh-keygen -t rsa -C “youremail@example.com”
½«¡°youremail@example.com¡±Ì滻ΪÄúµÄµç×ÓÓʼþµØµã¡£
½ÓÏÂÀ´£¬½«SSHÃÜÔ¿Ìí¼Óµ½GitLab¡£ÔÚGitLabÖУ¬µ¥»÷Ò³ÃæÓÒÉϽǵÄͼ±ê£¬È»ºóµ¥»÷¡°Settings¡±°´Å¥¡£
ÔÚ¡°Settings¡±Ò³ÃæÉÏ£¬Ñ¡Ôñ¡°SSH Keys¡±Ñ¡Ï¡£
½«¹«Ô¿¸´ÖƵ½Îı¾¿òÖС£
Òª²âÊÔÅþÁ¬£¬¿ÉÒÔ´ÓÖÕ¶ËÉÏÔËÐÐÒÔÏÂÏÂÁ
ssh -T git@localhost
ËÄ¡¢½¨ÉèÏîÄ¿
ÏÖÔÚ£¬¿ÉÒÔÔÚGitLabÖн¨ÉèÐÂÏîÄ¿¡£
µ¥»÷Ò³Ãæ×ó²à²Ëµ¥Öеġ°Projects¡±Ñ¡Ï¡£ÔÚ¡°Projects¡±Ò³ÃæÉÏ£¬µ¥»÷¡°New Project¡±°´Å¥¡£
ÊäÈëÏîÄ¿Ãû³ÆºÍÏîÄ¿ÐÎò¡£Ñ¡Ôñ´æ´¢¿â¿É¼ûÐÔÉèÖá£
µã»÷¡°Create project¡±°´Å¥¡£
ÏÖÔÚ£¬¿ÉÒÔ½«ÍâµØ´úÂëÍÆË͵½GitLabÖС£
Îå¡¢×ܽá
ÒÔÉϾÍÊÇÔÚUbuntuϵͳÉÏ×°ÖÃGitLabµÄÏêϸ°ì·¨¡£Í¨¹ýGitLab£¬¿ÉÒÔÀû±ãµØÖÎÀíºÍ¿ØÖÆ×Ô¼ºµÄ´úÂ룬°üÀ¨°æ±¾¿ØÖÆ¡¢ºÏ²¢ÇëÇó¡¢CI/CDµÈ¡£ÔھۺϿª·¢ÖУ¬GitLabÒ²ÊÇÒ»¸öºÜÊÇÊ¢ÐеŤ¾ß£¬¿ÉÒÔ×ÊÖúÍŶÓÖÎÀí´úÂ룬Ìá¸ßÉú²úЧÂÊ¡£
ÒÔÉϾÍÊÇÔõôÔÚUbuntuϵͳÉÏ×°ÖÃGitLabµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡