user7784348
user7784348

Reputation: 265

VSTS MSDeploy Deep Nested Path

I am using VSTS build for publishing my ASP.Net project and I am using below MSBuild argument to create the package.

/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageTempRootDir=Binaries/$(BuildConfiguration) /p:PackageLocation=$(Build.stagingDirectory)\xxxxxxx.zip

It's generating a package in a path shown as below

api_drop\API\Content\D_C\a\1\s\Source\xxxxx.API\ABC.PSP.OuC.TMW.Api\obj\Release\net471\PubTmp\Out

Now I want the binaries from Out directories to be zipped but MsDeploy command gives me complete above path in zip.

How can I flatten it?

Thanks

Upvotes: 2

Views: 207

Answers (1)

Andy Li-MSFT
Andy Li-MSFT

Reputation: 30432

You can try to output the files without zip, then you can try below ways:

  1. Specify the argument OutputPath only (without specifying the package related arguments):

e.g:

/p:OutputPath="$(build.artifactstagingdirectory)\cc"

You can also output the target files to a shared path (UNC path):

e.g:

/p:OutputPath="\\myshare\DirA\0313"
  1. Then use Copy and Publish build Artifacts task to publish the files. Alternatively you can add a Copy Files task to copy the files from OutputPath to a Temp folder, then use Publish build Artifacts task to publish the files from Temp folder.

  2. Add a zip task to zip the files

Upvotes: 3

Related Questions