{"id":45,"date":"2026-02-19T10:00:00","date_gmt":"2026-02-19T02:00:00","guid":{"rendered":"http:\/\/localhost:8888\/?p=45"},"modified":"2026-07-09T16:17:45","modified_gmt":"2026-07-09T08:17:45","slug":"gitlab-ci%e6%b5%8b%e8%af%95%e9%9b%86%e6%88%90%e5%ae%9e%e6%88%98","status":"publish","type":"post","link":"https:\/\/blog.runnergo.cn\/?p=45","title":{"rendered":"GitLab CI\u6d4b\u8bd5\u96c6\u6210\u5b9e\u6218 &#8211; \u4ece\u4ee3\u7801\u63d0\u4ea4\u5230\u6d4b\u8bd5\u62a5\u544a\u5168\u6d41\u7a0b"},"content":{"rendered":"<h1>GitLab CI\u6d4b\u8bd5\u96c6\u6210\u5b9e\u6218 &#8211; \u4ece\u4ee3\u7801\u63d0\u4ea4\u5230\u6d4b\u8bd5\u62a5\u544a\u5168\u6d41\u7a0b<\/h1>\n<p>&gt; \u4f5c\u8005\uff1aGitOps\u73a9\u5bb6<br \/>\n&#8212;<\/p>\n<h2>\u524d\u8a00<\/h2>\n<p>\u5927\u5bb6\u597d\uff0c\u6211\u662fGitOps\u73a9\u5bb6\u3002\u505aCI\/CD\u5b9e\u8df56\u5e74\uff0cGitLab CI\u662f\u6211\u5e38\u7528\u7684CI\u5e73\u53f0\u3002\u4eca\u5929\u5206\u4eabGitLab CI\u6d4b\u8bd5\u96c6\u6210\u7684\u5b8c\u6574\u6d41\u7a0b\u3002<\/p>\n<p>&#8212;<\/p>\n<h2>\u4e00\u3001GitLab CI\u914d\u7f6e<\/h2>\n<h3>.gitlab-ci.yml\u7ed3\u6784<\/h3>\n<p><code>`<\/code>yaml<br \/>\nstages:<br \/>\n  &#8211; build<br \/>\n  &#8211; test<br \/>\n  &#8211; deploy<\/p>\n<p>unit_test:<br \/>\n  stage: test<br \/>\n  script:<br \/>\n    &#8211; pytest tests\/unit<\/p>\n<p>api_test:<br \/>\n  stage: test<br \/>\n  script:<br \/>\n    &#8211; newman run tests\/collection.json<br \/>\n<code>`<\/code><\/p>\n<p>&#8212;<\/p>\n<h2>\u4e8c\u3001RunnerGo\u96c6\u6210<\/h2>\n<p><code>`<\/code>yaml<br \/>\nrunnergo_test:<br \/>\n  stage: test<br \/>\n  script:<br \/>\n    &#8211; curl -X POST ${RUNNERGO_URL}\/api\/plan\/run<br \/>\n<code>`<\/code><\/p>\n<p>&#8212;<\/p>\n<h2>\u4e09\u3001\u6d4b\u8bd5\u62a5\u544a<\/h2>\n<p><code>`<\/code>yaml<br \/>\nartifacts:<br \/>\n  reports:<br \/>\n    junit: reports\/*.xml<br \/>\n  paths:<br \/>\n    &#8211; reports\/<br \/>\n<code>`<\/code><\/p>\n<p>&#8212;<\/p>\n<h2>\u603b\u7ed3<\/h2>\n<p>GitLab CI\u8981\u70b9\uff1a<\/p>\n<p>| \u73af\u8282 | \u914d\u7f6e |<br \/>\n|&#8212;&#8212;|&#8212;&#8212;|<br \/>\n| \u6d41\u6c34\u7ebf | stages\u5b9a\u4e49 |<br \/>\n| \u6d4b\u8bd5\u6267\u884c | script\u547d\u4ee4 |<br \/>\n| \u62a5\u544a\u4e0a\u4f20 | artifacts\u914d\u7f6e |<\/p>\n<p>&#8212;<\/p>\n<p><strong>\u4e0b\u671f\u9884\u544a\uff1a\u63a2\u7d22\u6027\u6d4b\u8bd5\u65b9\u6cd5\u8bba &#8211; \u53d1\u73b0\u9690\u85cfBug\u7684\u79d8\u5bc6\u6b66\u5668<\/strong><\/p>\n<p>&gt; \u4f5c\u8005\uff1aGitOps\u73a9\u5bb6\uff0c6\u5e74CI\/CD\u5b9e\u8df5\u7ecf\u9a8c<\/p>\n","protected":false},"excerpt":{"rendered":"<p>GitLab CI\u6d4b\u8bd5\u96c6\u6210\u5b9e\u6218 &#8211; \u4ece\u4ee3\u7801\u63d0\u4ea4\u5230\u6d4b\u8bd5\u62a5\u544a\u5168\u6d41\u7a0b &gt; \u4f5c\u8005\uff1aGitOps\u73a9\u5bb6 &#8212; \u524d\u8a00 \u5927\u5bb6\u597d\uff0c\u6211\u662fGitOps\u73a9\u5bb6\u3002\u505aCI\/CD\u5b9e\u8df56\u5e74\uff0cGitLab C&#8230;<\/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-45","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.runnergo.cn\/index.php?rest_route=\/wp\/v2\/posts\/45","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.runnergo.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.runnergo.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.runnergo.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.runnergo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=45"}],"version-history":[{"count":0,"href":"https:\/\/blog.runnergo.cn\/index.php?rest_route=\/wp\/v2\/posts\/45\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.runnergo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=45"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.runnergo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=45"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.runnergo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=45"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}