ÉîÎöÔõÑù×°ÖÃGitLab
gitlabÊÇÒ»¿î¿ªÔ´µÄ´úÂëÍйÜƽ̨£¬ËüÌṩÁË»ùÓÚwebµÄgit¿ÍÕ»ÖÎÀí¹¦Ð§£¬ÒÔ¼°Ðí¶àÐ×÷¹¤¾ßºÍ×Ô¶¯»¯Á÷³Ì¡£ÔÚ±¾ÎÄÖУ¬ÎÒÃǽ«ÏÈÈÝÔõÑù×°ÖÃgitlab¡£
×¼±¸ÊÂÇ飺
ÔÚ×îÏÈ×°ÖÃGitLab֮ǰ£¬ÐèҪȷ±£ÄúµÄЧÀÍÆ÷Öª×ãÒÔÏÂÒªÇó£º
64λ²Ù×÷ϵͳ
ÖÁÉÙ4GBÄڴ棬×îºÃ8GB¼°ÒÔÉÏ
2¸öCPU½¹µã
20 GB¿ÉÓô洢¿Õ¼ä
×°ÖÃDockerºÍDocker Compose£º
GitLabÌṩÁËDocker¾µÏñÀ´¼ò»¯×°ÖÃÀú³Ì¡£Ê×ÏÈ£¬ÄúÐèÒªÔÚÄúµÄЧÀÍÆ÷ÉÏ×°ÖÃDockerºÍDocker Compose¡£
ÔÚUbuntuÉÏ£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÀ´×°ÖÃDocker£º
sudo apt-get update sudo apt-get install docker.io
µÇ¼ºó¸´ÖÆ
×°ÖÃÍê³Éºó£¬Äú¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÀ´×°ÖÃDocker Compose£º
sudo apt-get install docker-compose
µÇ¼ºó¸´ÖÆ
×°ÖÃGitLab£º
Ò»µ©DockerºÍDocker ComposeÒÑ×°Öõ½ÄúµÄϵͳÉÏ£¬½ÓÏÂÀ´¾Í¿ÉÒÔ×îÏÈ×°ÖÃGitLab¡£
ÒÔÏÂÊÇ×°Öð취£º
ÔÚÄúµÄЧÀÍÆ÷ÉϽ¨ÉèÒ»¸öĿ¼ÒÔÉúÑÄGitLabµÄÉèÖÃÎļþ£º
sudo mkdir -p /var/opt/gitlab
µÇ¼ºó¸´ÖÆ
½¨ÉèÒ»¸ödocker-compose.ymlÎļþ£¬²¢Â¼ÈëÒÔÏÂÄÚÈÝ£º
version: '3' services: web: image: 'gitlab/gitlab-ce:latest' restart: always hostname: 'ubuntu.yourdomain.com' environment: GITLAB_OMNIBUS_CONFIG: | external_url 'http://ubuntu.yourdomain.com' gitlab_rails['gitlab_shell_ssh_port'] = 2224 ports: - '80:80' - '443:443' - '2224:22' volumes: - '/var/opt/gitlab:/var/opt/gitlab' - '/var/opt/gitlab/config:/etc/gitlab' - '/var/opt/gitlab/logs:/var/log/gitlab'
µÇ¼ºó¸´ÖÆ
Çë×¢ÖØ£ºÔÚ½«ÉÏÊöÉèÖÃÎļþ¸´ÖƵ½ÄúµÄЧÀÍÆ÷֮ǰ£¬ÄúÓ¦¸Ã½«’ubuntu.yourdomain.com’»»³ÉÄú×Ô¼ºµÄÓòÃû»òIPµØµã¡£
ÔËÐÐÒÔÏÂÏÂÁîÀ´Æô¶¯GitLab£º
sudo docker-compose up -d
µÇ¼ºó¸´ÖÆ
Õ⽫Æô¶¯GitLabÈÝÆ÷¡£Äú¿ÉÒÔʹÓÃÒÔÏÂÏÂÁî¼ì²éÈÝÆ÷ÊÇ·ñÔÚÔËÐУº
sudo docker ps
µÇ¼ºó¸´ÖÆ
»á¼ûGitLabµÄWeb½çÃ棺
»á¼ûÄúµÄGitLab×°ÖÃËùÔÚµÄÓòÃû»òIPµØµã¡£ÔÚÊ״λá¼ûʱ£¬ÄúÐèÒªÉèÖÃÖÎÀíÔ±Óû§µÄÓû§ÃûºÍÃÜÂë¡£
ÉèÖÃSMTP£º
ÔÚGitLabµÄÖÎÀí½çÃæÖУ¬µ¥»÷¡°ÖÎÀíÔ±ÇøÓò¡±>¡°ÉèÖá±>¡°ÍøÂ硱>¡°³öÕ¾SMTPЧÀÍÆ÷¡±¡£
ÉèÖÃÄúµÄSMTPЧÀÍÆ÷µÄÏêϸÐÅÏ¢£¬È»ºóµ¥»÷¡°²âÊÔSMTPÉèÖá±À´²âÊÔÊÇ·ñÕý³£ÊÂÇé¡£
ÏÖÔÚ£¬ÄúÒѾÀÖ³É×°ÖÃÁËGitLab²¢ÉèÖúÃÁËSMTPЧÀÍÆ÷£¬ÔÚ¸Ãƽ̨ÉϾÙÐдúÂëÖÎÀíºÍÐ×÷¡£
×ܽ᣺
ÕâƪÎÄÕÂÏÈÈÝÁËÔÚUbuntuÉÏ×°ÖÃGitLabµÄÀú³Ì¡£Ê¹ÓÃDockerÈÝÆ÷¿ÉÒÔʹװÖÃÀú³Ì±äµÃÔ½·¢¼òÆӺͿɿ¿¡£Í¨¹ýÕâ¸ö°ì·¨£¬Äú¿ÉÒÔÔÚЧÀÍÆ÷ÉϽ¨ÉèÒ»¸ö´øÓÐGit¿ÍÕ»ÖÎÀí¹¦Ð§µÄ´úÂëÍйÜƽ̨¡£
ÒÔÉϾÍÊÇÉîÎöÔõÑù×°ÖÃGitLabµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡