×ðÁú¿­Ê±¹ÙÍøµÇ¼

ÁÄÁÄgitlab´î½¨ÓëʹÓÃ

Ëæ×ÅÈí¼þ¿ª·¢µÄ¿ìËÙÉú³¤ £¬ÎÒÃÇÔÚ¿ª·¢Àú³ÌÖеĴúÂëЭͬºÍ°æ±¾ÖÎÀíÔ½À´Ô½Ö÷Òª¡£gitÊÇÏÖÔÚ×îÖ÷Á÷ºÍ×îÊ¢Ðеİ汾¿ØÖÆϵͳ֮һ¡£gitlab¾ÍÊÇ»ùÓÚgitµÄÒ»¸öºÜÊÇÇ¿Ê¢µÄÔ´´úÂëÖÎÀí¹¤¾ß £¬Ëü¾ßÓÐÐí¶àÆæÒìµÄÌØÕ÷ £¬È縻ºñµÄ¹¦Ð§ £¬Ò×ÓÚʹÓõÈ¡£±¾ÎĽ«ÏòÄúÏÈÈÝgitlabµÄ´î½¨ÓëʹÓá£

Ò»¡¢GitLab¸ÅÊö

GitLabÊÇÒ»¸ö¿ªÔ´´úÂëÍйܺÍЭ×÷ƽ̨ £¬Ëü¿ÉÒÔ×ÊÖúÎÒÃǸüºÃµØÖÎÀí´úÂë £¬ÊµÏÖÒ»¸öÕæÕýµÄDevOpsƽ̨¡£Ëü¿ÉÒÔÔÚÍâµØ»òÔƶËÔËÐÐ £¬ÌṩǿʢµÄÔ´´úÂëÖÎÀí¡¢CI / CD×Ô¶¯»¯¡¢´úÂëÉó²éºÍÎó²î¼ì²âµÈ¹¦Ð§¡£Í¨¹ýʹÓÃGitLab £¬ÍŶӿÉÒÔÇáËɵؾÙÐдúÂë¹²ÏíºÍЭ×÷ £¬´Ó¶øÌá¸ßÕû¸öÍŶӵÄÊÂÇéЧÂʺʹúÂëÖÊÁ¿¡£

¶þ¡¢GitLabÔõÑù´î½¨

×¼±¸ÊÂÇé

ÔÚ×îÏÈ×°ÖÃGitLab֮ǰ £¬ÄúÐèҪȷ±£²Ù×÷ϵͳÉÏÒÑ×°ÖÃDockerºÍDocker Compose¡£DockerÊÇÒ»¸ö¿ªÔ´µÄƽ̨ £¬¿ÉÒÔ×ÊÖúÎÒÃǹ¹½¨¡¢Ðû²¼ºÍÔËÐÐÓ¦ÓóÌÐò¡£¶øDocker ComposeÊÇDockerµÄÉèÖù¤¾ß £¬¿ÉÒÔ×ÊÖúÎÒÃÇÀû±ãµØ½ç˵ºÍÔËÐжà¸öDockerÈÝÆ÷¡£

»ñÈ¡GitLab×°Öðü

Äú¿ÉÒÔ´ÓDocker Store»ñÈ¡×îа汾µÄGitLab×°Öðü¡£ÇëÈ·±£Ñ¡ÔñÊÊÓÃÓÚÄú²Ù×÷ϵͳµÄ°æ±¾¡£

ÏÂÔØ×°Öðü

ʹÓÃDocker Compose½¨ÉèÒ»¸ö°üÀ¨GitLabµÄDockerÈÝÆ÷¡£ÔËÐÐÒÔÏÂÏÂÁ

mkdir -p /srv/gitlab/config /srv/gitlab/data /srv/gitlab/logs
cd /srv/gitlab/
touch docker-compose.yml

µÇ¼ºó¸´ÖÆ

ÔÚdocker-compose.ymlµÄÎļþÖÐÌí¼ÓÒÔÏÂÄÚÈÝ£º

version: '3'
services:
  web:
    image: 'gitlab/gitlab-ce:latest'
    restart: always
    hostname: 'gitlab.example.com'
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'http://gitlab.example.com'
        nginx['listen_port'] = 80
        nginx['listen_https'] = false
        gitlab_rails['gitlab_shell_ssh_port'] = 2224
    ports:
      - '80:80'
      - '443:443'
      - '2224:22'
    volumes:
      - '/srv/gitlab/config:/etc/gitlab'
      - '/srv/gitlab/logs:/var/log/gitlab'
      - '/srv/gitlab/data:/var/opt/gitlab'

µÇ¼ºó¸´ÖÆ

´Ë´¦ £¬ÄúÐèÒª½«hostnameÃüÃûΪÄúÏëҪʹÓõÄGitLabÖ÷»úÃû¡£±ðµÄ £¬½«external_url×÷ΪGitLabµÄURL£¨ÔÚ´ËʾÀýÖÐ £¬¡°http£º// gitlab.example.com¡±£©¡£

Æô¶¯ÈÝÆ÷

ʹÓÃÒÔÏÂÏÂÁîÀ´Æô¶¯ÈÝÆ÷£º

docker-compose up -d

µÇ¼ºó¸´ÖÆ

»á¼ûGitLab

GitLabÒѾ­Àֳɵذ²ÅÅÔÚÄúµÄЧÀÍÆ÷ÉÏÁË¡£Äú¿ÉÒÔͨ¹ýä¯ÀÀÆ÷»á¼ûhttp£º//gitlab.example.com £¬Ê¹ÓÃĬÈÏÖÎÀíÔ±Óû§Ãû¡°root¡±ºÍÃÜÂë¡°5iveL!fe¡±µÇ¼¡£

Èý¡¢GitLabÔõÑùʹÓÃ

ÔÚGitLabÖÐ £¬Äú¿ÉÒÔ½¨ÉèÒ»¸öÏîÄ¿ £¬Ìí¼Ó³ÉÔ± £¬ÖÎÀí´æ´¢¿âµÈµÈ¡£ÏÂÃ潫¼òÆÓÏÈÈÝGitLabµÄһЩÖ÷Òª¹¦Ð§¡£

½¨ÉèÏîÄ¿

µ¥»÷¡°ÐÂÏîÄ¿¡±°´Å¥ £¬Äú½«±»´øµ½ÏîÄ¿½¨ÉèÒ³Ãæ¡£ÔÚÏîÄ¿½¨ÉèÒ³ÃæÖÐ £¬Äú¿ÉÒÔÊäÈëÏîÄ¿µÄÃû³Æ¡¢ÐÎòºÍ»á¼û¼¶±ðµÈÐÅÏ¢¡£Ñ¡Ôñ¡°½¨ÉèÏîÄ¿¡±°´Å¥ £¬GitLab½«ÎªÄú½¨ÉèÒ»¸öÏîÄ¿¡£

Ìí¼Ó³ÉÔ±

ÔÚÏîÄ¿Ò³ÃæµÄ×ó²à²Ëµ¥ÖÐÑ¡Ôñ¡°³ÉÔ±¡± £¬Äú¿ÉÒÔÌí¼Ó¡¢±à¼­¡¢ÒƳýÏîÄ¿³ÉÔ±¡£¹ØÓÚÿ¸ö³ÉÔ± £¬Äú¿ÉÒÔÉèÖÃÆä½ÇÉ«ºÍȨÏÞ¡£

ÖÎÀí´æ´¢¿â

ÔÚÏîÄ¿Ò³Ã涥²¿ £¬Äú½«¿´µ½Ò»¸ö´æ´¢¿âURL¡£Äú¿ÉÒÔʹÓôËURLÀ´½«ÏîÄ¿¿Ë¡µ½ÄúµÄÍâµØÅÌËã»úÖС£Äú¿ÉÒÔʹÓÃGitLabÌṩµÄWeb½çÃæÀ´ÖÎÀí´æ´¢¿âµÄÄÚÈÝ £¬Ò²¿ÉÒÔʹÓÃGit CLI£¨ÏÂÁîÐнçÃ棩¾ÙÐÐÍâµØµ÷½â¡£GitLabÖ§³ÖÖÖÖÖ°æ±¾¿ØÖƲÙ×÷ £¬ÈçÌá½»½ÓÂë¡¢ºÏ²¢ÇëÇóµÈµÈ¡£

CI / CD×Ô¶¯»¯

GitLab»¹ÌṩÁËÇ¿Ê¢µÄCI / CD×Ô¶¯»¯¹¦Ð§¡£Ñ¡ÔñÏîÄ¿Ò³ÃæÉÏ·½µÄCI / CD²Ëµ¥ £¬Äú¿ÉÒÔÉèÖÃÒ»¸ö¹ÜµÀÒÔÉèÖÃ×Ô¶¯»¯ÊÂÇéÁ÷¡£Í¨¹ýÉèÖÃÕâЩÊÂÇéÁ÷ £¬Äú¿ÉÒÔ×Ô¶¯»¯¹¹½¨¡¢²âÊԺͰ²ÅÅÓ¦ÓóÌÐò¡£

´úÂëÉó²éºÍÎó²î¼ì²â

½èÖúÄÚÖõĴúÂëÉó²é¹¤¾ß £¬Äú¿ÉÒÔÇáËɵØÉó²éÍŶӳÉÔ±Ìá½»µÄ´úÂë¡£±ðµÄ £¬GitLab»¹ÌṩÎó²î¼ì²âºÍÇå¾²ÆÊÎö¹¤¾ß £¬¿ÉÒÔ×ÊÖúÄúÇáËɼì²âÏ¢Õù¾öDZÔÚµÄÇå¾²ÎÊÌâ¡£

ËÄ¡¢×ܽá

ͨ¹ý±¾ÎÄ £¬ÄúÓ¦¸Ã¶ÔGitLabµÄ´î½¨ºÍʹÓÃÓÐÁ˸üÉîÈëµÄÏàʶ¡£Äú¿ÉÒÔʹÓÃDocker¿ìËÙ°²ÅÅGitLab £¬²¢×îÏÈÔÚÍŶÓÖÐʹÓÃËü¾ÙÐдúÂëЭ×÷ºÍÖÎÀí¡£²»µ«ÔÆÔÆ £¬Äú»¹¿ÉÒÔÔÚGitLabÖÐÉèÖÃ×Ô¶¯CI / CD¹ÜµÀ £¬Ê¹ÓÃÆäÄÚÖõÄÉó²é¹¤¾ßºÍÎó²î¼ì²â¹¤¾ßÀ´Ìá¸ß´úÂëµÄÖÊÁ¿ºÍÇå¾²ÐÔ¡£

ÒÔÉϾÍÊÇÁÄÁÄgitlab´î½¨ÓëʹÓõÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí £¬°æȨÕùÒéÓë±¾Õ¾ÎÞ¹Ø £¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í×ðÁú¿­Ê±¹ÙÍøµÇ¼ÂËÓÍ»úÍø¹Ù·½Ì¬¶È £¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ £¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢ £¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢ £¬ÇëÄúÁ¬Ã¦ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎå £¬9:30-18:30 £¬½ÚãåÈÕÐÝÏ¢

QR code
ÍøÕ¾µØͼ