Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 665
Bogdan Verbenets Avatar asked Jul 04 '19 15:07

Bogdan Verbenets


1 Answers

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.

like image 90
James G Avatar answered Nov 12 '22 15:11

James G