TFS2018打包步骤及包含文件

TFS2018 package step and include files

我在构建过程中将 Octopus 用于打包应用程序步骤。在高级选项下,我为包含文件指定了 /bin/*.dll。但是构建不会拾取文件。如果我将 include 留空,它会拾取所有文件。这样的语法是否无效

/bin/*.dll

我也试过了

bin/*.dll

但运气不好。知道哪里出了问题吗?

这是构建步骤的屏幕截图...

这是八达通包步骤的日志

2017-12-02T17:28:15.4090188Z ##[debug]Evaluating condition for step: 'Package MyProject' 2017-12-02T17:28:15.4090955Z ##[debug]Evaluating: succeeded() 2017-12-02T17:28:15.4091343Z ##[debug]Evaluating succeeded: 2017-12-02T17:28:15.4092307Z ##[debug]=> (Boolean) True 2017-12-02T17:28:15.4093048Z ##[debug]Expanded: True 2017-12-02T17:28:15.4093619Z ##[debug]Result: True 2017-12-02T17:28:15.4095310Z ##[section]Starting: Package MyProject 2017-12-02T17:28:15.4101223Z ============================================================================== 2017-12-02T17:28:15.4101741Z Task : Package Application 2017-12-02T17:28:15.4102147Z Description : Package your application into a NuPkg or Zip file. 2017-12-02T17:28:15.4102500Z Version : 2.0.78 2017-12-02T17:28:15.4102834Z Author : Octopus Deploy 2017-12-02T17:28:15.4103263Z Help : Version: 2.0.78. More Information 2017-12-02T17:28:15.4103847Z ============================================================================== 2017-12-02T17:28:15.4115642Z ##[debug]tf vc resolvePath $\MyParentFolder\MyProject\MyProject /loginType:OAuth /login:.,******** /noprompt 2017-12-02T17:28:15.8042302Z

[debug]C:\a\w\s\MyParentFolder\MyProject\MyProject 2017-12-02T17:28:16.8462262Z ##[debug]VstsTaskSdk 0.6.4 commit

a074a158dbd70b5a72d1295ee42684c30a262b19 2017-12-02T17:28:16.9168209Z

[debug]Entering C:\a\w_tasks\OctopusPack_179fac12-2402-486e-80cf-5a6a8571f7c0.0.78\Octopus-Pack.ps1.

2017-12-02T17:28:16.9521027Z ##[debug]Env:INPUT_PACKAGEID: 'MyProject' 2017-12-02T17:28:16.9547735Z ##[debug]Env:INPUT_PACKAGEFORMAT: 'NuPkg' 2017-12-02T17:28:16.9596389Z ##[debug]Env:INPUT_PACKAGEVERSION: '20171202.3' 2017-12-02T17:28:16.9645182Z

[debug]Env:INPUT_OUTPUTPATH: 'C:\a\w\a' 2017-12-02T17:28:16.9645553Z ##[debug]Env:INPUT_SOURCEPATH:

'C:\a\w\s\MyParentFolder\MyProject\MyProject' 2017-12-02T17:28:16.9651385Z ##[debug]Env:INPUT_NUGETAUTHOR: 'MyBrand' 2017-12-02T17:28:16.9699352Z ##[debug]Env:INPUT_NUGETTITLE: 'MyParentFolder.B2BAccounts' 2017-12-02T17:28:16.9715752Z

[debug]Env:INPUT_NUGETDESCRIPTION: 'My service' 2017-12-02T17:28:16.9729595Z ##[debug]Env:INPUT_NUGETRELEASENOTES

(empty) 2017-12-02T17:28:16.9786830Z

[debug]Env:INPUT_NUGETRELEASENOTESFILE: 'C:\a\w\s' 2017-12-02T17:28:16.9812364Z ##[debug]Env:INPUT_OVERWRITE: 'false'

2017-12-02T17:28:16.9843490Z ##[debug] Converted to bool: False 2017-12-02T17:28:16.9868739Z ##[debug]Env:INPUT_INCLUDE: './bin/.dll' 2017-12-02T17:28:16.9896116Z ##[debug]Env:INPUT_LISTFILES: 'false' 2017-12-02T17:28:16.9914671Z ##[debug] Converted to bool: False 2017-12-02T17:28:16.9947636Z No Release notes file found 2017-12-02T17:28:17.0153048Z ##[debug]Entering Invoke-VstsTool. 2017-12-02T17:28:17.0269801Z ##[debug] FileName: 'C:\a\w_tasks\OctopusPack_179fac12-2402-486e-80cf-5a6a8571f7c0.0.78\Octo.exe' 2017-12-02T17:28:17.0289645Z ##[debug] Arguments: 'pack --id="MyProject" --format=NuPkg --version=20171202.3 --outFolder="C:\a\w\a" --basePath="C:\a\w\s\MyParentFolder\MyProject\MyProject" --author="RB" --title="MyParentFolder.B2BAccounts" --description="My service" --releaseNotes="" --overwrite=False --include="./bin/.dll"' 2017-12-02T17:28:17.0336805Z ##[debug] RequireExitCodeZero: 'True' 2017-12-02T17:28:17.0375950Z

[command]"C:\a\w_tasks\OctopusPack_179fac12-2402-486e-80cf-5a6a8571f7c0.0.78\Octo.exe"

pack --id="MyProject" --format=NuPkg --version=20171202.3 --outFolder="C:\a\w\a" --basePath="C:\a\w\s\MyParentFolder\MyProject\MyProject" --author="RB" --title="MyParentFolder.B2BAccounts" --description="My service" --releaseNotes="" --overwrite=False --include="./bin/*.dll" 2017-12-02T17:28:17.1287470Z Octopus Deploy Command Line Tool, version 4.22.1 2017-12-02T17:28:17.1294636Z 2017-12-02T17:28:17.3764140Z Packing MyProject version "20171202.3"... 2017-12-02T17:28:17.3926084Z Saving "MyProject.20171202.3.nupkg" to "C:\a\w\a"... 2017-12-02T17:28:17.4063617Z 2017-12-02T17:28:17.4063997Z System.InvalidOperationException: Cannot create a package that has no dependencies nor content. 2017-12-02T17:28:17.4064229Z at NuGet.Packaging.PackageBuilder.Save(Stream stream) 2017-12-02T17:28:17.4064537Z at Octopus.Cli.Commands.NuGetPackageBuilder.BuildPackage(String basePath, IList`1 includes, ManifestMetadata metadata, String outFolder, Boolean overwrite, Boolean verboseInfo) 2017-12-02T17:28:17.4064836Z at Octopus.Cli.Commands.PackCommand.<>c__DisplayClass18_0.b__0() 2017-12-02T17:28:17.4065077Z at System.Threading.Tasks.Task.InnerInvoke() 2017-12-02T17:28:17.4065264Z at System.Threading.Tasks.Task.Execute() 2017-12-02T17:28:17.4065487Z --- End of stack trace from previous location where exception was thrown --- 2017-12-02T17:28:17.4065866Z at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 2017-12-02T17:28:17.4066304Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 2017-12-02T17:28:17.4066598Z at Octopus.Cli.Program.Run(String[] args) 2017-12-02T17:28:17.4067897Z Exit code: -3 2017-12-02T17:28:17.4164951Z ##[debug]Exit code: -3 2017-12-02T17:28:17.4309447Z ##[debug]Leaving Invoke-VstsTool. 2017-12-02T17:28:17.4341893Z ##[debug]Leaving C:\a\w_tasks\OctopusPack_179fac12-2402-486e-80cf-5a6a8571f7c0.0.78\Octopus-Pack.ps1. 2017-12-02T17:28:17.4387076Z ##[debug]Caught exception from task script. 2017-12-02T17:28:17.4420714Z ##[debug]Error record: 2017-12-02T17:28:17.5138233Z ##[debug]Invoke-VstsTool : Process 'Octo.exe' exited with code '-3'. 2017-12-02T17:28:17.5149782Z

[debug]At C:\a\w_tasks\OctopusPack_179fac12-2402-486e-80cf-5a6a8571f7c0.0.78\Octopus-Pack.ps1:52

char:5 2017-12-02T17:28:17.5163924Z ##[debug]+ Invoke-VstsTool -FileName $octoPath -Arguments $Arguments -Requir ... 2017-12-02T17:28:17.5176209Z ##[debug]+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2017-12-02T17:28:17.5189971Z ##[debug] + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException 2017-12-02T17:28:17.5202114Z ##[debug] + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-VstsTool 2017-12-02T17:28:17.6236509Z ##[debug] 2017-12-02T17:28:17.6456023Z

[debug]Script stack trace: 2017-12-02T17:28:17.6456411Z ##[debug]at Invoke-Tool,

C:\a\w_tasks\OctopusPack_179fac12-2402-486e-80cf-5a6a8571f7c0.0.78\ps_modules\VstsTaskSdk\ToolFunctions.ps1: line 86 2017-12-02T17:28:17.6456866Z ##[debug]at , C:\a\w_tasks\OctopusPack_179fac12-2402-486e-80cf-5a6a8571f7c0.0.78\Octopus-Pack.ps1: line 52 2017-12-02T17:28:17.6457192Z ##[debug]at , : line 1 2017-12-02T17:28:17.6457473Z ##[debug]at , : line 22 2017-12-02T17:28:17.6457737Z ##[debug]at , : line 18 2017-12-02T17:28:17.6458018Z

[debug]at , : line 1 2017-12-02T17:28:17.6458303Z ##[debug]Exception:

2017-12-02T17:28:17.6458589Z

[debug]Microsoft.PowerShell.Commands.WriteErrorException: Process 'Octo.exe' exited with code '-3'. 2017-12-02T17:28:17.6637507Z

[error]Process 'Octo.exe' exited with code '-3'. 2017-12-02T17:28:17.6637766Z ##[debug]Processed: ##vso[task.logissue

type=error]Process 'Octo.exe' exited with code '-3'. 2017-12-02T17:28:17.6644964Z ##[debug]Processed: ##vso[task.complete result=Failed] 2017-12-02T17:28:17.6965505Z ##[section]Finishing: Package MyProject

诀窍是使用类似 ** /bin/*.dll 的模式。双星将匹配前面任意数量的文件夹。