{"id":421,"date":"2017-09-20T16:21:23","date_gmt":"2017-09-20T08:21:23","guid":{"rendered":"https:\/\/blog.jsjs.org\/?p=421"},"modified":"2017-09-20T16:21:23","modified_gmt":"2017-09-20T08:21:23","slug":"%e5%8a%88%e8%8d%86%e6%96%a9%e6%a3%98%ef%bc%9agitlab-%e9%83%a8%e7%bd%b2-ci-%e6%8c%81%e7%bb%ad%e9%9b%86%e6%88%90","status":"publish","type":"post","link":"https:\/\/blog.jsjs.org\/?p=421","title":{"rendered":"\u5288\u8346\u65a9\u68d8\uff1aGitlab \u90e8\u7f72 CI \u6301\u7eed\u96c6\u6210"},"content":{"rendered":"<div id=\"cnblogs_post_body\" class=\"cnblogs-markdown\">\n<p>\u9605\u8bfb\u76ee\u5f55\uff1a<\/p>\n<ul>\n<li><strong>install configue gitlab-ci-multi-runner<\/strong><\/li>\n<li><strong>restore nuget packages<\/strong><\/li>\n<li><strong>bulid .sln<\/strong><\/li>\n<li><strong>run unit tests<\/strong><\/li>\n<li><strong>configue .gitlab-ci.yml<\/strong><\/li>\n<li><strong>configue build status badge image<\/strong><\/li>\n<\/ul>\n<p>CI \u7cbe\u534e\u6587\u7ae0\uff1a<\/p>\n<ul>\n<li><a href=\"http:\/\/www.ruanyifeng.com\/blog\/2015\/09\/continuous-integration.html\">\u6301\u7eed\u96c6\u6210\u662f\u4ec0\u4e48\uff1f<\/a><\/li>\n<li><a href=\"http:\/\/www.cnblogs.com\/davenkin\/archive\/2012\/02\/25\/continuous-integration-from-martin-fowler.html\">\u91cd\u6e29\u5927\u5e08\u7ecf\u5178\uff1aMartin Fowler \u7684\u6301\u7eed\u96c6\u6210<\/a><\/li>\n<\/ul>\n<p>Gitlab \u90e8\u7f72 CI \u76f8\u5173\u8d44\u6599\uff1a<\/p>\n<ul>\n<li><a href=\"https:\/\/ruby-china.org\/topics\/28726\">\u914d\u7f6e gitlab-ci \u8fdb\u884c\u6301\u7eed\u96c6\u6210<\/a><\/li>\n<li><a href=\"http:\/\/answ.me\/post\/build-docker-images-automatically-via-gitlab-ci\/\">\u4f7f\u7528 GitLab-CI \u6765\u81ea\u52a8\u521b\u5efa Docker \u955c\u50cf<\/a><\/li>\n<li><a href=\"https:\/\/www.zybuluo.com\/bornkiller\/note\/314902\">\u57fa\u4e8e gitlab \u642d\u5efa CI \u73af\u5883<\/a><\/li>\n<li><a href=\"http:\/\/archiechen.github.io\/blog\/2013\/01\/12\/shi-yong-gitlab-he-gitlab_ci-jin-xing-chi-xu-ji-cheng\/\">\u4f7f\u7528 gitlab \u548c gitlab_ci \u8fdb\u884c\u6301\u7eed\u96c6\u6210<\/a><\/li>\n<\/ul>\n<p><strong>\u6301\u7eed\u96c6\u6210<\/strong>\uff08Continuous integration &#8211; CI\uff09\u7684\u4f5c\u7528\uff1a\u4ee3\u7801\u5728\u63d0\u4ea4\u5230\u8d44\u6e90\u5e93\u4e4b\u524d\uff0c\u8fdb\u884c\u6784\u5efa\u3001\u81ea\u52a8\u5316\u6d4b\u8bd5\u548c\u53d1\u5e03\u7b49\u7b49\uff0c\u6211\u4eec\u6bcf\u5929\u9700\u8981\u63d0\u4ea4\u5927\u91cf\u7684\u4ee3\u7801\uff0c\u6301\u7eed\u96c6\u6210\u53ef\u4ee5\u6709\u6548\u7684\u5e2e\u52a9\u6211\u4eec\u53d1\u73b0\u4ee3\u7801\u4e2d\u7684 Bug\uff0c\u5e76\u4e14\u51cf\u5c11\u4e00\u4e9b\u53cd\u590d\u7684\u5de5\u4f5c\u7b49\u7b49\uff0c\u4f7f\u56e2\u961f\u66f4\u52a0\u6709\u6548\u7684\u5f00\u53d1\u534f\u4f5c\u3002<\/p>\n<p>GitLab CI \u5b98\u65b9\u4ecb\u7ecd\uff1a<a class=\"uri\" href=\"https:\/\/about.gitlab.com\/gitlab-ci\/\">https:\/\/about.gitlab.com\/gitlab-ci\/<\/a><\/p>\n<p>Gitlab \u5728 8.0 \u4ee5\u4e0a\u7248\u672c\u96c6\u6210\u4e86 CI\uff0c\u6240\u4ee5\u6211\u4eec\u4e0d\u9700\u8981\u53e6\u5916\u914d\u7f6e\u4e00\u4e2a gitlab-ci-server \u670d\u52a1\u5668\uff0c\u4e3a\u6211\u4eec\u90e8\u7f72\u51cf\u5c11\u4e86\u5f88\u591a\u7684\u5de5\u4f5c\uff0c\u70b9\u4e2a\u8d5e\ud83d\udc4d\uff01<\/p>\n<p>\u5148\u5410\u69fd\u4e0b\uff0cGitlab \u90e8\u7f72 CI \u6211\u5927\u6982\u82b1\u4e86\u4e00\u5468\u7684\u65f6\u95f4\uff0c\u4f46\u4e5f\u53ea\u662f\u8fdb\u884c\u4e86\u4e00\u70b9\u70b9\uff0c\u6700\u91cd\u8981\u7684\u4e09\u70b9\uff1a<code>nuget restore<\/code>,\u00a0<code>bulid *.sln<\/code>\u548c<code>run unit tests<\/code>\u73b0\u5728\u57fa\u672c\u4e0a\u662f\u53ef\u4ee5\u4e86\uff0c\u5728\u90e8\u7f72\u7684\u8fc7\u7a0b\u4e2d\uff0c\u6df1\u611f\u5230\u95ee\u9898\u5206\u4eab\u7684\u91cd\u8981\u6027\uff0c\u9047\u5230\u7684\u5927\u91cf\u95ee\u9898\uff0cGoogle \u57fa\u672c\u4e0a\u641c\u4e0d\u5230\uff0c\u4e2d\u6587\u76f8\u5173\u8d44\u6599\u4e5f\u5c31\u4e0a\u9762\u7684\u51e0\u7bc7\u6587\u7ae0\uff0c\u4f46\u770b\u8fc7\u4e4b\u540e\u53d1\u73b0\u90fd\u662f\u7b80\u7b80\u5355\u5355\u7684\u4ecb\u7ecd\u800c\u5df2\uff0c\u5e76\u6ca1\u6709\u8bb0\u5f55\u8be6\u7ec6\u7684\u90e8\u7f72\u8fc7\u7a0b\uff0c\u6240\u4ee5\uff0c\u6211\u57fa\u672c\u4e0a\u90fd\u662f\u770b\u7684 Gitlab \u5b98\u65b9\u5e2e\u52a9\u6587\u6863\uff0c\u4f46 Gitlab \u7684\u66f4\u65b0\u5f88\u9891\u7e41\uff0c\u6240\u4ee5\u6709\u4e9b\u5e2e\u52a9\u6587\u6863\u90fd\u6ca1\u8fdb\u884c\u66f4\u65b0\uff0c\u907f\u514d\u4e0d\u4e86\u8e29\u8fdb\u4e00\u4e9b\u5751\uff0c\u90a3\u600e\u4e48\u529e\u5462\uff1f\u89e3\u51b3\u65b9\u5f0f\u5c31\u662f\u4e0d\u65ad\u7684\u8fdb\u884c\u5c1d\u8bd5\uff0c\u6bd4\u5982\u6211\u914d\u7f6e<code>.gitlab-ci.yml<\/code>\u6587\u4ef6\u7684\u65f6\u5019\uff0c\u5c31\u4e0d\u65ad\u7684\u8fdb\u884c<code>code commit<\/code>\u6d4b\u8bd5\uff08\u4e00\u767e\u591a\u4e2a\u63d0\u4ea4\ud83d\ude02\uff09\uff1a<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/images2015.cnblogs.com\/blog\/435188\/201605\/435188-20160505145753669-139221853.png\" \/><\/p>\n<p>\u5e76\u4e14\u6709\u5148\u89c1\u4e4b\u660e\u7684\u628a\u95ee\u9898\u89e3\u51b3\u8fc7\u7a0b\uff0c\u90fd\u7528 Issue \u8fdb\u884c\u8bb0\u5f55\u4e86\ud83d\ude0f\uff1a<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/images2015.cnblogs.com\/blog\/435188\/201605\/435188-20160505150155263-1919562161.png\" \/><\/p>\n<p>\u4e0b\u9762\u5c31\u4ece\u4e0a\u9762\u8fd9\u51e0\u4e2a Issue \u8fdb\u884c\u5c55\u5f00\uff0c\u628a\u6bcf\u4e2a\u95ee\u9898\u548c\u89e3\u51b3\u8fc7\u7a0b\u90fd\u5206\u4eab\u51fa\u6765\uff0c\u5e0c\u671b\u53ef\u4ee5\u5e2e\u52a9\u5230\u9047\u5230\u76f8\u540c\u95ee\u9898\u7684\u56ed\u53cb\u3002<\/p>\n<h2 id=\"install-configue-gitlab-ci-multi-runner\">1. install configue gitlab-ci-multi-runner<\/h2>\n<p>GitLab \u90e8\u7f72 CI \u7684\u7b2c\u4e00\u6b65\u5c31\u662f\u5b89\u88c5 gitlab-ci-multi-runner\uff0c\u4f60\u53ef\u4ee5\u628a\u5b83\u7406\u89e3\u4e3a\uff1a\u8dd1 CI \u7684\u670d\u52a1\u3002<\/p>\n<p>windows \u5b89\u88c5\u6559\u7a0b\uff1a<a class=\"uri\" href=\"https:\/\/gitlab.com\/gitlab-org\/gitlab-ci-multi-runner\/blob\/master\/docs\/install\/windows.md\">https:\/\/gitlab.com\/gitlab-org\/gitlab-ci-multi-runner\/blob\/master\/docs\/install\/windows.md<\/a><\/p>\n<p>\u4e0b\u8f7d\u597d\u00a0<a href=\"https:\/\/gitlab-ci-multi-runner-downloads.s3.amazonaws.com\/latest\/binaries\/gitlab-ci-multi-runner-windows-amd64.exe\">gitlab-ci-multi-runner-windows-amd64.exe<\/a>\u00a0\u5b89\u88c5\u6587\u4ef6\u540e\uff0c\u5c06\u5b89\u88c5\u6587\u4ef6\u653e\u5728<code>C:\\Multi-Runner<\/code>\u4e0b\uff0c\u4ee5\u7ba1\u7406\u5458\u6743\u9650\u8fd0\u884c\u547d\u4ee4\u884c\uff0c\u5982\u679c<code>gitlab-ci-multi-runner<\/code>\u547d\u4ee4\u627e\u4e0d\u5230\uff0c\u76f4\u63a5\u7528<code>gitlab-ci-multi-runner-windows-amd64.exe<\/code>\u547d\u4ee4\u8fd0\u884c\u3002<\/p>\n<p>\u5728 Gitlab \u9879\u76ee\u4e2d\u6253\u5f00\u00a0<strong>Settings &gt; Runners<\/strong>\uff0c\u627e\u5230<code>URL<\/code>\u548c<code>token<\/code>\uff0c\u7b49\u4f1a\u5b89\u88c5\u7684\u65f6\u5019\u9700\u8981\u914d\u7f6e\u3002<\/p>\n<p>\u5b89\u88c5\u914d\u7f6e\u6b65\u9aa4\uff1a<\/p>\n<pre class=\"cmd\"><code class=\"hljs dos\"><span class=\"hljs-function\">C:\\<span class=\"hljs-title\">WINDOWS<\/span>\\<span class=\"hljs-title\">system32<\/span>&gt;<span class=\"hljs-title\">cd<\/span> <span class=\"hljs-title\">C<\/span>:\\<span class=\"hljs-title\">Multi<\/span>-<span class=\"hljs-title\">Runner<\/span>\n\n<span class=\"hljs-title\">C<\/span>:\\<span class=\"hljs-title\">Multi<\/span>-<span class=\"hljs-title\">Runner<\/span>&gt;<span class=\"hljs-title\">gitlab<\/span>-<span class=\"hljs-title\">ci<\/span>-<span class=\"hljs-title\">multi<\/span>-<span class=\"hljs-title\">runner<\/span>-<span class=\"hljs-title\">windows<\/span>-<span class=\"hljs-title\">amd64.exe<\/span> <span class=\"hljs-title\">register<\/span>\n<span class=\"hljs-title\">Please<\/span> <span class=\"hljs-title\">enter<\/span> <span class=\"hljs-title\">the<\/span> <span class=\"hljs-title\">gitlab<\/span>-<span class=\"hljs-title\">ci<\/span> <span class=\"hljs-title\">coordinator<\/span> <span class=\"hljs-title\">URL<\/span> (<span class=\"hljs-title\">e.g<\/span>. <span class=\"hljs-title\">https<\/span>:\/\/<span class=\"hljs-title\">gitlab.com<\/span>\/<span class=\"hljs-title\">ci<\/span>):\n<span class=\"hljs-title\">URL<\/span>\n<span class=\"hljs-title\">Please<\/span> <span class=\"hljs-title\">enter<\/span> <span class=\"hljs-title\">the<\/span> <span class=\"hljs-title\">gitlab<\/span>-<span class=\"hljs-title\">ci<\/span> <span class=\"hljs-title\">token<\/span> <span class=\"hljs-title\">for<\/span> <span class=\"hljs-title\">this<\/span> <span class=\"hljs-title\">runner<\/span>:\n<span class=\"hljs-title\">token<\/span>\n<span class=\"hljs-title\">Please<\/span> <span class=\"hljs-title\">enter<\/span> <span class=\"hljs-title\">the<\/span> <span class=\"hljs-title\">gitlab<\/span>-<span class=\"hljs-title\">ci<\/span> <span class=\"hljs-title\">description<\/span> <span class=\"hljs-title\">for<\/span> <span class=\"hljs-title\">this<\/span> <span class=\"hljs-title\">runner<\/span>:\n[<span class=\"hljs-title\">DESKTOP<\/span>-2<span class=\"hljs-title\">P9GHDD<\/span>]: <span class=\"hljs-title\">xishuai<\/span>-<span class=\"hljs-title\">ci<\/span>\n<span class=\"hljs-title\">Please<\/span> <span class=\"hljs-title\">enter<\/span> <span class=\"hljs-title\">the<\/span> <span class=\"hljs-title\">gitlab<\/span>-<span class=\"hljs-title\">ci<\/span> <span class=\"hljs-title\">tags<\/span> <span class=\"hljs-title\">for<\/span> <span class=\"hljs-title\">this<\/span> <span class=\"hljs-title\">runner<\/span> (<span class=\"hljs-title\">comma<\/span> <span class=\"hljs-title\">separated<\/span>):\n<span class=\"hljs-title\">dev<\/span>\n<span class=\"hljs-title\">Registering<\/span> <span class=\"hljs-title\">runner<\/span>... <span class=\"hljs-title\">succeeded<\/span>                     <span class=\"hljs-title\">runner<\/span>=<span class=\"hljs-title\">avuSXASJ<\/span>\n<span class=\"hljs-title\">Please<\/span> <span class=\"hljs-title\">enter<\/span> <span class=\"hljs-title\">the<\/span> <span class=\"hljs-title\">executor<\/span>: <span class=\"hljs-title\">docker<\/span>-<span class=\"hljs-title\">ssh<\/span>, <span class=\"hljs-title\">parallels<\/span>, <span class=\"hljs-title\">shell<\/span>, <span class=\"hljs-title\">ssh<\/span>, <span class=\"hljs-title\">virtualbox<\/span>, <span class=\"hljs-title\">docker<\/span>+<span class=\"hljs-title\">machine<\/span>, <span class=\"hljs-title\">docker<\/span>-<span class=\"hljs-title\">ssh<\/span>+<span class=\"hljs-title\">machine<\/span>, <span class=\"hljs-title\">docker<\/span>:\n<span class=\"hljs-title\">shell<\/span>\n<span class=\"hljs-title\">Runner<\/span> <span class=\"hljs-title\">registered<\/span> <span class=\"hljs-title\">successfully<\/span>. <span class=\"hljs-title\">Feel<\/span> <span class=\"hljs-title\">free<\/span> <span class=\"hljs-title\">to<\/span> <span class=\"hljs-title\">start<\/span> <span class=\"hljs-title\">it<\/span>, <span class=\"hljs-title\">but<\/span> <span class=\"hljs-title\">if<\/span> <span class=\"hljs-title\">it<\/span>'<span class=\"hljs-title\">s<\/span> <span class=\"hljs-title\">running<\/span> <span class=\"hljs-title\">already<\/span> <span class=\"hljs-title\">the<\/span> <span class=\"hljs-title\">config<\/span> <span class=\"hljs-title\">should<\/span> <span class=\"hljs-title\">be<\/span> <span class=\"hljs-title\">automatically<\/span> <span class=\"hljs-title\">reloaded<\/span>!<\/span><\/code><\/pre>\n<p>\u4e0a\u9762<code>executor: shell<\/code>\u662f\u9ed8\u8ba4\u914d\u7f6e\uff0c\u610f\u601d\u662f\u672c\u5730\u6267\u884c\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528<code>ssh<\/code>\u548c<code>docker<\/code>\uff0c\u4e0d\u8fc7\u9700\u8981\u589e\u52a0\u4e00\u4e9b\u8fdc\u7aef\u94fe\u63a5\u914d\u7f6e\u3002<\/p>\n<p>\u5b8c\u6210\u540e\uff0c\u4f1a\u5728<code>C:\\Multi-Runner<\/code>\u76ee\u5f55\u4e0b\uff0c\u751f\u6210\u4e00\u4e2a<code>config.toml<\/code>\u914d\u7f6e\u6587\u4ef6\uff0c\u6211\u4eec\u4e0a\u9762\u8f93\u5165\u7684\u914d\u7f6e\u4fe1\u606f\u4e5f\u90fd\u4f1a\u5728\u8fd9\u91cc\u9762\uff0c\u914d\u7f6e\u8bf4\u660e\uff1a<a class=\"uri\" href=\"https:\/\/gitlab.com\/gitlab-org\/gitlab-ci-multi-runner\/blob\/master\/docs\/configuration\/advanced-configuration.md\">https:\/\/gitlab.com\/gitlab-org\/gitlab-ci-multi-runner\/blob\/master\/docs\/configuration\/advanced-configuration.md<\/a><\/p>\n<p>\u505c\u6b62\uff0c\u8fd0\u884c\u548c\u9a8c\u8bc1\u547d\u4ee4\uff1a<\/p>\n<pre><code class=\"hljs yaml\"><span class=\"hljs-attr\">C:<\/span>\\Multi-Runner&gt;gitlab-ci-multi-runner-windows-amd64.exe stop\n\n<span class=\"hljs-attr\">C:<\/span>\\Multi-Runner&gt;gitlab-ci-multi-runner-windows-amd64.exe start\n\n<span class=\"hljs-attr\">C:<\/span>\\Multi-Runner&gt;gitlab-ci-multi-runner-windows-amd64.exe verify\nVerifying runner... is alive                        runner=<span class=\"hljs-number\">5<\/span>ae63365<\/code><\/pre>\n<p>\u5982\u679c\u8fd0\u884c<code>C:\\Multi-Runner&gt;gitlab-ci-multi-runner-windows-amd64.exe start<\/code>\u51fa\u73b0\u9519\u8bef\uff0c\u5219\u9700\u8981\u5c06<code>gitlab-ci-multi-runner-windows-amd64.exe<\/code>\u62f7\u8d1d\u4e00\u4efd\uff0c\u91cd\u547d\u540d\u4e3a<code>gitlab-ci-multi-runner.exe<\/code>\u3002<\/p>\n<p>\u53e6\u5916\uff0c Gitlab \u9879\u76ee\u00a0<strong>Settings &gt; Project Settings Features &gt; Builds<\/strong>\u00a0\u9009\u9879\u9700\u8981\u6253\u52fe\u3002<\/p>\n<p>gitlab-ci-multi-runner \u5b89\u88c5\u914d\u7f6e\u5b8c\u4e4b\u540e\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u5728 Gitlab \u9879\u76ee\u00a0<strong>Settings &gt; Runners<\/strong>\u00a0\u4e2d\uff0c\u770b\u5230 Runners \u7684\u4fe1\u606f\u4e86\u3002<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/images2015.cnblogs.com\/blog\/435188\/201605\/435188-20160505153302341-2007940860.png\" \/><\/p>\n<h2 id=\"restore-nuget-packages\">2. restore nuget packages<\/h2>\n<p>\u8fd9\u6b21\u4efb\u52a1\uff1a\u4f7f\u7528 CI\uff0c nuget \u8fd8\u539f\u89e3\u51b3\u65b9\u6848\u4e2d\u7684\u7a0b\u5e8f\u5305\u3002<\/p>\n<p>gitlab-ci-multi-runner \u5b89\u88c5\u914d\u7f6e\u5b8c\u4e4b\u540e\uff0c\u6211\u4eec\u8fd8\u9700\u8981\u5728 Gitlab \u9879\u76ee\u4e2d\u6dfb\u52a0\u4e00\u4e2a<code>.gitlab-ci.yml<\/code>\u6587\u4ef6\uff0c\u5b98\u65b9\u4ecb\u7ecd\uff1a<a class=\"uri\" href=\"http:\/\/doc.gitlab.com\/ee\/ci\/yaml\/README.html\">http:\/\/doc.gitlab.com\/ee\/ci\/yaml\/README.html<\/a><\/p>\n<p>\u56e0\u4e3a\u4e00\u5f00\u59cb\u6211\u5bf9<code>.gitlab-ci.yml<\/code>\u914d\u7f6e\u4e00\u70b9\u90fd\u4e0d\u4e86\u89e3\uff0c\u6240\u4ee5\uff0c\u6211\u5f53\u65f6\u6309\u7167\u8fd9\u4e2a\u6559\u7a0b\u00a0<a href=\"http:\/\/doc.gitlab.com\/ce\/ci\/quick_start\/README.html\">CI Quick Start<\/a>\uff0c\u6dfb\u52a0\u4e86\u5982\u4e0b\u7684<code>.gitlab-ci.yml<\/code>\u6587\u4ef6\u914d\u7f6e\uff1a<\/p>\n<div class=\"sourceCode\">\n<pre class=\"sourceCode yml\"><code class=\"sourceCode yaml hljs\"><span class=\"fu\"><span class=\"hljs-attr\">before_script:<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> apt-get update -qq &amp;&amp; apt-get install -y -qq sqlite3 libsqlite3-dev nodejs\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> ruby -v\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> which ruby\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> gem install bundler --<span class=\"hljs-literal\">no<\/span>-ri --<span class=\"hljs-literal\">no<\/span>-rdoc\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> bundle install --jobs $(nproc)  <span class=\"st\"><span class=\"hljs-string\">\"${FLAGS[@]}\"<\/span><\/span>\n\n<span class=\"fu\"><span class=\"hljs-attr\">rspec:<\/span><\/span>\n  <span class=\"fu\"><span class=\"hljs-attr\">script:<\/span><\/span>\n    <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> bundle exec rspec\n\n<span class=\"fu\"><span class=\"hljs-attr\">rubocop:<\/span><\/span>\n  <span class=\"fu\"><span class=\"hljs-attr\">script:<\/span><\/span>\n    <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> bundle exec rubocop<\/code><\/pre>\n<\/div>\n<p>\u6dfb\u52a0\u597d<code>.gitlab-ci.yml<\/code>\u6587\u4ef6\u914d\u7f6e\u540e\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u5728\u9879\u76ee\u4e2d\u7684\u00a0<strong>Builds<\/strong>\uff0c\u770b\u5230\u63d0\u4ea4\u540e\u7684\u6784\u5efa\u5de5\u4f5c\u4e86\uff0c\u968f\u4fbf\u5728 Gitlab \u9879\u76ee\u4e2d\u6dfb\u52a0\u4e00\u4e2a\u89e3\u51b3\u65b9\u6848\uff0c\u7136\u540e\u518d\u6dfb\u52a0\u4e00\u4e2a\u7c7b\u5e93\u9879\u76ee\uff0c\u5e76\u4e14\u4f7f\u7528 nuget \u5b89\u88c5\u4e00\u4e2a\u7a0b\u5e8f\u5305\uff0c\u6700\u540e\u4f7f\u7528 git \u63d0\u4ea4\u5230 Gitlab \u4e2d\uff0c\u5c31\u53ef\u4ee5\u770b\u5230\u00a0<strong>Builds<\/strong>\u00a0\u7684\u8fc7\u7a0b\u548c\u7ed3\u679c\u4e86\uff0c\u9996\u6b21\u63d0\u4ea4\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n<pre class=\"cmd\"><code class=\"hljs dos\">gitlab-ci-multi-runner <span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">3<\/span> (a470667)\nUsing Shell executor...\nRunning on DESKTOP-<span class=\"hljs-number\">2<\/span>P9GHDD...\nCloning repository...\n'\"git\"' \ufffd\ufffd\ufffd\ufffd\ufffd\u06b2\ufffd\ufffd\ufffd\ufffd\u2cbf\ufffd\ufffd\ufffd\ue8ec\u04b2\ufffd\ufffd\ufffd\u01ff\ufffd\ufffd\ufffd\ufffd\u0435\u0133\ufffd\ufffd\ufffd\n\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u013c\ufffd\ufffd\ufffd\n\u03f5\u0373\ufffd\u04b2\ufffd\ufffd\ufffd\u05b8\ufffd\ufffd\ufffd\ufffd\u00b7\ufffd\ufffd\ufffd\ufffd\nChecking out <span class=\"hljs-number\">2<\/span>f82ccb0 as master...\n'\"git\"' \ufffd\ufffd\ufffd\ufffd\ufffd\u06b2\ufffd\ufffd\ufffd\ufffd\u2cbf\ufffd\ufffd\ufffd\ue8ec\u04b2\ufffd\ufffd\ufffd\u01ff\ufffd\ufffd\ufffd\ufffd\u0435\u0133\ufffd\ufffd\ufffd\n\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u013c\ufffd\ufffd\ufffd\n<span class=\"hljs-function\">\nERROR: <span class=\"hljs-title\">Build<\/span> <span class=\"hljs-title\">failed<\/span>: <span class=\"hljs-title\">exit<\/span> <span class=\"hljs-title\">status<\/span> 9009<\/span><\/code><\/pre>\n<p>\u8fd9\u4e2a\u95ee\u9898\u641e\u4e86\u6211\u5f88\u4e45\uff0c\u56e0\u4e3a\u9519\u8bef\u4fe1\u606f\u4e71\u7801\u4e86\uff0c\u6839\u672c\u627e\u4e0d\u5230\u76f8\u5173\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u540e\u6765\u65e0\u610f\u95f4\u641c\u5230 Gitlab \u4e2d\u7684\u4e00\u4e2a Issue\uff0c\u91cc\u9762\u63d0\u5230\u4e86\u4e00\u4e2a<code>gitlab-ci-multi-runner --debug run<\/code>\u547d\u4ee4\uff0c\u610f\u601d\u662f\u8c03\u8bd5\u8fd0\u884c CI\uff0c\u8fd9\u6837\u6211\u4eec\u5c31\u53ef\u4ee5\u770b\u5230\u8be6\u7ec6\u7684\u9519\u8bef\u4fe1\u606f\u4e86\uff0cdebug \u7684\u9519\u8bef\u4fe1\u606f\u6bd4\u8f83\u591a\uff0c\u5e76\u4e14\u5b8c\u5168\u770b\u4e0d\u61c2\uff0c\u4e0d\u8fc7\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u00a0<strong>Builds<\/strong>\u00a0\u770b\u5230\u7b80\u6d01\u7684\u9519\u8bef\u65e5\u5fd7\uff1a<\/p>\n<pre class=\"cmd\"><code class=\"hljs dos\">gitlab-ci-multi-runner <span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">3<\/span> (a470667)\nUsing Shell executor...\nRunning on DESKTOP-<span class=\"hljs-number\">2<\/span>P9GHDD...\nCloning repository...\nCloning into 'C:\/Multi-Runner\/builds\/<span class=\"hljs-number\">500<\/span>c7a25\/<span class=\"hljs-number\">0<\/span>\/dev\/CNBlogsCI-Sample'...\n<span class=\"hljs-function\">fatal: <span class=\"hljs-title\">unable<\/span> <span class=\"hljs-title\">to<\/span> <span class=\"hljs-title\">access<\/span> '<span class=\"hljs-title\">https<\/span>:\/\/<span class=\"hljs-title\">gitlab<\/span>-<span class=\"hljs-title\">ci<\/span>-<span class=\"hljs-title\">token:xxxxxx<\/span>@<span class=\"hljs-title\">gitlab.com<\/span>\/<span class=\"hljs-title\">dev<\/span>\/<span class=\"hljs-title\">CNBlogsCI<\/span>-<span class=\"hljs-title\">Sample.git<\/span>\/': <span class=\"hljs-title\">error<\/span> <span class=\"hljs-title\">setting<\/span> <span class=\"hljs-title\">certificate<\/span> <span class=\"hljs-title\">verify<\/span> <span class=\"hljs-title\">locations<\/span>:\n  <span class=\"hljs-title\">CAfile<\/span>: <span class=\"hljs-title\">C<\/span>:\\<span class=\"hljs-title\">Multi<\/span>-<span class=\"hljs-title\">Runner<\/span>\\<span class=\"hljs-title\">builds<\/span>\\500<span class=\"hljs-title\">c7a25<\/span>\\0\\<span class=\"hljs-title\">dev<\/span>\\<span class=\"hljs-title\">CNBlogsCI<\/span>-<span class=\"hljs-title\">Sample.tmp<\/span>\\<span class=\"hljs-title\">GIT_SSL_CAINFO<\/span>\n  <span class=\"hljs-title\">CApath<\/span>: <span class=\"hljs-title\">none<\/span>\n<span class=\"hljs-title\">The<\/span> <span class=\"hljs-title\">system<\/span> <span class=\"hljs-title\">cannot<\/span> <span class=\"hljs-title\">find<\/span> <span class=\"hljs-title\">the<\/span> <span class=\"hljs-title\">path<\/span> <span class=\"hljs-title\">specified<\/span>.\n<span class=\"hljs-title\">Checking<\/span> <span class=\"hljs-title\">out<\/span> <span class=\"hljs-title\">ac05d090<\/span> <span class=\"hljs-title\">as<\/span> <span class=\"hljs-title\">master<\/span>...\n<span class=\"hljs-title\">fatal<\/span>: <span class=\"hljs-title\">Not<\/span> <span class=\"hljs-title\">a<\/span> <span class=\"hljs-title\">git<\/span> <span class=\"hljs-title\">repository<\/span> (<span class=\"hljs-title\">or<\/span> <span class=\"hljs-title\">any<\/span> <span class=\"hljs-title\">of<\/span> <span class=\"hljs-title\">the<\/span> <span class=\"hljs-title\">parent<\/span> <span class=\"hljs-title\">directories<\/span>): .<span class=\"hljs-title\">git<\/span>\n\n<span class=\"hljs-title\">ERROR<\/span>: <span class=\"hljs-title\">Build<\/span> <span class=\"hljs-title\">failed<\/span>: <span class=\"hljs-title\">exit<\/span> <span class=\"hljs-title\">status<\/span> 128<\/span><\/code><\/pre>\n<p>\u4e0a\u9762\u9519\u8bef\u65e5\u5fd7\u7684\u610f\u601d\u662f\uff0c\u6ca1\u6709<code>git clone repository<\/code>\u6210\u529f\uff0c\u5e76\u4e14\u6ca1\u6709\u6743\u9650\u8bbf\u95ee\uff0c\u540e\u6765 Google \u5230\u4e86\u4e00\u4e2a\u89e3\u51b3\u65b9\u6848\uff1a<a href=\"https:\/\/gitlab.com\/gitlab-org\/gitlab-ci-multi-runner\/issues\/1052\">error setting certificate verify locations<\/a><\/p>\n<p>\u89e3\u51b3\u65b9\u5f0f\uff1a<code>C:\\Multi-Runner\\config.toml<\/code>\u6587\u4ef6\u6dfb\u52a0<code>shell = 'powershell'<\/code>\u8282\u70b9\uff0c\u6dfb\u52a0\u5728<code>[[runners]]<\/code>\u8282\u70b9\u540e\u3002<\/p>\n<p>\u89e3\u51b3\u5b8c\u8fd9\u4e2a\u95ee\u9898\u4e4b\u540e\uff0c\u53bb\u7814\u7a76\u4e86\u4e0b<code>.gitlab-ci.yml<\/code>\u4e2d\u7684<code>nuget restore<\/code>\u914d\u7f6e\uff08Google \u641c\u7684\uff0c\u592a\u5751\uff09\uff0c\u5c06<code>.gitlab-ci.yml<\/code>\u6587\u4ef6\u4fee\u6539\u5982\u4e0b\uff1a<\/p>\n<div class=\"sourceCode\">\n<pre class=\"sourceCode yml\"><code class=\"sourceCode yaml hljs\"><span class=\"fu\"><span class=\"hljs-attr\">stages:<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> build\n\n<span class=\"fu\"><span class=\"hljs-attr\">job:<\/span><\/span>\n  <span class=\"fu\"><span class=\"hljs-attr\">stage:<\/span><\/span> build\n  <span class=\"fu\"><span class=\"hljs-attr\">script:<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> ls\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> echo <span class=\"st\"><span class=\"hljs-string\">\"Restoring NuGet Packages...\"<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> <span class=\"st\"><span class=\"hljs-string\">'\"C:\\Users\\xishuai\\.dnx\\packages\\ClassLibrary2\\2.0.0\\packages\\NuGet.CommandLine.2.8.5\\tools\\NuGet.exe\" restore \"src\/CNBlogsCI-Sample.sln\"'<\/span><\/span><\/code><\/pre>\n<\/div>\n<p><code>commit<\/code>\u63d0\u4ea4\u6d4b\u8bd5\uff0c\u51fa\u73b0\u4e0b\u9762\u7684\u9519\u8bef\u4fe1\u606f\uff1a<\/p>\n<pre class=\"cmd\"><code class=\"hljs dos\">gitlab-ci-multi-runner <span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">3<\/span> (a470667)\nUsing Shell executor...\n<span class=\"hljs-built_in\">At<\/span> C:\\Users\\xishuai\\AppData\\Local\\Temp\\build_script140243225\\script.ps1:<span class=\"hljs-number\">132<\/span> char:<span class=\"hljs-number\">105<\/span>\n+ ... <span class=\"hljs-number\">0<\/span>.<span class=\"hljs-number\">0<\/span>\\packages\\NuGet.CommandLine.<span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">8<\/span>.<span class=\"hljs-number\">5<\/span>\\tools\\NuGet.exe\" <span class=\"hljs-built_in\">restore<\/span> \"src\/CN ...\n+                                                           ~~~~~~~\nUnexpected token '<span class=\"hljs-built_in\">restore<\/span>' <span class=\"hljs-keyword\">in<\/span> expression or statement.\n    + CategoryInfo          : ParserError: (:) [], ParseException\n    + FullyQualifiedErrorId : UnexpectedToken\n<span class=\"hljs-function\">\n\nERROR: <span class=\"hljs-title\">Build<\/span> <span class=\"hljs-title\">failed<\/span>: <span class=\"hljs-title\">exit<\/span> <span class=\"hljs-title\">status<\/span> 1<\/span><\/code><\/pre>\n<p>\u4ece\u9519\u8bef\u4fe1\u606f\u4e2d\u53ef\u4ee5\u770b\u5230\uff0c\u6ca1\u6709\u8bc6\u522b<code>restore<\/code>\u547d\u4ee4\uff0c\u5565\u610f\u601d\uff1f\u8fd9\u4e2a\u95ee\u9898\u53c8\u641e\u4e86\u6211\u597d\u4e45\uff0cGoogle\u00a0<code>Unexpected token 'restore' in expression or statement.<\/code>\u00a0\u5173\u952e\u5b57\uff0c\u6bdb\u90fd\u641c\u4e0d\u5230\uff0c\u6ca1\u529e\u6cd5\uff0c\u540e\u6765\u53ea\u80fd\u66f4\u6362\u5173\u952e\u5b57\u641c\uff0c\u4f46\u641c\u5230\u7684\u4fe1\u606f\u51e4\u6bdb\u9e9f\u89d2\uff0c\u540e\u6765\u53c2\u8003\u641c\u6765\u7684\u8d44\u6599\uff0c\u5c06<code>.gitlab-ci.yml<\/code>\u6539\u4e3a\uff1a<\/p>\n<div class=\"sourceCode\">\n<pre class=\"sourceCode yml\"><code class=\"sourceCode yaml hljs\"><span class=\"fu\"><span class=\"hljs-attr\">stages:<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> build\n\n<span class=\"fu\"><span class=\"hljs-attr\">job:<\/span><\/span>\n  <span class=\"fu\"><span class=\"hljs-attr\">stage:<\/span><\/span> build\n  <span class=\"fu\"><span class=\"hljs-attr\">script:<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> ls\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> echo <span class=\"st\"><span class=\"hljs-string\">\"Restoring NuGet Packages...\"<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> <span class=\"st\"><span class=\"hljs-string\">'call \"%VS140COMNTOOLS%\\vsvars32.bat\"'<\/span><\/span>\n<span class=\"co\"><span class=\"hljs-comment\">#  - '\"C:\\Users\\xishuai\\.dnx\\packages\\ClassLibrary2\\2.0.0\\packages\\NuGet.CommandLine.2.8.5\\tools\\NuGet.exe\" restore \"src\\CNBlogsCI-Sample.sln\"'<\/span><\/span><\/code><\/pre>\n<\/div>\n<p>\u6216<\/p>\n<div class=\"sourceCode\">\n<pre class=\"sourceCode yml\"><code class=\"sourceCode yaml hljs\"><span class=\"fu\"><span class=\"hljs-attr\">before_script:<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> echo <span class=\"st\"><span class=\"hljs-string\">\"Restoring NuGet Packages...\"<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> <span class=\"st\"><span class=\"hljs-string\">'call \"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\Tools\\vsvars32.bat\"'<\/span><\/span><\/code><\/pre>\n<\/div>\n<p><code>%VS140COMNTOOLS%\\vsvars32.bat<\/code>\u00a0\u662f\u4ec0\u4e48\u9b3c\uff1f\u4e0d\u592a\u6e05\u695a\uff0c\u6beb\u65e0\u7591\u95ee\uff0c\u53c8\u51fa\u73b0\u4e86\u9519\u8bef\uff0c\u4fe1\u606f\u5982\u4e0b\uff1a<\/p>\n<pre class=\"cmd\"><code class=\"hljs dos\">gitlab-ci-multi-runner <span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">3<\/span> (a470667)\nUsing Shell executor...\nRunning on DESKTOP-<span class=\"hljs-number\">2<\/span>P9GHDD...\nFetching changes...\nHEAD is now <span class=\"hljs-built_in\">at<\/span> <span class=\"hljs-number\">3926803<\/span> Update .gitlab-ci.yml\nFrom https:\/\/gitlab.com\/dev\/CNBlogsCI-Sample\n   <span class=\"hljs-number\">3926803<\/span>..d8f10a7  master     -&gt; origin\/master\nChecking out d8f10a7c as master...\nPrevious HEAD position was <span class=\"hljs-number\">3926803<\/span>... Update .gitlab-ci.yml\nHEAD is now <span class=\"hljs-built_in\">at<\/span> d8f10a7... Update .gitlab-ci.yml\n$ ls\n<span class=\"hljs-function\">\n\n    Directory: <span class=\"hljs-title\">C<\/span>:\\<span class=\"hljs-title\">Multi<\/span>-<span class=\"hljs-title\">Runner<\/span>\\<span class=\"hljs-title\">builds<\/span>\\5<span class=\"hljs-title\">ae63365<\/span>\\0\\<span class=\"hljs-title\">dev<\/span>\\<span class=\"hljs-title\">CNBlogsCI<\/span>-<span class=\"hljs-title\">Sample<\/span>\n\n\n<span class=\"hljs-title\">Mode<\/span>                <span class=\"hljs-title\">LastWriteTime<\/span>         <span class=\"hljs-title\">Length<\/span> <span class=\"hljs-title\">Name<\/span>\n----                -------------         ------ ----\n<span class=\"hljs-title\">d<\/span>-----         5\/4\/2016  02:45 <span class=\"hljs-title\">PM<\/span>                <span class=\"hljs-title\">src<\/span>\n-<span class=\"hljs-title\">a<\/span>----         5\/4\/2016  02:45 <span class=\"hljs-title\">PM<\/span>             89 .<span class=\"hljs-title\">gitignore<\/span>\n-<span class=\"hljs-title\">a<\/span>----         5\/4\/2016  02:49 <span class=\"hljs-title\">PM<\/span>            527 .<span class=\"hljs-title\">gitlab<\/span>-<span class=\"hljs-title\">ci.yml<\/span>\n$ <span class=\"hljs-title\">echo<\/span> \"<span class=\"hljs-title\">Restoring<\/span> <span class=\"hljs-title\">NuGet<\/span> <span class=\"hljs-title\">Packages<\/span>...\"\n<span class=\"hljs-title\">Restoring<\/span> <span class=\"hljs-title\">NuGet<\/span> <span class=\"hljs-title\">Packages<\/span>...\n$ <span class=\"hljs-title\">call<\/span> \"%<span class=\"hljs-title\">VS140COMNTOOLS<\/span>%\\<span class=\"hljs-title\">vsvars32.bat<\/span>\"\n<span class=\"hljs-title\">call<\/span> : <span class=\"hljs-title\">The<\/span> <span class=\"hljs-title\">term<\/span> '<span class=\"hljs-title\">call<\/span>' <span class=\"hljs-title\">is<\/span> <span class=\"hljs-title\">not<\/span> <span class=\"hljs-title\">recognized<\/span> <span class=\"hljs-title\">as<\/span> <span class=\"hljs-title\">the<\/span> <span class=\"hljs-title\">name<\/span> <span class=\"hljs-title\">of<\/span> <span class=\"hljs-title\">a<\/span> <span class=\"hljs-title\">cmdlet<\/span>, <span class=\"hljs-title\">function<\/span>, <span class=\"hljs-title\">script<\/span> <span class=\"hljs-title\">file<\/span>, <span class=\"hljs-title\">or<\/span> <span class=\"hljs-title\">operable<\/span> <span class=\"hljs-title\">program<\/span>. <span class=\"hljs-title\">Check<\/span>\n<span class=\"hljs-title\">the<\/span> <span class=\"hljs-title\">spelling<\/span> <span class=\"hljs-title\">of<\/span> <span class=\"hljs-title\">the<\/span> <span class=\"hljs-title\">name<\/span>, <span class=\"hljs-title\">or<\/span> <span class=\"hljs-title\">if<\/span> <span class=\"hljs-title\">a<\/span> <span class=\"hljs-title\">path<\/span> <span class=\"hljs-title\">was<\/span> <span class=\"hljs-title\">included<\/span>, <span class=\"hljs-title\">verify<\/span> <span class=\"hljs-title\">that<\/span> <span class=\"hljs-title\">the<\/span> <span class=\"hljs-title\">path<\/span> <span class=\"hljs-title\">is<\/span> <span class=\"hljs-title\">correct<\/span> <span class=\"hljs-title\">and<\/span> <span class=\"hljs-title\">try<\/span> <span class=\"hljs-title\">again<\/span>.\n<span class=\"hljs-title\">At<\/span> <span class=\"hljs-title\">C<\/span>:\\<span class=\"hljs-title\">Users<\/span>\\<span class=\"hljs-title\">xishuai<\/span>\\<span class=\"hljs-title\">AppData<\/span>\\<span class=\"hljs-title\">Local<\/span>\\<span class=\"hljs-title\">Temp<\/span>\\<span class=\"hljs-title\">build_script250102679<\/span>\\<span class=\"hljs-title\">script.ps1<\/span>:132 <span class=\"hljs-title\">char<\/span>:3\n+   <span class=\"hljs-title\">call<\/span> \"%<span class=\"hljs-title\">VS140COMNTOOLS<\/span>%\\<span class=\"hljs-title\">vsvars32.bat<\/span>\"\n+   ~~~~\n    + <span class=\"hljs-title\">CategoryInfo<\/span>          : <span class=\"hljs-title\">ObjectNotFound<\/span>: (<span class=\"hljs-title\">call:String<\/span>) [], <span class=\"hljs-title\">ParentContainsErrorRecordException<\/span>\n    + <span class=\"hljs-title\">FullyQualifiedErrorId<\/span> : <span class=\"hljs-title\">CommandNotFoundException<\/span>\n\n\n<span class=\"hljs-title\">ERROR<\/span>: <span class=\"hljs-title\">Build<\/span> <span class=\"hljs-title\">failed<\/span>: <span class=\"hljs-title\">exit<\/span> <span class=\"hljs-title\">status<\/span> 1<\/span><\/code><\/pre>\n<p>\u4e5f\u662f\u6beb\u65e0\u5934\u7eea\u7684\u9519\u8bef\uff0c\u8fd9\u4e48\u529e\u5462\uff1f\u540e\u6765\u60f3\u60f3<code>nuget restore<\/code>\u59cb\u7ec8\u4e0d\u6210\u529f\uff0c\u80fd\u4e0d\u80fd\u6362\u4e2a\u547d\u4ee4\u5462\uff1f\u7a81\u7136\u60f3\u5230\u4e86 ASP.NET 5\uff0c\u8fd8\u539f\u7a0b\u5e8f\u5305\u4f7f\u7528\u7684\u662f<code>dnu restore<\/code>\u547d\u4ee4\uff0c\u90a3\u5c31\u5c1d\u8bd5\u4e0b\u5427\uff0c\u5c06\u89e3\u51b3\u65b9\u6848\u4e2d\u7684\u9879\u76ee\u5220\u6389\uff0c\u7136\u540e\u6dfb\u52a0 ASP.NET 5 \u9879\u76ee\uff0c<code>.gitlab-ci.yml<\/code>\u6539\u4e3a\uff1a<\/p>\n<div class=\"sourceCode\">\n<pre class=\"sourceCode yml\"><code class=\"sourceCode yaml hljs\"><span class=\"fu\"><span class=\"hljs-attr\">before_script:<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> echo <span class=\"st\"><span class=\"hljs-string\">\"Restoring NuGet Packages...\"<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> dnvm use <span class=\"hljs-number\">1.0<\/span><span class=\"hljs-number\">.0<\/span>-beta5 -r coreclr -a x64\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> dnu restore<\/code><\/pre>\n<\/div>\n<p>\u54c7\u585e\uff0c\u8fd9\u6b21\u7ec8\u4e8e\u6210\u529f\u4e86\uff08\u7a81\u7136\u6709\u79cd\u60f3\u54ed\u7684\u51b2\u52a8\ud83d\ude2d\uff09\uff0c\u65e5\u5fd7\u4fe1\u606f\uff1a<\/p>\n<pre class=\"cmd\"><code class=\"hljs dos\">Running on DESKTOP-<span class=\"hljs-number\">2<\/span>P9GHDD...\nFetching changes...\nHEAD is now <span class=\"hljs-built_in\">at<\/span> <span class=\"hljs-number\">33436<\/span>d8 test commit\nFrom https:\/\/gitlab.com\/dev\/CNBlogsCI-Sample\n   <span class=\"hljs-number\">33436<\/span>d8..c80b2d5  master     -&gt; origin\/master\nChecking out c80b2d5d as master...\nPrevious HEAD position was <span class=\"hljs-number\">33436<\/span>d8... test commit\nHEAD is now <span class=\"hljs-built_in\">at<\/span> c80b2d5... test commit\n$ <span class=\"hljs-built_in\">echo<\/span> \"Release build...\"\nRelease build...\n$ dnvm use <span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">0<\/span>.<span class=\"hljs-number\">0<\/span>-beta5 -r coreclr -a x64\nAdding C:\\Users\\xishuai\\.dnx\\runtimes\\dnx-coreclr-win-x64.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">0<\/span>.<span class=\"hljs-number\">0<\/span>-beta5\\bin to process <span class=\"hljs-built_in\">PATH<\/span>\n$ dnu <span class=\"hljs-built_in\">restore<\/span>\nMicrosoft .<span class=\"hljs-built_in\">NET<\/span> Development Utility CoreCLR-x64-<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">0<\/span>.<span class=\"hljs-number\">0<\/span>-beta5-<span class=\"hljs-number\">12103<\/span>\n\nRestoring packages <span class=\"hljs-keyword\">for<\/span> C:\\Multi-Runner\\builds\\<span class=\"hljs-number\">5<\/span>ae63365\\<span class=\"hljs-number\">0<\/span>\\dev\\CNBlogsCI-Sample\\src\\CNBlogsCI-Sample.ClassLibrary\\project.json\n  GET https:\/\/www.nuget.org\/api\/v2\/\n  OK https:\/\/www.nuget.org\/api\/v2\/ <span class=\"hljs-number\">5524<\/span>ms\n  GET http:\/\/nuget.cnitblog.com\/nuget\/Default\/\n  OK http:\/\/nuget.cnitblog.com\/nuget\/Default\/ <span class=\"hljs-number\">2406<\/span>ms\n  GET https:\/\/www.myget.org\/F\/aspnetvnext\/api\/v2\/\n  OK https:\/\/www.myget.org\/F\/aspnetvnext\/api\/v2\/ <span class=\"hljs-number\">5225<\/span>ms\n  CACHE https:\/\/www.nuget.org\/api\/v2\/\n  GET https:\/\/www.myget.org\/F\/aspnetmaster\/api\/v3\/index.json\n  OK https:\/\/www.myget.org\/F\/aspnetmaster\/api\/v3\/index.json <span class=\"hljs-number\">2938<\/span>ms\n  GET https:\/\/www.myget.org\/F\/xunit\/api\/v3\/index.json\n  OK https:\/\/www.myget.org\/F\/xunit\/api\/v3\/index.json <span class=\"hljs-number\">1976<\/span>ms\nWriting lock file C:\\Multi-Runner\\builds\\<span class=\"hljs-number\">5<\/span>ae63365\\<span class=\"hljs-number\">0<\/span>\\dev\\CNBlogsCI-Sample\\src\\CNBlogsCI-Sample.ClassLibrary\\project.lock.json\n<span class=\"hljs-built_in\">Restore<\/span> complete, <span class=\"hljs-number\">18775<\/span>ms elapsed\n\nBuild succeeded<\/code><\/pre>\n<p>\u867d\u7136 ASP.NET 5 \u8fd8\u539f\u7a0b\u5e8f\u5305\u6210\u529f\u4e86\uff0c\u4f46\u4f9d\u65e7\u89e3\u51b3\u4e0d\u4e86\u95ee\u9898\u554a\uff0c\u56e0\u4e3a\u5fc5\u987b\u5f97\u89e3\u51b3<code>nuget restore<\/code>\u7684\u95ee\u9898\uff0c\u56e0\u4e3a\u5f88\u591a\u9879\u76ee\u90fd\u6ca1\u7528 ASP.NET 5\uff0c\u600e\u4e48\u529e\u5462\uff1f\u53c8\u56de\u5230\u4e86\u51fa\u53d1\u70b9\uff0c\u95ee\u9898\u80fd\u78e8\u6b7b\u4eba\u554a\uff0c\u8fc7\u7a0b\u5c31\u4e0d\u53d9\u8ff0\u4e86\uff0c\u540e\u6765\u65e0\u610f\u95f4\u5c06<code>.gitlab-ci.yml<\/code>\u6539\u4e3a\uff1a<\/p>\n<div class=\"sourceCode\">\n<pre class=\"sourceCode yml\"><code class=\"sourceCode yaml hljs\"><span class=\"fu\"><span class=\"hljs-attr\">before_script:<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> echo <span class=\"st\"><span class=\"hljs-string\">\"Restoring NuGet Packages...\"<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-attr\">-<\/span><\/span> <span class=\"fu\"><span class=\"hljs-attr\">C:<\/span><\/span>\\Program Files (x86)\\NuGet\\nuget.exe restore src\/CNBlogsCI-Sample.sln<\/code><\/pre>\n<\/div>\n<p>\u4ed4\u7ec6\u770b\u770b\u548c\u4e0a\u9762\u7684\u914d\u7f6e\u6709\u4ec0\u4e48\u4e0d\u540c\uff0c\u6211\u628a<code>'\"<\/code>\u53bb\u6389\u4e86\uff0c<code>commit<\/code>\u4ee3\u7801\u6d4b\u8bd5\uff0c\u51fa\u73b0\u4e86\u4e0b\u9762\u548c\u4e00\u5f00\u59cb\u4e0d\u4e00\u6837\u7684\u9519\u8bef\uff08\u6709\u620f\u4e86\ud83d\ude0f\uff09\uff1a<\/p>\n<pre class=\"cmd\"><code class=\"hljs dos\">gitlab-ci-multi-runner <span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">3<\/span> (a470667)\nUsing Shell executor...\nRunning on DESKTOP-<span class=\"hljs-number\">2<\/span>P9GHDD...\nFetching changes...\nRemoving src\/ClassLibrary1\/bin\/\nRemoving src\/ClassLibrary1\/obj\/\nHEAD is now <span class=\"hljs-built_in\">at<\/span> <span class=\"hljs-number\">191<\/span>e7e0 test commit\nFrom https:\/\/gitlab.com\/dev\/CNBlogsCI-Sample\n   <span class=\"hljs-number\">191<\/span>e7e0..feebdef  master     -&gt; origin\/master\nChecking out feebdefb as master...\nPrevious HEAD position was <span class=\"hljs-number\">191<\/span>e7e0... test commit\nHEAD is now <span class=\"hljs-built_in\">at<\/span> feebdef... test commit\n$ <span class=\"hljs-built_in\">echo<\/span> \"Restoring NuGet Packages...\"\nRestoring NuGet Packages...\n$ C:\\Program Files (x86)\\NuGet\\nuget.exe <span class=\"hljs-built_in\">restore<\/span> src\/CNBlogsCI-Sample.sln\nx86 : The term 'x86' is <span class=\"hljs-keyword\">not<\/span> recognized as the name of a cmdlet, function, script file, or operable program. Check the\nspelling of the name, or <span class=\"hljs-keyword\">if<\/span> a <span class=\"hljs-built_in\">path<\/span> was included, <span class=\"hljs-built_in\">verify<\/span> that the <span class=\"hljs-built_in\">path<\/span> is correct and try again.\n<span class=\"hljs-built_in\">At<\/span> C:\\Users\\xishuai\\AppData\\Local\\Temp\\build_script166211738\\script.ps1:<span class=\"hljs-number\">128<\/span> char:<span class=\"hljs-number\">21<\/span>\n+   C:\\Program Files (x86)\\NuGet\\nuget.exe <span class=\"hljs-built_in\">restore<\/span> src\/CNBlogsCI-Sample ...\n+                     ~~~\n    + CategoryInfo          : ObjectNotFound: (x86:String) [], ParentContainsErrorRecordException\n    + FullyQualifiedErrorId : CommandNotFoundException\n<span class=\"hljs-function\">\n\nERROR: <span class=\"hljs-title\">Build<\/span> <span class=\"hljs-title\">failed<\/span>: <span class=\"hljs-title\">exit<\/span> <span class=\"hljs-title\">status<\/span> 1<\/span><\/code><\/pre>\n<p>\u6839\u636e\u4e0a\u9762\u7684\u9519\u8bef\u65e5\u5fd7\uff0c\u53ef\u4ee5\u770b\u5230\uff0c\u5c31\u662f\u76ee\u5f55\u4e2d\u7684<code>x86<\/code>\u95ee\u9898\uff0c\u7136\u540e\u6211\u628a\u76ee\u5f55\u6539\u4e3a<code>C:\\Program Files\\NuGet\\nuget.exe<\/code>\u4e4b\u540e\uff08<code>nuget.exe<\/code>\u62f7\u8d1d\u5230\u76f8\u5e94\u76ee\u5f55\u4e0b\uff09\uff0c\u8fd8\u662f\u6709\u95ee\u9898\uff0c\u7136\u540e\u5c31\u76f4\u63a5\u653e\u5728<code>C<\/code>\u76d8\u76ee\u5f55\u4e0b\uff0c\u7ec8\u4e8e<code>build<\/code>\u6210\u529f\uff08\u773c\u6cea\u593a\u7736\u800c\u51fa\ud83d\ude02\uff09\u3002<\/p>\n<p><code>.gitlab-ci.yml<\/code>\u914d\u7f6e\uff1a<\/p>\n<div class=\"sourceCode\">\n<pre class=\"sourceCode yml\"><code class=\"sourceCode yaml hljs\"><span class=\"fu\"><span class=\"hljs-attr\">before_script:<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> echo <span class=\"st\"><span class=\"hljs-string\">\"Restoring NuGet Packages...\"<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-attr\">-<\/span><\/span> <span class=\"fu\"><span class=\"hljs-attr\">C:<\/span><\/span>\\NuGet\\nuget.exe restore <span class=\"hljs-string\">\"src\\CNBlogsCI-Sample.sln\"<\/span><\/code><\/pre>\n<\/div>\n<p><code>build<\/code>\u6210\u529f\u65e5\u5fd7\uff1a<\/p>\n<pre class=\"cmd\"><code class=\"hljs dos\">gitlab-ci-multi-runner <span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">3<\/span> (a470667)\nUsing Shell executor...\nRunning on DESKTOP-<span class=\"hljs-number\">2<\/span>P9GHDD...\nFetching changes...\nHEAD is now <span class=\"hljs-built_in\">at<\/span> <span class=\"hljs-number\">1<\/span>ac80d7 test commit\nFrom https:\/\/gitlab.com\/dev\/CNBlogsCI-Sample\n   <span class=\"hljs-number\">1<\/span>ac80d7..<span class=\"hljs-number\">683<\/span>a8bc  master     -&gt; origin\/master\nChecking out <span class=\"hljs-number\">683<\/span>a8bcb as master...\nPrevious HEAD position was <span class=\"hljs-number\">1<\/span>ac80d7... test commit\nHEAD is now <span class=\"hljs-built_in\">at<\/span> <span class=\"hljs-number\">683<\/span>a8bc... test commit\n$ <span class=\"hljs-built_in\">echo<\/span> \"Restoring NuGet Packages...\"\nRestoring NuGet Packages...\n$ C:\\NuGet\\nuget.exe <span class=\"hljs-built_in\">restore<\/span> \"src\\CNBlogsCI-Sample.sln\"\nInstalling 'AutoMapper <span class=\"hljs-number\">4<\/span>.<span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">1<\/span>'.\nSuccessfully installed 'AutoMapper <span class=\"hljs-number\">4<\/span>.<span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">1<\/span>'.\n\nBuild succeeded<\/code><\/pre>\n<p>\u770b\u4f3c\u7b80\u5355\u7684\u7ed3\u679c\uff0c\u4f46\u8fc7\u7a0b\u771f\u662f\u592a\u626f\u86cb\u4e86\uff0c\u5982\u679c\u6211\u5f53\u65f6\u770b\u5230\u7c7b\u4f3c\u8fd9\u7bc7\u535a\u6587\u5206\u4eab\uff0c\u4e5f\u4e0d\u81f3\u4e8e\u5982\u6b64\uff0c\u8fd8\u6ca1\u5b8c\uff0c\u7ee7\u7eed\u3002\u3002\u3002<\/p>\n<h2 id=\"build-.sln\">3. build *.sln<\/h2>\n<p>\u8fd9\u6b21\u4efb\u52a1\uff1a\u4f7f\u7528 CI\uff0c build \u751f\u6210\u89e3\u51b3\u65b9\u6848\u4e2d\u7684\u9879\u76ee\u3002<\/p>\n<p>\u751f\u6210\u89e3\u51b3\u65b9\u6848\u7684\u95ee\u9898\u89e3\u51b3\u8fc7\u7a0b\u76f8\u5bf9\u7b80\u5355\u4e9b\uff0c\u4e0d\u8fc7\u4e0a\u9762\u6f0f\u6389\u4e86\u4e00\u5904\uff0c\u8fd9\u8fb9\u518d\u8865\u5145\u4e0b\uff0c<code>.gitlab-ci.yml<\/code>\u914d\u7f6e\uff1a<\/p>\n<div class=\"sourceCode\">\n<pre class=\"sourceCode yml\"><code class=\"sourceCode yaml hljs\"><span class=\"fu\"><span class=\"hljs-attr\">stages:<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> build\n\n<span class=\"fu\"><span class=\"hljs-attr\">job:<\/span><\/span>\n  <span class=\"fu\"><span class=\"hljs-attr\">stage:<\/span><\/span> build\n  <span class=\"fu\"><span class=\"hljs-attr\">script:<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> echo <span class=\"st\"><span class=\"hljs-string\">\"Release build...\"<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-attr\">-<\/span><\/span> <span class=\"fu\"><span class=\"hljs-attr\">C:<\/span><\/span>\\Windows\\Microsoft.NET\\Framework64\\v4<span class=\"hljs-number\">.0<\/span><span class=\"hljs-number\">.30319<\/span>\\msbuild.exe \/consoleloggerparameters:ErrorsOnly \/maxcpucount \/nologo \/property:Configuration=Release \/verbosity:quiet <span class=\"hljs-string\">\"CNBlogsCI-Sample.sln\"<\/span>\n  <span class=\"fu\"><span class=\"hljs-attr\">tags:<\/span><\/span>\n  <span class=\"fu\"><span class=\"hljs-attr\">except:<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> tags<\/code><\/pre>\n<\/div>\n<p>\u9519\u8bef\u65e5\u5fd7\uff1a<\/p>\n<pre class=\"cmd\"><code class=\"hljs dos\">gitlab-ci-multi-runner <span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">3<\/span> (a470667)\nUsing Shell executor...\nRunning on DESKTOP-<span class=\"hljs-number\">2<\/span>P9GHDD...\nFetching changes...\nHEAD is now <span class=\"hljs-built_in\">at<\/span> <span class=\"hljs-number\">07<\/span>a6ffd Merge branch 'master' of gitlab.com:dev\/CNBlogsCI-Sample\nFrom https:\/\/gitlab.com\/dev\/CNBlogsCI-Sample\n   <span class=\"hljs-number\">07<\/span>a6ffd..<span class=\"hljs-number\">73<\/span>bd820  master     -&gt; origin\/master\nChecking out <span class=\"hljs-number\">73<\/span>bd8207 as master...\nPrevious HEAD position was <span class=\"hljs-number\">07<\/span>a6ffd... Merge branch 'master' of gitlab.com:dev\/CNBlogsCI-Sample\nHEAD is now <span class=\"hljs-built_in\">at<\/span> <span class=\"hljs-number\">73<\/span>bd820... test commit\n$ <span class=\"hljs-built_in\">echo<\/span> \"Release build...\"\nRelease build...\n$ C:\\Windows\\Microsoft.<span class=\"hljs-built_in\">NET<\/span>\\Framework64\\v4.<span class=\"hljs-number\">0<\/span>.<span class=\"hljs-number\">30319<\/span>\\msbuild.exe \/consoleloggerparameters:ErrorsOnly \/maxcpucount \/nologo \/property:Configuration=Release \/verbosity:quiet \"CNBlogsCI-Sample.sln\"\nMSBUILD : error MSB1009: \ufffd\ufffd\u013f\ufffd\u013c\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u06a1\ufffd\n\ufffd\ufffd\ufffd\ufffd: CNBlogsCI-Sample.sln\n<span class=\"hljs-function\">\nERROR: <span class=\"hljs-title\">Build<\/span> <span class=\"hljs-title\">failed<\/span>: <span class=\"hljs-title\">exit<\/span> <span class=\"hljs-title\">status<\/span> 1<\/span><\/code><\/pre>\n<p>\u8fd9\u4e2a\u9519\u8bef\u548c\u6700\u5f00\u59cb\u7684\u4e71\u7801\u9519\u8bef\u4e00\u6837\uff0c\u672a\u77e5\u7684\u9519\u8bef\uff0c\u65e0\u4ece\u4e0b\u624b\uff0c\u540e\u6765\uff0c\u53c8\u65e0\u610f\u95f4\u641c\u5230\u4e86\u4e00\u4e2a Gitlab Issue\uff08\u597d\u591a\u65e0\u610f\u95f4\ud83d\ude04\uff0c\u6ca1\u529e\u6cd5\uff0cGoogle \u53ea\u80fd\u641c\u7d22\u6240\u6709\u53ef\u80fd\u7684\u5173\u952e\u5b57\uff09\uff1a<a href=\"https:\/\/gitlab.com\/gitlab-org\/gitlab-ci-multi-runner\/issues\/1158\">Question about local project path<\/a><\/p>\n<p><code>.gitlab-ci.yml<\/code>\u914d\u7f6e\u6539\u4e3a\uff1a<\/p>\n<div class=\"sourceCode\">\n<pre class=\"sourceCode yml\"><code class=\"sourceCode yaml hljs\"><span class=\"fu\"><span class=\"hljs-attr\">stages:<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> build\n\n<span class=\"fu\"><span class=\"hljs-attr\">job:<\/span><\/span>\n  <span class=\"fu\"><span class=\"hljs-attr\">stage:<\/span><\/span> build\n  <span class=\"fu\"><span class=\"hljs-attr\">script:<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> ls\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> echo <span class=\"st\"><span class=\"hljs-string\">\"Release build...\"<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-attr\">-<\/span><\/span> <span class=\"fu\"><span class=\"hljs-attr\">C:<\/span><\/span>\\Windows\\Microsoft.NET\\Framework64\\v4<span class=\"hljs-number\">.0<\/span><span class=\"hljs-number\">.30319<\/span>\\msbuild.exe \/consoleloggerparameters:ErrorsOnly \/maxcpucount \/nologo \/property:Configuration=Release \/verbosity:quiet <span class=\"hljs-string\">\"CNBlogsCI-Sample.sln\"<\/span>\n  <span class=\"fu\"><span class=\"hljs-attr\">tags:<\/span><\/span>\n  <span class=\"fu\"><span class=\"hljs-attr\">except:<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> tags<\/code><\/pre>\n<\/div>\n<p>\u7136\u540e\u770b\u5230\u4e86\u8be6\u7ec6\u9519\u8bef\uff08\u53c8\u6709\u620f\u4e86\ud83d\ude0f\uff09\uff1a<\/p>\n<pre class=\"cmd\"><code class=\"hljs dos\">gitlab-ci-multi-runner <span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">3<\/span> (a470667)\nUsing Shell executor...\nRunning on DESKTOP-<span class=\"hljs-number\">2<\/span>P9GHDD...\nFetching changes...\nHEAD is now <span class=\"hljs-built_in\">at<\/span> eb2ec26 Update .gitlab-ci.yml\nChecking out eb2ec265 as master...\nHEAD is now <span class=\"hljs-built_in\">at<\/span> eb2ec26... Update .gitlab-ci.yml\n$ ls\n<span class=\"hljs-function\">\n\n    Directory: <span class=\"hljs-title\">C<\/span>:\\<span class=\"hljs-title\">Multi<\/span>-<span class=\"hljs-title\">Runner<\/span>\\<span class=\"hljs-title\">builds<\/span>\\5<span class=\"hljs-title\">ae63365<\/span>\\0\\<span class=\"hljs-title\">dev<\/span>\\<span class=\"hljs-title\">CNBlogsCI<\/span>-<span class=\"hljs-title\">Sample<\/span>\n\n\n<span class=\"hljs-title\">Mode<\/span>                <span class=\"hljs-title\">LastWriteTime<\/span>         <span class=\"hljs-title\">Length<\/span> <span class=\"hljs-title\">Name<\/span>\n----                -------------         ------ ----\n<span class=\"hljs-title\">d<\/span>-----         5\/4\/2016  10:26 <span class=\"hljs-title\">AM<\/span>                <span class=\"hljs-title\">src<\/span>\n-<span class=\"hljs-title\">a<\/span>----         5\/4\/2016  11:19 <span class=\"hljs-title\">AM<\/span>            315 .<span class=\"hljs-title\">gitlab<\/span>-<span class=\"hljs-title\">ci.yml<\/span>\n$ <span class=\"hljs-title\">echo<\/span> \"<span class=\"hljs-title\">Release<\/span> <span class=\"hljs-title\">build<\/span>...\"\n<span class=\"hljs-title\">Release<\/span> <span class=\"hljs-title\">build<\/span>...\n$ <span class=\"hljs-title\">C<\/span>:\\<span class=\"hljs-title\">Windows<\/span>\\<span class=\"hljs-title\">Microsoft.NET<\/span>\\<span class=\"hljs-title\">Framework64<\/span>\\<span class=\"hljs-title\">v4<\/span>.0.30319\\<span class=\"hljs-title\">msbuild.exe<\/span> \/<span class=\"hljs-title\">consoleloggerparameters:ErrorsOnly<\/span> \/<span class=\"hljs-title\">maxcpucount<\/span> \/<span class=\"hljs-title\">nologo<\/span> \/<span class=\"hljs-title\">property:Configuration<\/span>=<span class=\"hljs-title\">Release<\/span> \/<span class=\"hljs-title\">verbosity:quiet<\/span> \"<span class=\"hljs-title\">CNBlogsCI<\/span>-<span class=\"hljs-title\">Sample.sln<\/span>\"\n<span class=\"hljs-title\">MSBUILD<\/span> : <span class=\"hljs-title\">error<\/span> <span class=\"hljs-title\">MSB1009<\/span>: <span class=\"hljs-title\">Project<\/span> <span class=\"hljs-title\">file<\/span> <span class=\"hljs-title\">does<\/span> <span class=\"hljs-title\">not<\/span> <span class=\"hljs-title\">exist<\/span>.\n<span class=\"hljs-title\">Switch<\/span>: <span class=\"hljs-title\">CNBlogsCI<\/span>-<span class=\"hljs-title\">Sample.sln<\/span>\n\n\n\n<span class=\"hljs-title\">ERROR<\/span>: <span class=\"hljs-title\">Build<\/span> <span class=\"hljs-title\">failed<\/span>: <span class=\"hljs-title\">exit<\/span> <span class=\"hljs-title\">status<\/span> 1<\/span><\/code><\/pre>\n<p><code>error MSB1009: Project file does not exist.<\/code>\u8fd9\u4e2a\u9519\u8bef\u5c31\u5f88\u6e05\u6670\u4e86\uff0c\u9879\u76ee\u6587\u4ef6\u627e\u4e0d\u5230\uff0c\u4e5f\u5c31\u662f\u6ca1\u6709\u627e\u5230<code>CNBlogsCI-Sample.sln<\/code>\uff0c\u600e\u4e48\u4f1a\u5462\uff1f\u91cd\u65b0\u67e5\u770b\u4e86 Gitlab \u4e2d\u7684\u9879\u76ee\u6587\u4ef6\u76ee\u5f55\uff0c<code>CNBlogsCI-Sample.sln<\/code>\u5728\u6839\u76ee\u5f55\u4e0b\u7684<code>src<\/code>\u76ee\u5f55\u4e0b\uff0c\u91cd\u65b0\u4fee\u6539\u4e0b<code>.gitlab-ci.yml<\/code>\u914d\u7f6e\uff1a<\/p>\n<div class=\"sourceCode\">\n<pre class=\"sourceCode yml\"><code class=\"sourceCode yaml hljs\"><span class=\"fu\"><span class=\"hljs-attr\">stages:<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> build\n\n<span class=\"fu\"><span class=\"hljs-attr\">job:<\/span><\/span>\n  <span class=\"fu\"><span class=\"hljs-attr\">stage:<\/span><\/span> build\n  <span class=\"fu\"><span class=\"hljs-attr\">script:<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> ls\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> echo <span class=\"st\"><span class=\"hljs-string\">\"Release build...\"<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-attr\">-<\/span><\/span> <span class=\"fu\"><span class=\"hljs-attr\">C:<\/span><\/span>\\Windows\\Microsoft.NET\\Framework64\\v4<span class=\"hljs-number\">.0<\/span><span class=\"hljs-number\">.30319<\/span>\\msbuild.exe \/consoleloggerparameters:ErrorsOnly \/maxcpucount \/nologo \/property:Configuration=Release \/verbosity:quiet <span class=\"hljs-string\">\"src\/CNBlogsCI-Sample.sln\"<\/span>\n  <span class=\"fu\"><span class=\"hljs-attr\">tags:<\/span><\/span>\n  <span class=\"fu\"><span class=\"hljs-attr\">except:<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> tags<\/code><\/pre>\n<\/div>\n<p><code>build<\/code>\u6210\u529f\uff0c\u65e5\u5fd7\u8be6\u60c5\uff1a<\/p>\n<pre class=\"cmd\"><code class=\"hljs dos\">gitlab-ci-multi-runner <span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">3<\/span> (a470667)\nUsing Shell executor...\nRunning on DESKTOP-<span class=\"hljs-number\">2<\/span>P9GHDD...\nFetching changes...\nHEAD is now <span class=\"hljs-built_in\">at<\/span> a51aeea test commit\nFrom https:\/\/gitlab.com\/dev\/CNBlogsCI-Sample\n   a51aeea..<span class=\"hljs-number\">170<\/span>fbc4  master     -&gt; origin\/master\nChecking out <span class=\"hljs-number\">170<\/span>fbc4a as master...\nPrevious HEAD position was a51aeea... test commit\nHEAD is now <span class=\"hljs-built_in\">at<\/span> <span class=\"hljs-number\">170<\/span>fbc4... test commit\n$ ls\n<span class=\"hljs-function\">\n\n    Directory: <span class=\"hljs-title\">C<\/span>:\\<span class=\"hljs-title\">Multi<\/span>-<span class=\"hljs-title\">Runner<\/span>\\<span class=\"hljs-title\">builds<\/span>\\5<span class=\"hljs-title\">ae63365<\/span>\\0\\<span class=\"hljs-title\">dev<\/span>\\<span class=\"hljs-title\">CNBlogsCI<\/span>-<span class=\"hljs-title\">Sample<\/span>\n\n\n<span class=\"hljs-title\">Mode<\/span>                <span class=\"hljs-title\">LastWriteTime<\/span>         <span class=\"hljs-title\">Length<\/span> <span class=\"hljs-title\">Name<\/span>\n----                -------------         ------ ----\n<span class=\"hljs-title\">d<\/span>-----         5\/4\/2016  11:38 <span class=\"hljs-title\">AM<\/span>                <span class=\"hljs-title\">src<\/span>\n-<span class=\"hljs-title\">a<\/span>----         5\/4\/2016  11:38 <span class=\"hljs-title\">AM<\/span>            319 .<span class=\"hljs-title\">gitlab<\/span>-<span class=\"hljs-title\">ci.yml<\/span>\n$ <span class=\"hljs-title\">echo<\/span> \"<span class=\"hljs-title\">Release<\/span> <span class=\"hljs-title\">build<\/span>...\"\n<span class=\"hljs-title\">Release<\/span> <span class=\"hljs-title\">build<\/span>...\n$ <span class=\"hljs-title\">C<\/span>:\\<span class=\"hljs-title\">Windows<\/span>\\<span class=\"hljs-title\">Microsoft.NET<\/span>\\<span class=\"hljs-title\">Framework64<\/span>\\<span class=\"hljs-title\">v4<\/span>.0.30319\\<span class=\"hljs-title\">msbuild.exe<\/span> \/<span class=\"hljs-title\">consoleloggerparameters:ErrorsOnly<\/span> \/<span class=\"hljs-title\">maxcpucount<\/span> \/<span class=\"hljs-title\">nologo<\/span> \/<span class=\"hljs-title\">property:Configuration<\/span>=<span class=\"hljs-title\">Release<\/span> \/<span class=\"hljs-title\">verbosity:quiet<\/span> \"<span class=\"hljs-title\">src<\/span>\/<span class=\"hljs-title\">CNBlogsCI<\/span>-<span class=\"hljs-title\">Sample.sln<\/span>\"\n\n\n\n<span class=\"hljs-title\">Build<\/span> <span class=\"hljs-title\">succeeded<\/span><\/span><\/code><\/pre>\n<h2 id=\"run-unit-tests\">4. run unit tests<\/h2>\n<p>\u8fd9\u6b21\u4efb\u52a1\uff1a\u4f7f\u7528 CI\uff0c run \u8dd1\u89e3\u51b3\u65b9\u6848\u4e2d\u7684\u5355\u5143\u6d4b\u8bd5\uff0c\u53ef\u4ee5\u6210\u4e3a\u81ea\u52a8\u5316\u6d4b\u8bd5\u3002<\/p>\n<p>\u8fd9\u6b21\u57fa\u672c\u4e0a\u6ca1\u6709\u4ec0\u4e48\u95ee\u9898\u89e3\u51b3\u8fc7\u7a0b\uff0c\u56e0\u4e3a Google \u5b8c\u5168\u641c\u4e0d\u5230\u76f8\u5173\u8d44\u6599\uff0c\u6240\u4ee5\uff0c\u6211\u6700\u540e\u662f\u6309\u7167\u6211\u7684\u60f3\u6cd5\u5b9e\u73b0\u7684\uff0cxUnit \u9664\u4e86\u7528 VS2015 \u8fdb\u884c\u8dd1\u5355\u5143\u6d4b\u8bd5\u5916\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u7528\u547d\u4ee4\u884c\u7684\u65b9\u5f0f\uff0c\u6253\u5f00\u00a0<code>cmd<\/code>\u00a0\u8f93\u5165\uff1a<code>C:\\xunit.runner.console\\tools\\xunit.console.exe \"src\\ClassLibrary2\\bin\\debug\\ClassLibrary2.dll\"<\/code>\uff0c\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n<pre class=\"cmd\"><code class=\"hljs dos\"><span class=\"hljs-function\">C:\\<span class=\"hljs-title\">Users<\/span>\\<span class=\"hljs-title\">xishuai<\/span>\\<span class=\"hljs-title\">Desktop<\/span>\\<span class=\"hljs-title\">CNBlogs<\/span>\\<span class=\"hljs-title\">CNBlogsCI<\/span>-<span class=\"hljs-title\">Sample<\/span>\\<span class=\"hljs-title\">src<\/span>&gt; <span class=\"hljs-title\">C<\/span>:\\<span class=\"hljs-title\">xunit.runner.console<\/span>\\<span class=\"hljs-title\">tools<\/span>\\<span class=\"hljs-title\">xunit.console.exe<\/span> \"<span class=\"hljs-title\">src<\/span>\\<span class=\"hljs-title\">ClassLibrary2<\/span>\\<span class=\"hljs-title\">bin<\/span>\\<span class=\"hljs-title\">debug<\/span>\\<span class=\"hljs-title\">ClassLibrary2.dll<\/span>\"\n<span class=\"hljs-title\">xUnit.net<\/span> <span class=\"hljs-title\">Console<\/span> <span class=\"hljs-title\">Runner<\/span> (64-<span class=\"hljs-title\">bit<\/span> .<span class=\"hljs-title\">NET<\/span> 4.0.30319.42000)\n  <span class=\"hljs-title\">Discovering<\/span>: <span class=\"hljs-title\">ClassLibrary2<\/span>\n  <span class=\"hljs-title\">Discovered<\/span>:  <span class=\"hljs-title\">ClassLibrary2<\/span>\n  <span class=\"hljs-title\">Starting<\/span>:    <span class=\"hljs-title\">ClassLibrary2<\/span>\n    <span class=\"hljs-title\">ClassLibrary2.Class1.Test2<\/span> [<span class=\"hljs-title\">FAIL<\/span>]\n      <span class=\"hljs-title\">Assert.True<\/span>() <span class=\"hljs-title\">Failure<\/span>\n      <span class=\"hljs-title\">Expected<\/span>: <span class=\"hljs-title\">True<\/span>\n      <span class=\"hljs-title\">Actual<\/span>:   <span class=\"hljs-title\">False<\/span>\n      <span class=\"hljs-title\">Stack<\/span> <span class=\"hljs-title\">Trace<\/span>:\n        <span class=\"hljs-title\">ClassLibrary2<\/span>\\<span class=\"hljs-title\">Class1.cs<\/span>(21,0): <span class=\"hljs-title\">at<\/span> <span class=\"hljs-title\">ClassLibrary2.Class1.Test2<\/span>()\n  <span class=\"hljs-title\">Finished<\/span>:    <span class=\"hljs-title\">ClassLibrary2<\/span>\n=== <span class=\"hljs-title\">TEST<\/span> <span class=\"hljs-title\">EXECUTION<\/span> <span class=\"hljs-title\">SUMMARY<\/span> ===\n   <span class=\"hljs-title\">ClassLibrary2<\/span>  <span class=\"hljs-title\">Total<\/span>: 2, <span class=\"hljs-title\">Errors<\/span>: 0, <span class=\"hljs-title\">Failed<\/span>: 1, <span class=\"hljs-title\">Skipped<\/span>: 0, <span class=\"hljs-title\">Time<\/span>: 0.224<span class=\"hljs-title\">s<\/span><\/span><\/code><\/pre>\n<p>\u597d\uff0c\u65e2\u7136\u547d\u4ee4\u884c\u53ef\u4ee5\u8dd1\u5355\u5143\u6d4b\u8bd5\uff0c\u90a3\u4e48\u6211\u4eec\u5c31\u53ef\u4ee5\u5728<code>.gitlab-ci.yml<\/code>\u4e2d\u6dfb\u52a0\u811a\u672c\u914d\u7f6e\uff0c\u5982\u4e0b\uff1a<\/p>\n<div class=\"sourceCode\">\n<pre class=\"sourceCode yml\"><code class=\"sourceCode yaml hljs\"><span class=\"fu\"><span class=\"hljs-attr\">stages:<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> build\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> test\n\n<span class=\"fu\"><span class=\"hljs-attr\">before_script:<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> echo <span class=\"st\"><span class=\"hljs-string\">\"Restoring NuGet Packages...\"<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-attr\">-<\/span><\/span> <span class=\"fu\"><span class=\"hljs-attr\">C:<\/span><\/span>\\NuGet\\nuget.exe restore <span class=\"hljs-string\">\"src\\CNBlogsCI-Sample.sln\"<\/span>\n\n<span class=\"fu\"><span class=\"hljs-attr\">build_job:<\/span><\/span>\n  <span class=\"fu\"><span class=\"hljs-attr\">stage:<\/span><\/span> build\n  <span class=\"fu\"><span class=\"hljs-attr\">script:<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> echo <span class=\"st\"><span class=\"hljs-string\">\"Release build...\"<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-attr\">-<\/span><\/span> <span class=\"fu\"><span class=\"hljs-attr\">C:<\/span><\/span>\\Windows\\Microsoft.NET\\Framework64\\v4<span class=\"hljs-number\">.0<\/span><span class=\"hljs-number\">.30319<\/span>\\msbuild.exe \/consoleloggerparameters:ErrorsOnly \/maxcpucount \/nologo \/property:Configuration=Release \/verbosity:quiet <span class=\"hljs-string\">\"src\\CNBlogsCI-Sample.sln\"<\/span>\n  <span class=\"fu\"><span class=\"hljs-attr\">except:<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> tags\n\n<span class=\"fu\"><span class=\"hljs-attr\">test_job:<\/span><\/span>\n  <span class=\"fu\"><span class=\"hljs-attr\">stage:<\/span><\/span> test\n  <span class=\"fu\"><span class=\"hljs-attr\">script:<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> echo <span class=\"st\"><span class=\"hljs-string\">\"Tests run...\"<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-attr\">-<\/span><\/span> <span class=\"fu\"><span class=\"hljs-attr\">C:<\/span><\/span>\\xunit.runner.console\\tools\\xunit.console.exe <span class=\"hljs-string\">\"src\\ClassLibrary2\\bin\\debug\\ClassLibrary2.dll\"<\/span>\n  <span class=\"kw\"><span class=\"hljs-attr\">-<\/span><\/span> <span class=\"fu\"><span class=\"hljs-attr\">C:<\/span><\/span>\\xunit.runner.console\\tools\\xunit.console.exe <span class=\"hljs-string\">\"src\\ClassLibrary3\\bin\\debug\\ClassLibrary3.dll\"<\/span><\/code><\/pre>\n<\/div>\n<p>xUnit \u5355\u5143\u6d4b\u8bd5\u4e0d\u901a\u8fc7\u65e5\u5fd7\uff1a<\/p>\n<pre class=\"cmd\"><code class=\"hljs dos\">gitlab-ci-multi-runner <span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">3<\/span> (a470667)\nUsing Shell executor...\nRunning on DESKTOP-<span class=\"hljs-number\">2<\/span>P9GHDD...\nFetching changes...\nRemoving src\/ClassLibrary1\/bin\/\nRemoving src\/ClassLibrary1\/obj\/\nRemoving src\/ClassLibrary2\/bin\/Release\/\nRemoving src\/ClassLibrary2\/obj\/\nRemoving src\/ClassLibrary3\/bin\/\nRemoving src\/ClassLibrary3\/obj\/\nRemoving src\/packages\/\nHEAD is now <span class=\"hljs-built_in\">at<\/span> d176025 test commit\nChecking out d1760259 as master...\nHEAD is now <span class=\"hljs-built_in\">at<\/span> d176025... test commit\n$ <span class=\"hljs-built_in\">echo<\/span> \"Restoring NuGet Packages...\"\nRestoring NuGet Packages...\n$ C:\\NuGet\\nuget.exe <span class=\"hljs-built_in\">restore<\/span> \"src\\CNBlogsCI-Sample.sln\"\nInstalling 'xunit.abstractions <span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">0<\/span>.<span class=\"hljs-number\">0<\/span>'.\nInstalling 'xunit.assert <span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">0<\/span>'.\nInstalling 'xunit <span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">0<\/span>'.\nInstalling 'AutoMapper <span class=\"hljs-number\">4<\/span>.<span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">1<\/span>'.\nSuccessfully installed 'xunit <span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">0<\/span>'.\nInstalling 'xunit.core <span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">0<\/span>'.\nSuccessfully installed 'xunit.abstractions <span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">0<\/span>.<span class=\"hljs-number\">0<\/span>'.\nSuccessfully installed 'xunit.core <span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">0<\/span>'.\nInstalling 'xunit.extensibility.core <span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">0<\/span>'.\nSuccessfully installed 'xunit.assert <span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">0<\/span>'.\nInstalling 'xunit.extensibility.execution <span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">0<\/span>'.\nInstalling 'xunit.runner.console <span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">0<\/span>'.\nSuccessfully installed 'AutoMapper <span class=\"hljs-number\">4<\/span>.<span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">1<\/span>'.\nSuccessfully installed 'xunit.runner.console <span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">0<\/span>'.\nSuccessfully installed 'xunit.extensibility.core <span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">0<\/span>'.\nSuccessfully installed 'xunit.extensibility.execution <span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">0<\/span>'.\n$ <span class=\"hljs-built_in\">echo<\/span> \"Tests run...\"\nTests run...\n$ C:\\xunit.runner.console\\tools\\xunit.console.exe \"src\\ClassLibrary2\\bin\\debug\\ClassLibrary2.dll\"\nxUnit.<span class=\"hljs-built_in\">net<\/span> Console Runner (<span class=\"hljs-number\">64<\/span>-bit .<span class=\"hljs-built_in\">NET<\/span> <span class=\"hljs-number\">4<\/span>.<span class=\"hljs-number\">0<\/span>.<span class=\"hljs-number\">30319<\/span>.<span class=\"hljs-number\">42000<\/span>)\n<span class=\"hljs-function\">  Discovering: <span class=\"hljs-title\">ClassLibrary2<\/span>\n  <span class=\"hljs-title\">Discovered<\/span>:  <span class=\"hljs-title\">ClassLibrary2<\/span>\n  <span class=\"hljs-title\">Starting<\/span>:    <span class=\"hljs-title\">ClassLibrary2<\/span>\n  <span class=\"hljs-title\">Finished<\/span>:    <span class=\"hljs-title\">ClassLibrary2<\/span>\n=== <span class=\"hljs-title\">TEST<\/span> <span class=\"hljs-title\">EXECUTION<\/span> <span class=\"hljs-title\">SUMMARY<\/span> ===\n   <span class=\"hljs-title\">ClassLibrary2<\/span>  <span class=\"hljs-title\">Total<\/span>: 2, <span class=\"hljs-title\">Errors<\/span>: 0, <span class=\"hljs-title\">Failed<\/span>: 0, <span class=\"hljs-title\">Skipped<\/span>: 0, <span class=\"hljs-title\">Time<\/span>: 0.179<span class=\"hljs-title\">s<\/span>\n$ <span class=\"hljs-title\">C<\/span>:\\<span class=\"hljs-title\">xunit.runner.console<\/span>\\<span class=\"hljs-title\">tools<\/span>\\<span class=\"hljs-title\">xunit.console.exe<\/span> \"<span class=\"hljs-title\">src<\/span>\\<span class=\"hljs-title\">ClassLibrary3<\/span>\\<span class=\"hljs-title\">bin<\/span>\\<span class=\"hljs-title\">debug<\/span>\\<span class=\"hljs-title\">ClassLibrary3.dll<\/span>\"\n<span class=\"hljs-title\">error<\/span>: <span class=\"hljs-title\">file<\/span> <span class=\"hljs-title\">not<\/span> <span class=\"hljs-title\">found<\/span>: <span class=\"hljs-title\">src<\/span>\\<span class=\"hljs-title\">ClassLibrary3<\/span>\\<span class=\"hljs-title\">bin<\/span>\\<span class=\"hljs-title\">debug<\/span>\\<span class=\"hljs-title\">ClassLibrary3.dll<\/span>\n\n<span class=\"hljs-title\">ERROR<\/span>: <span class=\"hljs-title\">Build<\/span> <span class=\"hljs-title\">failed<\/span>: <span class=\"hljs-title\">exit<\/span> <span class=\"hljs-title\">status<\/span> 1<\/span><\/code><\/pre>\n<p>xUnit \u5355\u5143\u6d4b\u8bd5\u901a\u8fc7\u65e5\u5fd7\uff1a<\/p>\n<pre class=\"cmd\"><code class=\"hljs dos\">gitlab-ci-multi-runner <span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">3<\/span> (a470667)\nUsing Shell executor...\nRunning on DESKTOP-<span class=\"hljs-number\">2<\/span>P9GHDD...\nFetching changes...\nRemoving src\/ClassLibrary1\/bin\/\nRemoving src\/ClassLibrary1\/obj\/\nRemoving src\/ClassLibrary2\/bin\/Release\/\nRemoving src\/ClassLibrary2\/obj\/\nRemoving src\/ClassLibrary3\/bin\/Release\/\nRemoving src\/ClassLibrary3\/obj\/\nRemoving src\/packages\/\nHEAD is now <span class=\"hljs-built_in\">at<\/span> <span class=\"hljs-number\">2467772<\/span> test commit\nChecking out <span class=\"hljs-number\">2467772<\/span>f as master...\nHEAD is now <span class=\"hljs-built_in\">at<\/span> <span class=\"hljs-number\">2467772<\/span>... test commit\n$ <span class=\"hljs-built_in\">echo<\/span> \"Restoring NuGet Packages...\"\nRestoring NuGet Packages...\n$ C:\\NuGet\\nuget.exe <span class=\"hljs-built_in\">restore<\/span> \"src\\CNBlogsCI-Sample.sln\"\nInstalling 'AutoMapper <span class=\"hljs-number\">4<\/span>.<span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">1<\/span>'.\nInstalling 'xunit.abstractions <span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">0<\/span>.<span class=\"hljs-number\">0<\/span>'.\nInstalling 'xunit.assert <span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">0<\/span>'.\nInstalling 'xunit <span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">0<\/span>'.\nSuccessfully installed 'xunit <span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">0<\/span>'.\nInstalling 'xunit.core <span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">0<\/span>'.\nSuccessfully installed 'xunit.abstractions <span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">0<\/span>.<span class=\"hljs-number\">0<\/span>'.\nSuccessfully installed 'xunit.core <span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">0<\/span>'.\nInstalling 'xunit.extensibility.execution <span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">0<\/span>'.\nInstalling 'xunit.extensibility.core <span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">0<\/span>'.\nSuccessfully installed 'xunit.assert <span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">0<\/span>'.\nInstalling 'xunit.runner.console <span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">0<\/span>'.\nSuccessfully installed 'AutoMapper <span class=\"hljs-number\">4<\/span>.<span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">1<\/span>'.\nSuccessfully installed 'xunit.runner.console <span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">0<\/span>'.\nSuccessfully installed 'xunit.extensibility.core <span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">0<\/span>'.\nSuccessfully installed 'xunit.extensibility.execution <span class=\"hljs-number\">2<\/span>.<span class=\"hljs-number\">1<\/span>.<span class=\"hljs-number\">0<\/span>'.\n$ <span class=\"hljs-built_in\">echo<\/span> \"Tests run...\"\nTests run...\n$ C:\\xunit.runner.console\\tools\\xunit.console.exe \"src\\ClassLibrary2\\bin\\debug\\ClassLibrary2.dll\"\nxUnit.<span class=\"hljs-built_in\">net<\/span> Console Runner (<span class=\"hljs-number\">64<\/span>-bit .<span class=\"hljs-built_in\">NET<\/span> <span class=\"hljs-number\">4<\/span>.<span class=\"hljs-number\">0<\/span>.<span class=\"hljs-number\">30319<\/span>.<span class=\"hljs-number\">42000<\/span>)\n<span class=\"hljs-function\">  Discovering: <span class=\"hljs-title\">ClassLibrary2<\/span>\n  <span class=\"hljs-title\">Discovered<\/span>:  <span class=\"hljs-title\">ClassLibrary2<\/span>\n  <span class=\"hljs-title\">Starting<\/span>:    <span class=\"hljs-title\">ClassLibrary2<\/span>\n  <span class=\"hljs-title\">Finished<\/span>:    <span class=\"hljs-title\">ClassLibrary2<\/span>\n=== <span class=\"hljs-title\">TEST<\/span> <span class=\"hljs-title\">EXECUTION<\/span> <span class=\"hljs-title\">SUMMARY<\/span> ===\n   <span class=\"hljs-title\">ClassLibrary2<\/span>  <span class=\"hljs-title\">Total<\/span>: 2, <span class=\"hljs-title\">Errors<\/span>: 0, <span class=\"hljs-title\">Failed<\/span>: 0, <span class=\"hljs-title\">Skipped<\/span>: 0, <span class=\"hljs-title\">Time<\/span>: 0.194<span class=\"hljs-title\">s<\/span>\n$ <span class=\"hljs-title\">C<\/span>:\\<span class=\"hljs-title\">xunit.runner.console<\/span>\\<span class=\"hljs-title\">tools<\/span>\\<span class=\"hljs-title\">xunit.console.exe<\/span> \"<span class=\"hljs-title\">src<\/span>\\<span class=\"hljs-title\">ClassLibrary3<\/span>\\<span class=\"hljs-title\">bin<\/span>\\<span class=\"hljs-title\">debug<\/span>\\<span class=\"hljs-title\">ClassLibrary3.dll<\/span>\"\n<span class=\"hljs-title\">xUnit.net<\/span> <span class=\"hljs-title\">Console<\/span> <span class=\"hljs-title\">Runner<\/span> (64-<span class=\"hljs-title\">bit<\/span> .<span class=\"hljs-title\">NET<\/span> 4.0.30319.42000)\n  <span class=\"hljs-title\">Discovering<\/span>: <span class=\"hljs-title\">ClassLibrary3<\/span>\n  <span class=\"hljs-title\">Discovered<\/span>:  <span class=\"hljs-title\">ClassLibrary3<\/span>\n  <span class=\"hljs-title\">Starting<\/span>:    <span class=\"hljs-title\">ClassLibrary3<\/span>\n  <span class=\"hljs-title\">Finished<\/span>:    <span class=\"hljs-title\">ClassLibrary3<\/span>\n=== <span class=\"hljs-title\">TEST<\/span> <span class=\"hljs-title\">EXECUTION<\/span> <span class=\"hljs-title\">SUMMARY<\/span> ===\n   <span class=\"hljs-title\">ClassLibrary3<\/span>  <span class=\"hljs-title\">Total<\/span>: 1, <span class=\"hljs-title\">Errors<\/span>: 0, <span class=\"hljs-title\">Failed<\/span>: 0, <span class=\"hljs-title\">Skipped<\/span>: 0, <span class=\"hljs-title\">Time<\/span>: 0.184<span class=\"hljs-title\">s<\/span>\n\n<span class=\"hljs-title\">Build<\/span> <span class=\"hljs-title\">succeeded<\/span><\/span><\/code><\/pre>\n<p>\u57fa\u672c\u4e0a\u5b9e\u73b0\u4e86\u6211\u4eec\u60f3\u8981\u7684\u6548\u679c\uff0c\u4f46\u8fd9\u79cd\u5b9e\u73b0\u65b9\u5f0f\u6709\u4e24\u4e2a\u4e0d\u597d\u7684\u5730\u65b9\uff1a<\/p>\n<ul>\n<li>\u9700\u8981\u5c06\u5355\u5143\u6d4b\u8bd5\u7684\u00a0<code>*.dll<\/code>\u00a0\u6587\u4ef6\u4e0a\u4f20\u5230 git \u8d44\u6e90\u5e93\u3002<\/li>\n<li>\u6bcf\u589e\u52a0\u4e00\u4e2a\u5355\u5143\u6d4b\u8bd5\u9879\u76ee\uff0c\u5c31\u5fc5\u987b\u5728<code>.gitlab-ci.yml<\/code>\u4e2d\u6dfb\u52a0\u4e00\u6bb5\u811a\u672c\u3002<\/li>\n<\/ul>\n<p>\u6211\u4e2a\u4eba\u89c9\u5f97 CI \u4e2d\u7684\u81ea\u52a8\u5316\u6d4b\u8bd5\uff0c\u80af\u5b9a\u4e0d\u662f\u50cf\u6211\u8fd9\u6837\u641e\u7684\uff0c\u4f46\u5b9e\u5728\u627e\u4e0d\u5230\u76f8\u5173\u8d44\u6599\uff0c\u5982\u679c\u5927\u5bb6\u77e5\u6089\uff0c\u8fd8\u8bf7\u544a\u77e5\uff0c\u611f\u8c22\uff5e<\/p>\n<p>\u53e6\u5916\uff0c\u5982\u679c\u662f ASP.NET 5 \u9879\u76ee\uff0c\u8fdb\u884c\u81ea\u52a8\u5316\u6d4b\u8bd5\u914d\u7f6e\uff0c\u4f1a\u975e\u5e38\u7b80\u5355\uff0c\u914d\u7f6e\u5982\u4e0b\uff1a<\/p>\n<div class=\"sourceCode\">\n<pre class=\"sourceCode yml\"><code class=\"sourceCode yaml hljs\"><span class=\"fu\"><span class=\"hljs-attr\">test:<\/span><\/span>\n  <span class=\"fu\"><span class=\"hljs-attr\">stage:<\/span><\/span> test\n  <span class=\"fu\"><span class=\"hljs-attr\">script:<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> echo <span class=\"st\"><span class=\"hljs-string\">\"Tests run...\"<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> dnx test <span class=\"co\"><span class=\"hljs-comment\">#\u6216\u8005 dotnet test<\/span><\/span><\/code><\/pre>\n<\/div>\n<h2 id=\"configue-.gitlab-ci.yml\">5. configue .gitlab-ci.yml<\/h2>\n<p><code>.gitlab-ci.yml<\/code>\u5b98\u65b9\u8d44\u6599\uff1a<a class=\"uri\" href=\"http:\/\/doc.gitlab.com\/ee\/ci\/yaml\/README.html\">http:\/\/doc.gitlab.com\/ee\/ci\/yaml\/README.html<\/a><\/p>\n<p>\u5176\u4ed6\u793a\u4f8b\uff1a<\/p>\n<ul>\n<li><a class=\"uri\" href=\"http:\/\/stackoverflow.com\/questions\/32964953\/gitlab-ci-and-msbuild-with-tests\">http:\/\/stackoverflow.com\/questions\/32964953\/gitlab-ci-and-msbuild-with-tests<\/a><\/li>\n<li><a class=\"uri\" href=\"https:\/\/github.com\/CWISoftware\/accounts\/blob\/master\/.gitlab-ci.yml\">https:\/\/github.com\/CWISoftware\/accounts\/blob\/master\/.gitlab-ci.yml<\/a><\/li>\n<li><a class=\"uri\" href=\"http:\/\/www.timtilberg.com\/tag\/gitlab\/\">http:\/\/www.timtilberg.com\/tag\/gitlab\/<\/a><\/li>\n<li><a class=\"uri\" href=\"http:\/\/doc.gitlab.com\/ee\/ci\/yaml\/README.html#stages\">http:\/\/doc.gitlab.com\/ee\/ci\/yaml\/README.html#stages<\/a><\/li>\n<li><a class=\"uri\" href=\"https:\/\/github.com\/travis-ci\/travis-ci\/issues\/5210\">https:\/\/github.com\/travis-ci\/travis-ci\/issues\/5210<\/a><\/li>\n<\/ul>\n<p><code>.gitlab-ci.yml<\/code>\u4e2d\u7684\u914d\u7f6e\u8bf4\u660e\uff0c\u4e0a\u9762\u7684\u5b98\u65b9\u8d44\u6599\u4ecb\u7ecd\u7684\u975e\u5e38\u8be6\u7ec6\uff0c\u4e0b\u9762\u6211\u518d\u7b80\u5355\u4ecb\u7ecd\u4e0b\uff0c\u5c31\u7528\u6211\u8fd9\u6b21\u90e8\u7f72 CI \u5b8c\u5584\u540e\u7684<code>.gitlab-ci.yml<\/code>\u914d\u7f6e\uff1a<\/p>\n<div class=\"sourceCode\">\n<pre class=\"sourceCode yml\"><code class=\"sourceCode yaml hljs\"><span class=\"fu\"><span class=\"hljs-attr\">stages:<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> build\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> test\n\n<span class=\"fu\"><span class=\"hljs-attr\">before_script:<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> echo <span class=\"st\"><span class=\"hljs-string\">\"Restoring NuGet Packages...\"<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-attr\">-<\/span><\/span> <span class=\"fu\"><span class=\"hljs-attr\">C:<\/span><\/span>\\NuGet\\nuget.exe restore <span class=\"hljs-string\">\"src\\CNBlogsCI-Sample.sln\"<\/span>\n  <span class=\"fu\"><span class=\"hljs-attr\">only:<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> master\n\n<span class=\"fu\"><span class=\"hljs-attr\">build_job:<\/span><\/span>\n  <span class=\"fu\"><span class=\"hljs-attr\">stage:<\/span><\/span> build\n  <span class=\"fu\"><span class=\"hljs-attr\">script:<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> echo <span class=\"st\"><span class=\"hljs-string\">\"Release build...\"<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-attr\">-<\/span><\/span> <span class=\"fu\"><span class=\"hljs-attr\">C:<\/span><\/span>\\Windows\\Microsoft.NET\\Framework64\\v4<span class=\"hljs-number\">.0<\/span><span class=\"hljs-number\">.30319<\/span>\\msbuild.exe \/consoleloggerparameters:ErrorsOnly \/maxcpucount \/nologo \/property:Configuration=Release \/verbosity:quiet <span class=\"hljs-string\">\"src\\CNBlogsCI-Sample.sln\"<\/span>\n  <span class=\"fu\"><span class=\"hljs-attr\">except:<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> tags\n  <span class=\"fu\"><span class=\"hljs-attr\">only:<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> master\n\n<span class=\"fu\"><span class=\"hljs-attr\">test_job:<\/span><\/span>\n  <span class=\"fu\"><span class=\"hljs-attr\">stage:<\/span><\/span> test\n  <span class=\"fu\"><span class=\"hljs-attr\">script:<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> echo <span class=\"st\"><span class=\"hljs-string\">\"Tests run...\"<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-attr\">-<\/span><\/span> <span class=\"fu\"><span class=\"hljs-attr\">C:<\/span><\/span>\\xunit.runner.console\\tools\\xunit.console.exe <span class=\"hljs-string\">\"src\\ClassLibrary2\\bin\\debug\\ClassLibrary2.dll\"<\/span>\n  <span class=\"kw\"><span class=\"hljs-attr\">-<\/span><\/span> <span class=\"fu\"><span class=\"hljs-attr\">C:<\/span><\/span>\\xunit.runner.console\\tools\\xunit.console.exe <span class=\"hljs-string\">\"src\\ClassLibrary3\\bin\\debug\\ClassLibrary3.dll\"<\/span>\n  <span class=\"fu\"><span class=\"hljs-attr\">only:<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> master<\/code><\/pre>\n<\/div>\n<p><code>stage<\/code>\u7ffb\u8bd1\u4e3a<strong>\u9636\u6bb5<\/strong>\u7684\u610f\u601d\uff0c\u5728<strong>\u6784\u5efa<\/strong>\u7684\u8fc7\u7a0b\u4e2d\uff0c\u5fc5\u987b\u8981\u6709\u4e00\u4e2a\u5148\u540e\u987a\u5e8f\uff0c\u6700\u4e0a\u9762\u7684<code>stages<\/code>\u914d\u7f6e\u610f\u601d\u662f\uff0c\u5148\u6784\u5efa\u9636\u6bb5\u4e3a<code>build<\/code>\u7684<code>job<\/code>\uff0c\u7136\u540e\u518d\u6784\u5efa\u9636\u6bb5\u4e3a<code>test<\/code>\u7684<code>job<\/code>\uff0c\u4e0b\u9762<code>build_job<\/code>\u548c<code>test_job<\/code>\u90fd\u662f<code>job<\/code>\uff0c\u5982\u679c\u4e0d\u914d\u7f6e<code>stages<\/code>\uff0c\u9ed8\u8ba4\u4e3a\uff1a<\/p>\n<div class=\"sourceCode\">\n<pre class=\"sourceCode yml\"><code class=\"sourceCode yaml hljs\"><span class=\"fu\"><span class=\"hljs-attr\">stages:<\/span><\/span>\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> build\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> test\n  <span class=\"kw\"><span class=\"hljs-bullet\">-<\/span><\/span> deploy<\/code><\/pre>\n<\/div>\n<p><code>before_script<\/code>\u7684\u610f\u601d\u662f\uff0c\u6267\u884c\u5728\u6240\u6709\u7684<code>job<\/code>\u4e4b\u524d\u7684\u811a\u672c\uff0c\u6bd4\u5982\u6784\u5efa<code>build_job<\/code>\u548c<code>test_job<\/code>\u90fd\u5148\u6267\u884c<code>before_script<\/code>\uff0c<code>build_job<\/code>\u548c<code>test_job<\/code>\u4e2d\u7684<code>stage<\/code>\u914d\u7f6e\uff0c\u610f\u601d\u662f\u6b64<code>job<\/code>\u5c5e\u4e8e\u54ea\u4e2a<code>stage<\/code>\uff0c\u8fd9\u4e2a<code>stage<\/code>\u5c31\u662f\u6700\u4e0a\u9762\u7684<code>stages<\/code>\u914d\u7f6e\uff0c\u9664\u4e86\u9ed8\u8ba4\u7684<code>build<\/code>,<code>test<\/code>\u548c<code>deploy<\/code>\uff0c\u4f60\u4e5f\u53ef\u4ee5\u6dfb\u52a0\u81ea\u5b9a\u4e49\u7684<code>stage<\/code>\uff0c\u53e6\u5916\uff0c\u5982\u679c<code>job<\/code>\u4e0d\u6dfb\u52a0<code>stage<\/code>\u914d\u7f6e\uff0c\u9ed8\u8ba4\u914d\u7f6e\u4e3a<code>test<\/code>\uff0c\u6bd4\u5982\u4e0a\u9762\u7684<code>test_job<\/code>\uff0c\u5c31\u53ef\u4ee5\u7701\u7565<code>stage: test<\/code>\u914d\u7f6e\u3002<\/p>\n<p>\u53e6\u5916\uff0c<code>job<\/code>\u8fd8\u6709\u4e00\u4e2a<code>when: on_failure\/on_success \/always<\/code>\u914d\u7f6e\uff0c\u5982\u679c\u6211\u4eec\u5bf9<code>job<\/code>\u8fdb\u884c\u4e86<code>stage<\/code>\u914d\u7f6e\uff0c\u9ed8\u8ba4\u90fd\u4f1a\u662f<code>when: on_success<\/code>\uff1a<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/images2015.cnblogs.com\/blog\/435188\/201605\/435188-20160505213235279-417659233.png\" \/><\/p>\n<p><code>only - master<\/code>\u7684\u610f\u601d\u662f\uff0c\u53ea\u6709`<code>master<\/code>\u5206\u652f\u624d\u4f1a\u8fdb\u884c\u6784\u5efa\uff0c<code>script<\/code>\u7684\u610f\u601d\u5f88\u660e\u4e86\uff0c\u5c31\u662f\u8981\u6267\u884c\u7684\u811a\u672c\u547d\u540d\u3002<\/p>\n<h2 id=\"configue-build-status-badge-image\">6. configue build status badge image<\/h2>\n<p>\u6784\u5efa\u72b6\u6001\u5fbd\u7ae0\uff0c\u5c31\u662f\u6211\u4eec\u5e73\u5e38\u5728 Github \u9879\u76ee\u4e2d\u770b\u5230\u6784\u5efa\u56fe\u6807\uff0c\u6709<code>pass<\/code>\u548c<code>failing<\/code>\u7b49\u7b49\u3002<\/p>\n<p>Gitlab CI \u4e2d\u7684\u6559\u7a0b\u00a0<a href=\"http:\/\/doc.gitlab.com\/ce\/ci\/quick_start\/README.html\">builds-badge<\/a>\u00a0\u771f\u7684\u5f88\u5751\u7239\uff0c\u600e\u4e48\u8bd5\u90fd\u4e0d\u884c\uff0c\u540e\u6765\u65e0\u610f\u95f4\u770b\u5230 Gitlab \u9879\u76ee\u7684\u4e00\u4e2a\u9009\u9879\u00a0<strong>Settings &gt; Badges<\/strong>\uff1a<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/images2015.cnblogs.com\/blog\/435188\/201605\/435188-20160505214934794-2100519539.png\" \/><\/p>\n<p>\u590d\u5236\u4e0a\u9762\u7684\u4ee3\u7801\uff0c\u7136\u540e\u6dfb\u52a0\u5728<code>README.md<\/code>\u6587\u4ef6\u4e2d\uff1a<\/p>\n<pre><code class=\"hljs markdown\">[<span class=\"hljs-string\">![build status<\/span>](<span class=\"hljs-link\">https:\/\/gitlab.com\/dev\/CNBlogsCI-Sample\/badges\/master\/build.svg<\/span>)](<span class=\"hljs-link\">https:\/\/gitlab.com\/dev\/CNBlogsCI-Sample\/commits\/master<\/span>)<\/code><\/pre>\n<p>\u8fd9\u6837\u5728<code>commit``bulid<\/code>\u7684\u65f6\u5019\uff0c\u5c31\u4f1a\u52a8\u6001\u7684\u663e\u793a<code>bulid<\/code>\u7684\u8fc7\u7a0b\u548c\u7ed3\u679c\uff0c\u5e76\u4e14\u662f\u56fe\u7247\u663e\u793a\u3002<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/images2015.cnblogs.com\/blog\/435188\/201605\/435188-20160505215133466-114072506.png\" \/><\/p>\n<p>Gitlab \u90e8\u7f72\u597d CI \u4e4b\u540e\uff0c\u6211\u4eec\u4f1a\u53d1\u73b0\uff0c\u5728\u9879\u76ee\u4e2d\u968f\u5904\u53ef\u89c1\u8fd9\u6837\u7684\u56fe\u6807\uff1a<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/images2015.cnblogs.com\/blog\/435188\/201605\/435188-20160505215527560-1180463408.png\" \/><\/p>\n<hr \/>\n<p>\u8fd9\u7bc7\u535a\u6587\u6ca1\u6709\u4ec0\u4e48\u9605\u8bfb\u4ef7\u503c\uff0c\u56e0\u4e3a\u90fd\u662f\u96f6\u96f6\u788e\u788e\u7684\u95ee\u9898\u548c\u89e3\u51b3\u7eaa\u5f55\uff0c\u6ca1\u6709\u4ec0\u4e48\u53ef\u8bfb\u6027\uff0c\u5982\u679c\u4f60\u80fd\u9605\u8bfb\u5230\u8fd9\uff0c\u6211\u771f\u7684\u4f1a\u5f88\u611f\u52a8\u3002<\/p>\n<p>\u5206\u4eab\u662f\u6709\u4ef7\u503c\u7684\u4e00\u4ef6\u4e8b\uff0c\u5982\u679c\u56ed\u53cb\u5728\u9047\u5230\u76f8\u540c\u95ee\u9898\u7684\u65f6\u5019\uff0c\u53ef\u4ee5 Google \u5230\u8fd9\u7bc7\u535a\u6587\uff0c\u90a3\u5199\u8fd9\u7bc7\u535a\u6587\u4e5f\u5c31\u503c\u4e86\ud83d\ude0f\u3002<\/p>\n<\/div>\n<div id=\"MySignature\">\n<div id=\"xishuai_qianming\">\u4f5c\u8005\uff1a<a href=\"http:\/\/www.cnblogs.com\/xishuai\/\">\u7530\u56ed\u91cc\u7684\u87cb\u87c0<\/a><br \/>\n\u51fa\u5904\uff1a<a href=\"http:\/\/www.cnblogs.com\/xishuai\/\">http:\/\/www.cnblogs.com\/xishuai\/<\/a><br \/>\n\u672c\u6587\u7248\u6743\u5f52\u4f5c\u8005\u548c\u535a\u5ba2\u56ed\u5171\u6709\uff0c\u6b22\u8fce\u8f6c\u8f7d\uff0c\u4f46\u672a\u7ecf\u4f5c\u8005\u540c\u610f\u5fc5\u987b\u4fdd\u7559\u6b64\u6bb5\u58f0\u660e\uff0c\u4e14\u5728\u6587\u7ae0\u9875\u9762\u660e\u663e\u4f4d\u7f6e\u7ed9\u51fa\u539f\u6587\u8fde\u63a5\u3002<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u9605\u8bfb\u76ee\u5f55\uff1a install configue gitlab-ci-multi-runner restore nuget packages bulid .sln run unit tests configue .gitlab-ci.yml configue build status badge image CI [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[],"class_list":["post-421","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=\/wp\/v2\/posts\/421","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=421"}],"version-history":[{"count":0,"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=\/wp\/v2\/posts\/421\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=421"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=421"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=421"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}