0

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

  • Copy root SolutionName Content **\bin\$(BuildConfiguration)\*
  • Artifact Name $(Build.BuildNumber)
  • Path \\share

And get

  • \\share\$(Build.BuildNumber)\Project1\bin\$(BuildConfiguration)\...
  • \\share\$(Build.BuildNumber)\Project2\bin\$(BuildConfiguration)\...
SerG
  • 1,251
  • 4
  • 18
  • 37
  • I have created a test and updated my reply with detail steps, arguments to achieve this. You could follow it or change them based on your needs. Please kindly review it. – PatrickLu-MSFT Apr 05 '17 at 07:18

1 Answers1

1

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

enter image description here

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

  • Mostly the same with my screenshot above, Artifact Type should be File share and Path \\share

Finally, you will get the result as below: enter image description here

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62
  • But I have only `Windows Machine File Copy` no `Copy File` task – SerG Apr 06 '17 at 13:48
  • 1
    @SerG I'm afraid your TFS2015 version is lower than **TFS2015 update3**. This task is only aviable with TFS 2015 Update 3 and later. You may have to update your TFS2015 version to use it. – PatrickLu-MSFT Apr 07 '17 at 01:46