{"id":19867,"date":"2024-11-19T14:40:34","date_gmt":"2024-11-19T06:40:34","guid":{"rendered":"https:\/\/fwq.ai\/blog\/19867\/"},"modified":"2024-11-19T14:40:34","modified_gmt":"2024-11-19T06:40:34","slug":"gitlab%e5%8f%af%e4%bb%a5%e7%94%a8windows8%e6%90%ad%e5%bb%ba%e5%90%97","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/19867\/","title":{"rendered":"gitlab\u53ef\u4ee5\u7528windows8\u642d\u5efa\u5417"},"content":{"rendered":"<p>github\u662f\u7a0b\u5e8f\u5458\u65e5\u5e38\u5f00\u53d1\u5fc5\u5907\u7684\u7248\u672c\u63a7\u5236\u5de5\u5177\uff0c\u4e0d\u8fc7\u9664\u6b64\u4e4b\u5916\uff0c\u8fd8\u6709\u4e00\u4e2a\u540c\u6837\u5f3a\u5927\u5e76\u4e14\u503c\u5f97\u4e86\u89e3\u7684\u5de5\u5177\uff0c\u90a3\u5c31\u662fgitlab\u3002\u6709\u4e9b\u7a0b\u5e8f\u5458\u5bf9gitlab\u4e0d\u719f\u6089\uff0c\u4e0d\u77e5\u9053gitlab\u8be5\u600e\u4e48\u4f7f\u7528\uff0c\u66f4\u4e0d\u77e5\u9053gitlab\u80fd\u5426\u5728windows8\u7cfb\u7edf\u4e0a\u642d\u5efa\u3002\u672c\u6587\u5c06\u4e3a\u5927\u5bb6\u4ecb\u7ecdgitlab\u4ee5\u53ca\u5982\u4f55\u5728windows8\u7cfb\u7edf\u4e0a\u642d\u5efagitlab\u3002<\/p>\n<p>\u4e00\u3001\u4ec0\u4e48\u662fGitLab<\/p>\n<p>GitLab\u662f\u4e00\u6b3e\u5f00\u6e90\u7684\u4ee3\u7801\u6258\u7ba1\u7ba1\u7406\u7cfb\u7edf\uff0c\u7c7b\u4f3c\u4e8eGitHub\uff0c\u4f46\u662f\u5b83\u662f\u652f\u6301\u672c\u5730\u90e8\u7f72\u7684\uff0c\u65e2\u53ef\u4ee5\u8fd0\u884c\u5728\u81ea\u5df1\u7684\u670d\u52a1\u5668\u4e0a\uff0c\u4e5f\u53ef\u4ee5\u5728\u4e91\u670d\u52a1\u5668\u4e0a\u8fdb\u884c\u90e8\u7f72\u3002\u5b83\u662f\u57fa\u4e8eGit\u7684\u7248\u672c\u63a7\u5236\u5de5\u5177\uff0c\u91c7\u7528\u4e86Ruby on Rails\u6846\u67b6\u5f00\u53d1\u3002\u901a\u8fc7\u4f7f\u7528GitLab\uff0c\u56e2\u961f\u6210\u5458\u53ef\u4ee5\u5f97\u5230\u66f4\u597d\u7684\u4ee3\u7801\u7ba1\u7406\u4e0e\u534f\u540c\u5de5\u4f5c\u4f53\u9a8c\uff0c\u63d0\u5347\u5f00\u53d1\u6548\u7387\u3002<\/p>\n<p>\u4e8c\u3001GitLab\u80fd\u5426\u5728Windows8\u7cfb\u7edf\u4e0a\u642d\u5efa<\/p>\n<p>GitLab\u5b98\u65b9\u63d0\u4f9b\u4e86\u4e00\u4efd\u5b89\u88c5\u6587\u6863\uff0c\u5b83\u53ea\u662f\u7ed9\u51fa\u4e86\u5728Linux\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u8fdb\u884c\u5b89\u88c5\u7684\u6b65\u9aa4\uff0c\u5e76\u6ca1\u6709\u63d0\u4f9b\u5728Windows\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u7684\u5b89\u88c5\u6559\u7a0b\u3002\u4f46\u662f\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u5b89\u88c5GitLab Runner\u5728Windows\u4e0a\u8fd0\u884cGitLab\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u5728Windows8\u7cfb\u7edf\u4e0a\u4f7f\u7528GitLab\u4e86\u3002GitLab Runner\u662f\u4e00\u79cd\u652f\u6301\u591a\u79cd\u5e73\u53f0\u7684\u901a\u7528\u7684\u3001\u53ef\u6269\u5c55\u7684\u5b9e\u73b0\u5de5\u5177\uff0c\u53ef\u4ee5\u4e0eGitLab CI \/ CD\u6253\u901a\uff0c\u4e3aGitLab\u63d0\u4f9b\u6784\u5efa\uff0c\u6d4b\u8bd5\uff0c\u90e8\u7f72\u7684\u81ea\u52a8\u5316\u96c6\u6210\u4f5c\u4e1a\u3002<\/p>\n<p>\u4e09\u3001\u5982\u4f55\u5728Windows8\u7cfb\u7edf\u4e0a\u642d\u5efaGitLab<\/p>\n<ol>\n<li>\u5b89\u88c5GitLab Runner<\/li>\n<\/ol>\n<p>\u5728\u5b98\u7f51\u4e0b\u8f7d\u5b89\u88c5\u597dGitLab Runner\uff0c\u5b89\u88c5\u5b8c\u6210\u540e\u6253\u5f00cmd\uff0c\u8fd0\u884c\u4e0b\u5217\u547d\u4ee4:<\/p>\n<pre>gitlab-runner install\ngitlab-runner start<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<ol>\n<li>\u4fee\u6539GitLab\u7684\u914d\u7f6e\u6587\u4ef6<\/li>\n<\/ol>\n<p>\u5c06GitLab\u5b89\u88c5\u8def\u5f84\u4e0bgitlab.rb.sample\u7684\u540e\u7f00\u4fee\u6539\u4e3arb\u5373\u53ef\u4f7f\u7528\u3002\u5728\u8be5\u914d\u7f6e\u6587\u4ef6\u4e2d\u8fdb\u884c\u5982\u4e0b\u4fee\u6539\uff1a<\/p>\n<pre>nginx['enable'] = false\nweb_server['external_users'] = ['nginx']\nregistry_external_url 'https: \/\/xxx.xxx.xxx.xxx :5005' \uff08\u4e3b\u673aIP\uff09\ngitlab_rails['registry_enabled'] = true\ngitlab_rails['registry_host'] = \"https:\/\/xxx.xxx.xxx.xxx:5005\"<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<ol>\n<li>\u914d\u7f6eGitLab Runner<\/li>\n<\/ol>\n<p>\u8fdb\u5165GitLab\u4e2d\uff0c\u70b9\u51fb\u201cSettings\u201d\uff0c\u6253\u5f00\u201cCI\/CD\u201d\u9009\u9879\u5361\uff0c\u70b9\u51fb\u201cRunners\u201d\u3002<\/p>\n<p>\u5728\u201cRunners\u201d\u9875\u9762\u4e2d\uff0c\u9009\u62e9\u201cExpand\u201d\u9009\u9879\uff0c\u5373\u53ef\u5728\u201cRunners\u201d\u9875\u9762\u4e2d\u770b\u5230\u201cSet up a specific Runner manually\u201d\u5b50\u9009\u9879\uff0c\u70b9\u51fb\u5b83\u3002<\/p>\n<p>\u5728\u201cRunners\u201d\u8bbe\u7f6e\u9875\u9762\u4e0a\uff0c\u9009\u62e9\u201cWindows\u201d\u5e76\u590d\u5236\u6ce8\u518c\u4ee4\u724c\uff0c\u5173\u95ed\u7a97\u53e3\u3002<\/p>\n<p>\u5728cmd\u4e2d\u8fd0\u884c\u4e0b\u5217\u547d\u4ee4\uff1a<\/p>\n<pre>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<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5176\u4e2d\uff0c\u201c-url\u201d\u540e\u9762\u7684url\u4e3aGitLab\u670d\u52a1\u5668IP\u5730\u5740\uff0c \u201c-registration-token\u201d \u540e\u9762\u7684\u4ee4\u724c\u4e3a\u7b2c\u4e8c\u6b65\u4e2d\u590d\u5236\u7684\u6ce8\u518c\u4ee4\u724c\u3002<\/p>\n<p>\u8fd0\u884c\u4e0a\u8ff0\u4ee3\u7801\u540e\uff0cGitLab Runner\u5c06\u4f5c\u4e3aWindows\u670d\u52a1\u6765\u8fd0\u884c\u3002<\/p>\n<ol>\n<li>\u6d4b\u8bd5\u662f\u5426\u5b89\u88c5\u6210\u529f<\/li>\n<\/ol>\n<p>\u9700\u8981\u8fd0\u884c\u4e0b\u5217\u4ee3\u7801\uff1a<\/p>\n<pre>git clone https:\/\/192.168.27.159\/user\/repository.git\ncd repository\necho \"Hello, GitLab!\" &gt; README.md\ngit add README.md\ngit commit -m 'add README'\ngit push -u origin master<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5982\u679c\u8fd0\u884c\u6ca1\u6709\u95ee\u9898\uff0c\u606d\u559c\u4f60\uff0c\u5df2\u7ecf\u6210\u529f\u5b89\u88c5GitLab\u5e76\u5728Windows8\u7cfb\u7edf\u4e0a\u8fd0\u884c\u3002<\/p>\n<p>\u7ed3\u8bba\uff1a<\/p>\n<p>GitLab\u662f\u4e00\u6b3e\u975e\u5e38\u5f3a\u5927\u7684\u7248\u672c\u63a7\u5236\u5de5\u5177\uff0c\u53ef\u4ee5\u5e2e\u52a9\u56e2\u961f\u6210\u5458\u66f4\u597d\u7684\u534f\u540c\u5de5\u4f5c\uff0c\u63d0\u9ad8\u6548\u7387\u3002\u5728Windows8\u7cfb\u7edf\u4e2d\u642d\u5efaGitLab\uff0c\u9700\u8981\u5148\u5b89\u88c5GitLab Runner\uff0c\u7136\u540e\u5bf9GitLab\u7684\u914d\u7f6e\u6587\u4ef6\u8fdb\u884c\u4fee\u6539\uff0c\u6700\u540e\u914d\u7f6eGitLab Runner\u3002\u6210\u529f\u642d\u5efa\u540e\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u9700\u8981\u8fdb\u884c\u4f7f\u7528\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fgitlab\u53ef\u4ee5\u7528windows8\u642d\u5efa\u5417\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>github\u662f\u7a0b\u5e8f\u5458\u65e5\u5e38\u5f00\u53d1\u5fc5\u5907\u7684\u7248\u672c\u63a7\u5236\u5de5\u5177\uff0c\u4e0d\u8fc7\u9664\u6b64\u4e4b\u5916\uff0c\u8fd8\u6709\u4e00\u4e2a\u540c\u6837\u5f3a\u5927\u5e76\u4e14\u503c\u5f97\u4e86\u89e3\u7684\u5de5\u5177\uff0c\u90a3\u5c31\u662fgitlab\u3002\u6709\u4e9b\u7a0b\u5e8f\u5458\u5bf9gitlab\u4e0d\u719f\u6089\uff0c\u4e0d\u77e5\u9053gitlab\u8be5\u600e\u4e48\u4f7f\u7528\uff0c\u66f4\u4e0d\u77e5\u9053gitlab\u80fd\u5426\u5728windows8\u7cfb\u7edf\u4e0a\u642d\u5efa\u3002\u672c\u6587\u5c06\u4e3a\u5927\u5bb6\u4ecb\u7ecdgitlab\u4ee5\u53ca\u5982\u4f55\u5728windows8\u7cfb\u7edf\u4e0a\u642d\u5efagitlab\u3002 \u4e00\u3001\u4ec0\u4e48\u662fGitLab GitLab\u662f\u4e00\u6b3e\u5f00\u6e90\u7684\u4ee3\u7801\u6258\u7ba1\u7ba1\u7406\u7cfb\u7edf\uff0c\u7c7b\u4f3c\u4e8eGitHub\uff0c\u4f46\u662f\u5b83\u662f\u652f\u6301\u672c\u5730\u90e8\u7f72\u7684\uff0c\u65e2\u53ef\u4ee5\u8fd0\u884c\u5728\u81ea\u5df1\u7684\u670d\u52a1\u5668\u4e0a\uff0c\u4e5f\u53ef\u4ee5\u5728\u4e91\u670d\u52a1\u5668\u4e0a\u8fdb\u884c\u90e8\u7f72\u3002\u5b83\u662f\u57fa\u4e8eGit\u7684\u7248\u672c\u63a7\u5236\u5de5\u5177\uff0c\u91c7\u7528\u4e86Ruby on Rails\u6846\u67b6\u5f00\u53d1\u3002\u901a\u8fc7\u4f7f\u7528GitLab\uff0c\u56e2\u961f\u6210\u5458\u53ef\u4ee5\u5f97\u5230\u66f4\u597d\u7684\u4ee3\u7801\u7ba1\u7406\u4e0e\u534f\u540c\u5de5\u4f5c\u4f53\u9a8c\uff0c\u63d0\u5347\u5f00\u53d1\u6548\u7387\u3002 \u4e8c\u3001GitLab\u80fd\u5426\u5728Windows8\u7cfb\u7edf\u4e0a\u642d\u5efa GitLab\u5b98\u65b9\u63d0\u4f9b\u4e86\u4e00\u4efd\u5b89\u88c5\u6587\u6863\uff0c\u5b83\u53ea\u662f\u7ed9\u51fa\u4e86\u5728Linux\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u8fdb\u884c\u5b89\u88c5\u7684\u6b65\u9aa4\uff0c\u5e76\u6ca1\u6709\u63d0\u4f9b\u5728Windows\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u7684\u5b89\u88c5\u6559\u7a0b\u3002\u4f46\u662f\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u5b89\u88c5GitLab Runner\u5728Windows\u4e0a\u8fd0\u884cGitLab\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u5728Windows8\u7cfb\u7edf\u4e0a\u4f7f\u7528GitLab\u4e86\u3002GitLab Runner\u662f\u4e00\u79cd\u652f\u6301\u591a\u79cd\u5e73\u53f0\u7684\u901a\u7528\u7684\u3001\u53ef\u6269\u5c55\u7684\u5b9e\u73b0\u5de5\u5177\uff0c\u53ef\u4ee5\u4e0eGitLab CI \/ CD\u6253\u901a\uff0c\u4e3aGitLab\u63d0\u4f9b\u6784\u5efa\uff0c\u6d4b\u8bd5\uff0c\u90e8\u7f72\u7684\u81ea\u52a8\u5316\u96c6\u6210\u4f5c\u4e1a\u3002 \u4e09\u3001\u5982\u4f55\u5728Windows8\u7cfb\u7edf\u4e0a\u642d\u5efaGitLab \u5b89\u88c5GitLab Runner \u5728\u5b98\u7f51\u4e0b\u8f7d\u5b89\u88c5\u597dGitLab Runner\uff0c\u5b89\u88c5\u5b8c\u6210\u540e\u6253\u5f00cmd\uff0c\u8fd0\u884c\u4e0b\u5217\u547d\u4ee4: gitlab-runner install gitlab-runner start \u767b\u5f55\u540e\u590d\u5236 \u4fee\u6539GitLab\u7684\u914d\u7f6e\u6587\u4ef6 \u5c06GitLab\u5b89\u88c5\u8def\u5f84\u4e0bgitlab.rb.sample\u7684\u540e\u7f00\u4fee\u6539\u4e3arb\u5373\u53ef\u4f7f\u7528\u3002\u5728\u8be5\u914d\u7f6e\u6587\u4ef6\u4e2d\u8fdb\u884c\u5982\u4e0b\u4fee\u6539\uff1a nginx[&#8216;enable&#8217;] = false web_server[&#8216;external_users&#8217;] = [&#8216;nginx&#8217;] registry_external_url &#8216;https: \/\/xxx.xxx.xxx.xxx :5005&#8217; \uff08\u4e3b\u673aIP\uff09 gitlab_rails[&#8216;registry_enabled&#8217;] = true gitlab_rails[&#8216;registry_host&#8217;] = &#8220;https:\/\/xxx.xxx.xxx.xxx:5005&#8221; \u767b\u5f55\u540e\u590d\u5236 \u914d\u7f6eGitLab Runner \u8fdb\u5165GitLab\u4e2d\uff0c\u70b9\u51fb\u201cSettings\u201d\uff0c\u6253\u5f00\u201cCI\/CD\u201d\u9009\u9879\u5361\uff0c\u70b9\u51fb\u201cRunners\u201d\u3002 \u5728\u201cRunners\u201d\u9875\u9762\u4e2d\uff0c\u9009\u62e9\u201cExpand\u201d\u9009\u9879\uff0c\u5373\u53ef\u5728\u201cRunners\u201d\u9875\u9762\u4e2d\u770b\u5230\u201cSet up a specific Runner manually\u201d\u5b50\u9009\u9879\uff0c\u70b9\u51fb\u5b83\u3002 \u5728\u201cRunners\u201d\u8bbe\u7f6e\u9875\u9762\u4e0a\uff0c\u9009\u62e9\u201cWindows\u201d\u5e76\u590d\u5236\u6ce8\u518c\u4ee4\u724c\uff0c\u5173\u95ed\u7a97\u53e3\u3002 \u5728cmd\u4e2d\u8fd0\u884c\u4e0b\u5217\u547d\u4ee4\uff1a gitlab-runner register [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-19867","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19867","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=19867"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/19867\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=19867"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=19867"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=19867"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}