Error: More than one package matched with specified pattern: *.deploy.cmd. Please restrain the search pattern
Asked Answered
T

2

6

Azure DevOps Build artifact drop contains following files:

  • Project1.zip
  • Project1.deploy.cmd
  • Project2.zip
  • Project2.deploy.cmd

These files are a result of build output of a single solution.

I want to deploy Project1 web app to Azure.

I set up a release definition and add a Deploy Azure Web Service task to it. The task's path to package file or folder contains value which matches exactly one file Project1.zip . Nowhere do I specify any *.deploy.cmd files.

When the release executes it fails on that task with error: More than one package matched with specified pattern: *.deploy.cmd. Please restrain the search pattern.

The only work-around I've found is to delete 2.deploy.cmd so that the deploy dask won't find multiple files using specified search pattern. But I would like to not delete it, especially because I would like to eventually deploy Project2 too. How to solve this problem?

Tomasine answered 4/7, 2019 at 15:40 Comment(2)
@LeoLiu-MSFT yesTomasine
It seems to be a bug in the way the task looks for the cmd file github.com/microsoft/azure-pipelines-tasks/issues/11700Tantivy
D
2

I would suggest that you locate your artifacts in different folders.

You can use a Powershell task before you invoke your web deploy task to

  • create two folders
  • move the .cmd and .zip folders for project 1 into one folder
  • move the .cmd and .zip folders for project 2 into the second folder

You can then invoke your web deploy task against the folder path for project 1 and this should side-step your issue.

You can also extract the zip file and then point the web deploy task at the folder instead which may also help you if the above is either too complex or fails for your specific use case.

Dylan answered 2/2, 2021 at 9:20 Comment(0)
W
-2

Don't use a wildcard. Specify an exact path to the file you want to deploy. If you want to deploy multiple things, use multiple tasks.

Welty answered 4/7, 2019 at 16:30 Comment(2)
Where to specify? I've already specified a path to a single card, with no wildcards.Tomasine
The deploy.xml can't be specified for now.Invalid

© 2022 - 2024 — McMap. All rights reserved.