在生成的工件中仅包含一组文件夹

时间:2019-02-04 16:50:07

标签: azure-devops azure-pipelines

我有一个桌面应用程序,其结构如下:

enter image description here

默认模板创建了一个Copy Files任务,如下所示:

enter image description here

问题在于发布的工件包括所有文件夹中生成的所有二进制文件。我不要我只想将它们包含在2个文件夹中 -Deployer.Lumia.Console -Deployer.Lumia.Gui

这是我的解决方案中的2个工具(它们生成.exe文件)

我尝试创建2个类似的任务:

enter image description here

但是我一直收到此错误:

enter image description here

这些资源是从GitHub的https://github.com/WoA-project/WOA-Deployer项目获得的

每个项目都位于\ Source文件夹中。所以我不知道为什么它说找不到。

我做错了什么以及如何解决?

2 个答案:

答案 0 :(得分:1)

您收到关于../Deployer.Lumia.Gui/bin/**的错误,因为源文件夹参数不支持通配符。

使用通配符最小匹配模式在Contents编辑框中过滤所需的文件和文件夹。

将内容带入舞台

要仅将这两个文件夹的内容放入工件暂存目录下的目录中,请设置单个复制任务,如图所示... enter image description here

在舞台上保持内容分开

如果..Gui和..Console目录的内容需要在stage dir中保持分开,则使用两个单独的复制任务是简单而直接的方法。 enter image description here enter image description here

编辑2.0

以下是我们其中一个软件包版本的示例

我们正在将.dll文件复制到阶段目录中的/ libraries位置。请注意,内容中的通配符捕获了目录结构**\bin\*.dllenter image description here

然后,我们将该目录发布为自己的工件。 enter image description here

此发布任务将创建如下所示的工件: enter image description here

但是此构建还将包发布为单独的工件。 enter image description here enter image description here

答案 1 :(得分:0)

我认为您的脚本应该是:

$(system.defaultworkingdirectory)/**/Deployer.Lumia.Gui/bin/*

应该缩小范围,否则您可以使用带有ls -Rd之类的自定义脚本任务来发现目录结构并进行调整你的路。