VSTS Push Package(s) to Octopus, support wildcards

Hi I’m using the marketplace extension for azure devops to push packages to Octopus.

I need to push all packages in a folder to octopus. In the team city plugin wildcards are supported. In the VSTS Push Package(s) to Octopus step it requires one package per line.

This is very difficult because I cannot initialize a multiline variable from a Powershell Task in VSTS release pipelines. I also cannot just call the tool myself with the right parameters from powershell because the credentials are locked up in the service connection and can’t be accessed from a script.

Can you provide either 1) multiple paths separated by something other than newline? or 2) support wildcards for the package name/path.

Hi Daniel,

Thanks for getting in touch. I’ve just checked and in our test instance that field does support globbing and wildcards. Could I get you to check which version of the extension and which version of the step (shown in a dropdown on the step) you are using?

Would you also be able to check what you are seeing on the build log for the step?

Regards
Shannon

Hi, thanks for replying.

Here is what the step looks when I am creating it.

image

This seems to be the version of the step deployed to dev.azure.com

This is the output of the step when I try to run it.

Task         : Push Package(s) to Octopus
==============================================================================
Description  : Push your NuGet or Zip package to your Octopus Deploy Server
Version      : 4.0.387
Author       : Octopus Deploy
Help         : Version: 4.0.387. [More Information](https://g.octopushq.com/TFS-VSTS)
==============================================================================
dd847bf1-f448-4d32-882e-feb6378d2945 exists true
Attempting to contact https://g.octopushq.com to find Octo command line tool version latest
Checking local tool cache
Found tool in cache: Octo 6.13.1 x64
Looking for C:\vsts-agent\_work\_tool\Octo\6.13.1\x64\*Octo.dll
Prepending PATH environment variable with directory: C:\vsts-agent\_work\_tool\Octo\6.13.1\x64
[command]C:\Windows\system32\cmd.exe /D /S /C "C:\vsts-agent\_work\_tool\Octo\6.13.1\x64\Octo.cmd version"

C:\vsts-agent\_work\r1\a>dotnet "C:\vsts-agent\_work\_tool\Octo\6.13.1\x64\/Octo.dll" version 
6.13.1
[command]C:\Windows\system32\cmd.exe /D /S /C "C:\vsts-agent\_work\_tool\Octo\6.13.1\x64\Octo.cmd push "--server=https://build.somecompany.com:4431/" "--apiKey=***" "--space=Default" "--package=deploy-packages/*.zip" "--overwrite-mode=FailIfExists""

C:\vsts-agent\_work\r1\a>dotnet "C:\vsts-agent\_work\_tool\Octo\6.13.1\x64\/Octo.dll" push "--server=https://build.somecompany.com:4431/" "--apiKey=***" "--space=Default" "--package=deploy-packages/*.zip" "--overwrite-mode=FailIfExists" 

System.ArgumentException: Illegal characters in path.
Parameter name: path
   at System.IO.Path.GetFullPath(String path)
   at Octopus.Cli.Util.OctopusPhysicalFileSystem.GetFullPath(String relativeOrAbsoluteFilePath) in C:\buildAgent\work\289bf0fca31007af\source\Octopus.Cli\Util\OctopusPhysicalFileSystem.cs:line 370
   at Octopus.Cli.Commands.Package.PushCommand.EnsurePackageExists(IOctopusFileSystem fileSystem, String package) in C:\buildAgent\work\289bf0fca31007af\source\Octopus.Cli\Commands\Package\PushCommand.cs:line 93
   at Octopus.Cli.Commands.Package.PushCommand.<>c__DisplayClass2_0.<.ctor>b__0(String package) in C:\buildAgent\work\289bf0fca31007af\source\Octopus.Cli\Commands\Package\PushCommand.cs:line 26
   at Octopus.Cli.Infrastructure.Option.Invoke(OptionContext c) in C:\buildAgent\work\289bf0fca31007af\source\Octopus.Cli\Infrastructure\Options.cs:line 492
   at Octopus.Cli.Infrastructure.OptionSet.Parse(String argument, OptionContext c) in C:\buildAgent\work\289bf0fca31007af\source\Octopus.Cli\Infrastructure\Options.cs:line 836
   at Octopus.Cli.Infrastructure.OptionSet.<>c__DisplayClass22_0.<Parse>b__0(String argument) in C:\buildAgent\work\289bf0fca31007af\source\Octopus.Cli\Infrastructure\Options.cs:line 742
   at System.Linq.Enumerable.WhereArrayIterator`1.ToList()
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Octopus.Cli.Infrastructure.OptionSet.Parse(IEnumerable`1 arguments) in C:\buildAgent\work\289bf0fca31007af\source\Octopus.Cli\Infrastructure\Options.cs:line 740
   at Octopus.Cli.Infrastructure.Options.Parse(IEnumerable`1 arguments) in C:\buildAgent\work\289bf0fca31007af\source\Octopus.Cli\Infrastructure\OptionGroup.cs:line 36
   at Octopus.Cli.Commands.ApiCommand.<Execute>d__34.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Octopus.Cli.CliProgram.Run(String[] args) in C:\buildAgent\work\289bf0fca31007af\source\Octopus.Cli\CliProgram.cs:line 52
Exit code: -3

Update.

It looks like wildcards DO work. The path I was specifying was incomplete, it should have been…

Default\drop\deploy-packages\*.zip

Once the path was valid, it DID find the packages and deployed them. I guess I was confused by the original error and the help text for the step.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.