Is it possible to publish build artifacts with paths other than original?
I have built folders with all necessary files to publish:
SolutionName\Project1\bin\$(BuildConfiguration)
SolutionName\Project2\bin\$(BuildConfiguration)
I want to get:
\\share\$(Build.BuildNumber)\$(BuildConfiguration)/Project1
\\share\$(Build.BuildNumber)\$(BuildConfiguration)/Project2
In Publish build artifacts step I specified
**\bin\$(BuildConfiguration)\*
$(Build.BuildNumber)
\\share
And get
\\share\$(Build.BuildNumber)\Project1\bin\$(BuildConfiguration)\...
\\share\$(Build.BuildNumber)\Project2\bin\$(BuildConfiguration)\...
You can use the Copy File task .In this task you could be able to the original directory structure and publish Build Artifacts through $(Build.StagingDirectory)
.
See this question for details: Copy one file in target directory on deploy from visual studio team services
Update
In your situation, the arguments should be(could change them based on your needs) :
Two copy files task for each project:
Source Folder: $(Build.SourcesDirectory)\SolutionName\ProjectName\bin\$(BuildConfiguration)
Contents: **\*
Target Folder:
$(Build.StagingDirectory)\$(Build.BuildNumber)\$(BuildConfiguration)\projectX
One Copy and Publish Build Artifacts
\\share