Nat*_*ash 9 windows containers build-server windows-server-2016 concourse
我尝试设置一个支持尽可能多的语言/平台的大厅构建服务器(http://concourse-ci.org/).
我已经读过,从Windows Server 2016开始,可以将Windows作为容器.当concourse在其网站上写道支持多个平台(包括Windows)时,我想知道这是否意味着可以使用Windows容器?
如果无法运行Windows容器,我是否可以以某种方式使虚拟机而不是容器?
不幸的是,我只能找到一个页面.我也尝试过像hello world这样简单的管道,但是无法让它工作.公正地分享也许有人可以受益于它.
我省略了生成ssh密钥,准备TSA等部分.
准备Windows工作者
现在我们将注意力转向我们将转入Concourse工作者的Windows服务器.
首先,我们要建立一个目录来存放工作服务及其数据的二进制文件,即C:\ concourse
C:\> mkdir concourse
C:\> cd concourse
C:\concourse>
Run Code Online (Sandbox Code Playgroud)
现在从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
Run Code Online (Sandbox Code Playgroud)
如果一切顺利,我们应该看到类似于的输出:
{"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":""}}
Run Code Online (Sandbox Code Playgroud)
并且新工作人员应通过Concourse CLI出现在列表中:
~/ $ fly -t ci workers
name containers platform tags team
2a334e70-c75c 3 linux none none
WORKERSHOSTNAME 0 windows none none
Run Code Online (Sandbox Code Playgroud)
测试出来的东西
假设我们的Worker上有.NET框架,并且路径中有构建工具,我们可以通过构建这个简单的.NET Console应用程序项目来测试它: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
Run Code Online (Sandbox Code Playgroud)
使用构建任务:
platform: windows
inputs:
- name: code
run:
dir: code
path: msbuild
Run Code Online (Sandbox Code Playgroud)
请注意,构建任务中指定的平台是"windows".这指示大厅将任务放在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
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3013 次 |
| 最近记录: |