﻿{"id":991,"date":"2023-01-04T17:06:10","date_gmt":"2023-01-04T09:06:10","guid":{"rendered":"http:\/\/blog.sway.com.cn\/?p=991"},"modified":"2023-01-04T17:34:33","modified_gmt":"2023-01-04T09:34:33","slug":"%e5%9c%a8%e6%a0%91%e8%8e%93%e6%b4%be%e4%b8%8a%e5%ae%89%e8%a3%85gitlab-runner","status":"publish","type":"post","link":"http:\/\/blog.sway.com.cn\/?p=991","title":{"rendered":"\u5728\u6811\u8393\u6d3e\u4e0a\u5b89\u88c5Gitlab-runner"},"content":{"rendered":"\n<p>\u5b98\u65b9\u4e0b\u8f7d\u5730\u5740\uff1a<a rel=\"noreferrer noopener\" href=\"https:\/\/gitlab-runner-downloads.s3.amazonaws.com\/latest\/index.html\" target=\"_blank\">https:\/\/gitlab-runner-downloads.s3.amazonaws.com\/latest\/index.html<\/a><br>\u5b98\u7f51\u5b89\u88c5\u6587\u6863\uff1a<a rel=\"noreferrer noopener\" href=\"https:\/\/docs.gitlab.com\/runner\/install\/linux-manually.html\" target=\"_blank\">https:\/\/docs.gitlab.com\/runner\/install\/linux-manually.html<\/a><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo curl -L --output \/usr\/local\/bin\/gitlab-runner \"https:\/\/gitlab-runner-downloads.s3.amazonaws.com\/latest\/binaries\/gitlab-runner-linux-arm\"\nsudo chmod +x \/usr\/local\/bin\/gitlab-runner\n\n#Create a GitLab CI user:\n\nsudo useradd --comment 'GitLab Runner' --create-home gitlab-runner --shell \/bin\/bash\n\n#Install and run as service:\n\nsudo gitlab-runner install --user=gitlab-runner --working-directory=\/home\/gitlab-runner\nsudo gitlab-runner start<\/pre>\n\n\n\n<p>\u5b89\u88c5\u8fc7\u7a0b\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/01\/image-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"661\" height=\"278\" src=\"http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/01\/image-1.png\" alt=\"\" class=\"wp-image-994\" srcset=\"http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/01\/image-1.png 661w, http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/01\/image-1-300x126.png 300w\" sizes=\"auto, (max-width: 661px) 100vw, 661px\" \/><\/a><\/figure>\n\n\n\n<p>\u8bbe\u7f6egitlab-runner\u5f00\u673a\u542f\u52a8\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo systemctl enable gitlab-runner<\/pre>\n\n\n\n<p>\u5982\u679c\u51fa\u73b0\u8dd1cicd\u7684\u65f6\u5019\u6709\u5982\u4e0b\u63d0\u793a\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/01\/image-2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"905\" height=\"316\" src=\"http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/01\/image-2.png\" alt=\"\" class=\"wp-image-998\" srcset=\"http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/01\/image-2.png 905w, http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/01\/image-2-300x105.png 300w, http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/01\/image-2-768x268.png 768w\" sizes=\"auto, (max-width: 905px) 100vw, 905px\" \/><\/a><\/figure>\n\n\n\n<p>\u5219\u9700\u8981\u4f7f\u7528vi\u7f16\u8f91\/home\/gitlab-runner\u4e0b\u7684.bash_logout\u6587\u4ef6\uff08\u8fd9\u4e2a\u6587\u4ef6\u7528ls\u6307\u4ee4\u662f\u770b\u4e0d\u5230\u7684\uff09\uff0c\u5c06\u91cc\u9762\u7684\u6240\u6709\u5185\u5bb9\u90fd\u6ce8\u91ca\u6389\u540e\u91cd\u65b0\u8dd1cicd\u5373\u53ef\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/01\/image-3.png\"><img loading=\"lazy\" decoding=\"async\" width=\"660\" height=\"192\" src=\"http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/01\/image-3.png\" alt=\"\" class=\"wp-image-999\" srcset=\"http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/01\/image-3.png 660w, http:\/\/blog.sway.com.cn\/wp-content\/uploads\/2023\/01\/image-3-300x87.png 300w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/a><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u5b98\u65b9\u4e0b\u8f7d\u5730\u5740\uff1ahttps:\/\/gitlab-runner-downloads.s3.amazonaws.com [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-991","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/991","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=991"}],"version-history":[{"count":6,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/991\/revisions"}],"predecessor-version":[{"id":1001,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/991\/revisions\/1001"}],"wp:attachment":[{"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=991"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=991"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=991"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}