我尝试设置一个汇编构build服务器( http://concourse.ci/ ),支持尽可能多的语言/平台。
我已经读过,从Windows Server 2016开始,将有可能将Windows作为容器。 正如网站在其网站上写道,支持多种平台(包括Windows),我不知道这是否意味着可以使用Windows容器?
如果不能运行Windows容器,我可以以某种方式让中心虚拟机代替容器吗?
不幸的是,我只能找到一个页面。 我也尝试过像hello world这样简单的管道,但是不能得到它的工作。 只是分享也许有人可以从中受益。
我遗漏了部分产生ssh密钥,准备TSA。
准备Windows工作者
现在我们将注意力转移到我们的Windows服务器上,我们将转向Concourse工作人员。
首先,我们需要建立一个目录来存放我们的工作服务及其数据库,即C:\ concourse的二进制文件
C:\> mkdir concourse C:\> cd concourse C:\concourse>
现在从Concourse下载页面下载Windows concourse二进制文件(名为“concourse_windows_amd64.exe”),并将其放在我们的工作目录中。 另外,我们也希望在那里复制“tsakey.pub”和“workerkey”文件。
事实上,我们将提供我们的本地大厅二进制文件“tsakey.pub”建立我们加密信任TSA服务器从我们的部署。
我们现在准备启动工作人员,并在TSA注册。
C:\concourse> .\concourse_windows_amd64.exe worker \ /work-dir .\work /tsa-host <IP of the TSA> \ /tsa-public-key .\tsakey.pub \ /tsa-worker-private-key .\workerkey
如果一切顺利,我们应该看到类似于以下的输出:
{"timestamp":"1478361158.394949198","source":"tsa","message":"tsa.connection.forward-worker.register.done","log_level":1 ,"data":{"remote":"<IP:SOURCE-PORT of the TSA>","session":"3.1.4","worker-address":"<IP:PORT of this worker>","worker-platform":"windows", "worker-tags":""}}
新员工应通过Concourse CLI出现在列表中:
~/ $ fly -t ci workers name containers platform tags team 2a334e70-c75c 3 linux none none WORKERSHOSTNAME 0 windows none none
测试事情
假设.NET框架出现在我们的工作者与路径中的构建工具,我们可以通过构建这个简单的.NET控制台应用程序项目来测试这个: https : //github.com/chrisumbel/DatDotNet.git 。
考虑管道:
resources: - name: code type: git source: uri: https://github.com/chrisumbel/DatDotNet.git branch: master jobs: - name: build plan: - aggregate: - get: code trigger: true - task: compile privileged: true file: code/Pipeline/compile.yml
与构建任务:
platform: windows inputs: - name: code run: dir: code path: msbuild
请注意,构建任务中指定的平台是“windows”。 这指示concourse将任务放置在Windows工作者上。
如果一切顺利,我们应该看到一个成功的构建,输出类似于:
~/ $ fly -t ci trigger-job -j datdotnet/build --watch started datdotnet/build #8 using version of resource found in cache initializing running msbuild Microsoft (R) Build Engine version 4.6.1085.0 [Microsoft .NET Framework, version 4.0.30319.42000] Copyright (C) Microsoft Corporation. All rights reserved. Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. Build started 11/5/2016 4:04:00 PM. ... nces, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. [C:\concourse\work\containers\00000arl2se\tmp\build\36d0981b\code\DatDotNet\DatDotNet.csproj] 3 Warning(s) 0 Error(s) Time Elapsed 00:00:00.22 succeeded
从理论上讲,通过Garden-Windows可以做到这一点,因为Concourse将所有的集装箱都委托给了Garden API。
从来没有这样做过,我不知道从哪里开始。