{"id":1401,"date":"2021-07-30T15:51:54","date_gmt":"2021-07-30T07:51:54","guid":{"rendered":"https:\/\/egonlin.com\/?p=1401"},"modified":"2021-07-30T16:08:32","modified_gmt":"2021-07-30T08:08:32","slug":"%e7%ac%ac%e4%b8%80%e8%8a%82%ef%bc%9agitlab%e5%ae%89%e8%a3%85","status":"publish","type":"post","link":"https:\/\/egonlin.com\/?p=1401","title":{"rendered":"\u7b2c\u4e00\u8282\uff1agitlab\u5b89\u88c5"},"content":{"rendered":"<h1>Gitlab\u5b89\u88c5<\/h1>\n<h2>\u4e00\u3001\u4ecb\u7ecd<\/h2>\n<p><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/egonlin.com\/wp-content\/uploads\/2021\/07\/1-56.png'><img class=\"lazyload lazyload-style-2\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  data-original=\"https:\/\/egonlin.com\/wp-content\/uploads\/2021\/07\/1-56.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" \/><\/div><\/p>\n<pre><code class=\"language-bash\">    GitLab \u662f\u4e00\u4e2a\u7528\u4e8e\u4ed3\u5e93\u7ba1\u7406\u7cfb\u7edf\u7684\u5f00\u6e90\u9879\u76ee\uff0c\u4f7f\u7528Git\u4f5c\u4e3a\u4ee3\u7801\u7ba1\u7406\u5de5\u5177\uff0c\u5e76\u5728\u6b64\u57fa\u7840\u4e0a\u642d\u5efa\u8d77\u6765\u7684\nweb\u670d\u52a1\u3002\n    GitLab\u548cGitHub\u4e00\u6837\u5c5e\u4e8e\u7b2c\u4e09\u65b9\u57fa\u4e8eGit\u5f00\u53d1\u7684\u4f5c\u54c1\uff08\u79c1\u6709\u4ed3\u5e93\uff09\uff0cGITLAB\u514d\u8d39\u4e14\u5f00\u6e90(\u57fa\u4e8eMIT\u534f\u8bae)\uff0c\u4e0eGithub\u7c7b\u4f3c\uff0c \u53ef\u4ee5\u6ce8\u518c\u7528\u6237\uff0c\u4efb\u610f\u63d0\u4ea4\u4f60\u7684\u4ee3\u7801\uff0c\u6dfb\u52a0SSHKey\u7b49\u7b49\u3002\u4e0d\u540c\u7684\u662f\uff0cGitLab\u662f\u53ef\u4ee5\u90e8\u7f72\u5230\u81ea\u5df1\u7684\u670d\u52a1\u5668 \u4e0a\uff0c\u6570\u636e\u5e93\u7b49\u4e00\u5207\u4fe1\u606f\u90fd\u638c\u63e1\u5728\u81ea\u5df1\u624b\u4e0a\uff0c\u9002\u5408\u56e2\u961f\u5185\u90e8\u534f\u4f5c\u5f00\u53d1\uff0c\u4f60\u603b\u4e0d\u53ef\u80fd\u628a\u56e2\u961f\u5185\u90e8\u7684\u667a\u6167\u603b\u653e \u5728\u522b\u4eba\u7684\u670d\u52a1\u5668\u4e0a\u5427?\u7b80\u5355\u6765\u8bf4\u53ef\u628aGitLab\u770b\u4f5c\u4e2a\u4eba\u7248\u7684GitHub\u3002\n    Gitlab\u662f\u4f9d\u8d56\u4e8eGit\u7684\u8fdc\u7a0b\u4ee3\u7801\u4ed3\u5e93\uff0c\u7c7b\u4f3c\u4e8eGitHub\u3001Gitee,\u4e0d\u540c\u7684\u662fGitHub\u3001Gitee\u7684\u516c\u7f51\u4e0a\u4ee3\u7801\u4ed3\u5e93, Gitlab\u662f\u53ef\u4ee5\u79c1\u6709\u5316\u90e8\u7f72\u7684\u514d\u8d39\u8fdc\u7a0b\u4ee3\u7801\u4ed3\u5e93<\/code><\/pre>\n<h2>\u4e8c\u3001\u90e8\u7f72<\/h2>\n<h3>1\u3001\u51c6\u5907\u670d\u52a1\u5668<\/h3>\n<table>\n<thead>\n<tr>\n<th>IP<\/th>\n<th>CPU\u6838\u5fc3<\/th>\n<th>\u5185\u5b58<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>192.168.15.60<\/td>\n<td>2<\/td>\n<td>3<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>2\u3001\u4e0b\u8f7d\u5b89\u88c5\u5305<\/h3>\n<pre><code class=\"language-bash\">wget https:\/\/mirrors.tuna.tsinghua.edu.cn\/gitlab-ce\/yum\/el7\/gitlab-ce-13.0.3-ce.0.el7.x86_64.rpm<\/code><\/pre>\n<h3>3\u3001\u89e3\u51b3\u4f9d\u8d56<\/h3>\n<pre><code class=\"language-bash\">yum install -y policycoreutils openssh-server openssh-clients postfix perl policycoreutils-python curl<\/code><\/pre>\n<h3>4\u3001\u5173\u95ed\u9632\u706b\u5899<\/h3>\n<pre><code class=\"language-bash\">systemctl disable --now firewalld<\/code><\/pre>\n<h3>5\u3001\u5173\u95edselinux<\/h3>\n<pre><code class=\"language-bash\">sed -i &#039;s#enforcing#disabled#g&#039; \/etc\/sysconfig\/selinux\nsetenforce 0<\/code><\/pre>\n<h3>6\u3001\u5b89\u88c5<\/h3>\n<pre><code class=\"language-bash\">yum localinstall -y gitlab-ce-13.0.3-ce.0.el7.x86_64.rpm <\/code><\/pre>\n<h3>7\u3001\u4fee\u6539\u914d\u7f6e\u6587\u4ef6<\/h3>\n<pre><code class=\"language-bash\">vim \/etc\/gitlab\/gitlab.rb\n...\nexternal_url &#039;http:\/\/192.168.15.60&#039;\n...\nnginx[&#039;listen_port&#039;] = 80\n...<\/code><\/pre>\n<h3>8\u3001\u5237\u65b0\u914d\u7f6e\uff08\u9ed8\u8ba4\u542f\u52a8\uff09<\/h3>\n<pre><code class=\"language-bash\">gitlab-ctl reconfigure<\/code><\/pre>\n<h3>9\u3001\u542f\u52a8<\/h3>\n<pre><code class=\"language-bash\">gitlab-ctl start<\/code><\/pre>\n<h3>10\u3001\u9875\u9762\u8bbf\u95ee<\/h3>\n<p><a href=\"http:\/\/192.168.15.60\/\">http:\/\/192.168.15.60\/<\/a><\/p>\n<p><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/egonlin.com\/wp-content\/uploads\/2021\/07\/2-55.png'><img class=\"lazyload lazyload-style-2\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  data-original=\"https:\/\/egonlin.com\/wp-content\/uploads\/2021\/07\/2-55.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" \/><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Gitlab\u5b89\u88c5 \u4e00\u3001\u4ecb\u7ecd GitLab \u662f\u4e00\u4e2a\u7528\u4e8e\u4ed3\u5e93\u7ba1\u7406\u7cfb\u7edf\u7684\u5f00\u6e90\u9879\u76ee\uff0c\u4f7f\u7528Git\u4f5c\u4e3a\u4ee3\u7801\u7ba1\u7406\u5de5\u5177\uff0c\u5e76\u5728\u6b64 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":1403,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[170],"tags":[21,178,179,181,182,22,180,20],"_links":{"self":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/posts\/1401"}],"collection":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1401"}],"version-history":[{"count":0,"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/posts\/1401\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/media\/1403"}],"wp:attachment":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1401"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1401"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}