很抱歉,我只能找到一页相关信息。我也尝试过像“Hello World”这样更简单的流水线,但无法使其工作。只是分享,或许有人会从中受益,
链接在此。
我省略了生成SSH密钥、准备TSA等部分。
准备Windows Worker
现在我们将关注要转换为Concourse worker的Windows服务器。
首先,我们需要创建一个目录来存放工作服务及其数据的二进制文件,即C:\concourse。
C:\> mkdir concourse
C:\> cd concourse
C:\concourse>
现在从Concourse下载页面下载Windows Concourse二进制文件(例如“concourse_windows_amd64.exe”),并将其放置在我们的工作目录中。另外,我们还需要将“tsakey.pub”和“workerkey”文件复制到那里。
将“tsakey.pub”提供给本地Concourse二进制文件,可以建立我们对于部署中的TSA服务器的加密信任关系。
现在我们准备启动worker,并让它向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
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