Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure DevOps with multiple files (filelist and relative path) #253

Open
bertstomphorst opened this issue May 23, 2024 · 1 comment
Open

Comments

@bertstomphorst
Copy link

bertstomphorst commented May 23, 2024

When using Azure DevOps build (in my case on a public agent), it seems to be a bit dubious to fill my filelist.txt with a fixed path (D:\a\1\a<filename>.exe) on each line, while that path is not quaranteed.
Is there a way to use -ifl parameter with AzureDevOps, i.e. using a base-path as parameter or a pipelinevariable $(build.artifactstagingdirectory)? For now I've added all files as individual parameters. This works, but isn't as maintainable as we would like.

In sourcecode I found that wildcards are supported, but passing with wildcard (*) like $(build.artifactstagingdirectory)\folder\prefix.*.exe is not accepted (output: File 'D:\a\1\a\folder\prefix.*.exe' does not exist.)

When checking sourcecode, I found the SignCommand.AllFiles-property, with does a Matcher.Execute on Directory '.'. So there seems to be no way to specify a root-directory, and using wildcards results in results.HasMatches to be false.

Any ideas on this topic?

@aaronmilbrath
Copy link

A coworker of mine came up with a nice line within the PowerShell script referenced in the AzureCLI pipeline task. It does what you're looking for in terms of creating a local text file with the file paths populated without hardcoding paths. That file is then passed to the subsequent call to azuresigntool via the --input-file-list or -ifl parameter. This solved the issue of including multiple files that don't follow a simple file globbing pattern where input file is needed.

Get-ChildItem -Path "$(Build.SourcesDirectory)\bin\Release\net8.0\win-x64\publish\*" -Include "CompanyName.*.dll", "CompanyName.*.exe", "SomeOtherName.dll", "AnotherName.dll" | Select-Object -ExpandProperty FullName | Out-File "FilesToSign.txt"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants