gitlab¿ÉÒÔÓÃwindows8´î½¨Âð
githubÊdzÌÐòÔ±ÈÕ³£¿ª·¢±Ø±¸µÄ°æ±¾¿ØÖƹ¤¾ß£¬²»¹ý³ý´ËÖ®Í⣬ÉÐÓÐÒ»¸öͬÑùÇ¿Ê¢²¢ÇÒÖµµÃÏàʶµÄ¹¤¾ß£¬ÄǾÍÊÇgitlab¡£ÓÐЩ³ÌÐòÔ±¶Ôgitlab²»ÊìϤ£¬²»ÖªµÀgitlab¸ÃÔõôʹÓ㬸ü²»ÖªµÀgitlabÄÜ·ñÔÚwindows8ϵͳÉϴ¡£±¾ÎĽ«Îª¸÷ÈËÏÈÈÝgitlabÒÔ¼°ÔõÑùÔÚwindows8ϵͳÉϴgitlab¡£
Ò»¡¢Ê²Ã´ÊÇGitLab
GitLabÊÇÒ»¿î¿ªÔ´µÄ´úÂëÍйÜÖÎÀíϵͳ£¬ÀàËÆÓÚGitHub£¬¿ÉÊÇËüÊÇÖ§³ÖÍâµØ°²Åŵģ¬¼È¿ÉÒÔÔËÐÐÔÚ×Ô¼ºµÄЧÀÍÆ÷ÉÏ£¬Ò²¿ÉÒÔÔÚÔÆЧÀÍÆ÷ÉϾÙÐа²ÅÅ¡£ËüÊÇ»ùÓÚGitµÄ°æ±¾¿ØÖƹ¤¾ß£¬½ÓÄÉÁËRuby on Rails¿ò¼Ü¿ª·¢¡£Í¨¹ýʹÓÃGitLab£¬ÍŶӳÉÔ±¿ÉÒÔ»ñµÃ¸üºÃµÄ´úÂëÖÎÀíÓëÐͬÊÂÇéÌåÑ飬ÌáÉý¿ª·¢Ð§ÂÊ¡£
¶þ¡¢GitLabÄÜ·ñÔÚWindows8ϵͳÉϴ
GitLab¹Ù·½ÌṩÁËÒ»·Ý×°ÖÃÎĵµ£¬ËüÖ»ÊǸø³öÁËÔÚLinux²Ù×÷ϵͳÉϾÙÐÐ×°Öõİ취£¬²¢Ã»ÓÐÌṩÔÚWindows²Ù×÷ϵͳÉϵÄ×°Öý̡̳£¿ÉÊÇÎÒÃÇ¿ÉÒÔͨ¹ý×°ÖÃGitLab RunnerÔÚWindowsÉÏÔËÐÐGitLab£¬ÕâÑù¾Í¿ÉÒÔÔÚWindows8ϵͳÉÏʹÓÃGitLabÁË¡£GitLab RunnerÊÇÒ»ÖÖÖ§³Ö¶àÖÖƽ̨µÄͨÓõġ¢¿ÉÀ©Õ¹µÄʵÏÖ¹¤¾ß£¬¿ÉÒÔÓëGitLab CI / CDÂòͨ£¬ÎªGitLabÌṩ¹¹½¨£¬²âÊÔ£¬°²ÅŵÄ×Ô¶¯»¯¼¯³É×÷Òµ¡£
Èý¡¢ÔõÑùÔÚWindows8ϵͳÉϴGitLab
×°ÖÃGitLab Runner
ÔÚ¹ÙÍøÏÂÔØ×°ÖúÃGitLab Runner£¬×°ÖÃÍê³Éºó·¿ªcmd£¬ÔËÐÐÏÂÁÐÏÂÁî:
gitlab-runner install gitlab-runner start
µÇ¼ºó¸´ÖÆ
ÐÞ¸ÄGitLabµÄÉèÖÃÎļþ
½«GitLab×°Ö÷¾¶ÏÂgitlab.rb.sampleµÄºó׺ÐÞ¸ÄΪrb¼´¿ÉʹÓá£ÔÚ¸ÃÉèÖÃÎļþÖоÙÐÐÈçÏÂÐ޸ģº
nginx['enable'] = false web_server['external_users'] = ['nginx'] registry_external_url 'https: //xxx.xxx.xxx.xxx :5005' £¨Ö÷»úIP£© gitlab_rails['registry_enabled'] = true gitlab_rails['registry_host'] = "https://xxx.xxx.xxx.xxx:5005"
µÇ¼ºó¸´ÖÆ
ÉèÖÃGitLab Runner
½øÈëGitLabÖУ¬µã»÷¡°Settings¡±£¬·¿ª¡°CI/CD¡±Ñ¡Ï£¬µã»÷¡°Runners¡±¡£
ÔÚ¡°Runners¡±Ò³ÃæÖУ¬Ñ¡Ôñ¡°Expand¡±Ñ¡Ï¼´¿ÉÔÚ¡°Runners¡±Ò³ÃæÖп´µ½¡°Set up a specific Runner manually¡±×ÓÑ¡Ïµã»÷Ëü¡£
ÔÚ¡°Runners¡±ÉèÖÃÒ³ÃæÉÏ£¬Ñ¡Ôñ¡°Windows¡±²¢¸´ÖÆ×¢²áÁîÅÆ£¬¹Ø±Õ´°¿Ú¡£
ÔÚcmdÖÐÔËÐÐÏÂÁÐÏÂÁ
gitlab-runner register --url https://192.168.27.159 --registration-token 5fjq1eQApWzoKz-2QyFh --executor shell --description "runner for Windows8" --tag-list "windows,runner,shell" --run-untagged true --locked=false --access-level not_protected
µÇ¼ºó¸´ÖÆ
ÆäÖУ¬¡°-url¡±ºóÃæµÄurlΪGitLabЧÀÍÆ÷IPµØµã£¬ ¡°-registration-token¡± ºóÃæµÄÁîÅÆΪµÚ¶þ²½Öи´ÖƵÄ×¢²áÁîÅÆ¡£
ÔËÐÐÉÏÊö´úÂëºó£¬GitLab Runner½«×÷ΪWindowsЧÀÍÀ´ÔËÐС£
²âÊÔÊÇ·ñ×°ÖÃÀÖ³É
ÐèÒªÔËÐÐÏÂÁдúÂ룺
git clone https://192.168.27.159/user/repository.git cd repository echo "Hello, GitLab!" > README.md git add README.md git commit -m 'add README' git push -u origin master
µÇ¼ºó¸´ÖÆ
ÈôÊÇÔËÐÐûÓÐÎÊÌ⣬¹§Ï²Ä㣬ÒѾÀÖ³É×°ÖÃGitLab²¢ÔÚWindows8ϵͳÉÏÔËÐС£
½áÂÛ£º
GitLabÊÇÒ»¿îºÜÊÇÇ¿Ê¢µÄ°æ±¾¿ØÖƹ¤¾ß£¬¿ÉÒÔ×ÊÖúÍŶӳÉÔ±¸üºÃµÄÐͬÊÂÇ飬Ìá¸ßЧÂÊ¡£ÔÚWindows8ϵͳÖдGitLab£¬ÐèÒªÏÈ×°ÖÃGitLab Runner£¬È»ºó¶ÔGitLabµÄÉèÖÃÎļþ¾ÙÐÐÐ޸ģ¬×îºóÉèÖÃGitLab Runner¡£Àֳɴºó¿ÉÒÔƾ֤×Ô¼ºµÄÐèÒª¾ÙÐÐʹÓá£
ÒÔÉϾÍÊÇgitlab¿ÉÒÔÓÃwindows8´î½¨ÂðµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡