0

Similar to the question here: Copy one file in target directory on deploy from visual studio team services, I am trying to copy the contents of the app.publish directory of a ClickOnce application via VSTS build/release.

This is the Copy Publish Artifact step of the Build Copy Publish Artifact Step

This obviously outputs everything in the bin folder to the drop folder on the server share.

This is the Copy Files step of the Release Copy Files Step

This copies only the files in the app.publish folder but it builds out the entire hierarchy to the folder app.publish folder; however, it builds out the full folder structure. i.e. bin\Release\app.publish or bin\Debug\app.publish.

I like the idea of being able to publish and store different configurations (debug/release) but I don't like that I'm having to specify the InstallUrl in the msbuild arguments in order to pick up debug/release in the folder path. Even if I didn't try to maintain multiple configurations, the configuration would still be in the path.

So my question is: Is there a way to use the copy files task to just copy the app.publish folder and/or the contents to another location, without it creating the full hierarchy?

Community
  • 1
  • 1
Brian Swart
  • 922
  • 1
  • 9
  • 25

2 Answers2

0

You need to specify the copy root in Source Folder of Copy Files, in your example, the copy root should be like:

Source Folder: $(System.DefaultWorkingDirectory)\$(Build.DefinitionName)\bin\$(BuildConfiguration)\

Contents: **\app.publish\**

In this way, you should only have app.publish in your Target Folder.

Cece Dong - MSFT
  • 29,631
  • 1
  • 24
  • 39
  • The $(BuildConfiguration) variable is not available in the RELEASE Copy Files step without manually creating it. However, I wanted for the release definition to pull from whatever the build configuration was of the build that is associated with the release definition. – Brian Swart Aug 19 '16 at 12:09
  • How about use this step in Build definition and drop the app.publish folder with other outputs together. – Cece Dong - MSFT Aug 24 '16 at 07:44
0

Configure the "Copy Root" of "Copy Publish Artifacts" step in your build definition to the path of build configuration folder and "Content" to "**".

For example, if the path of your build output is:

C:\a\1\s\SolutionFolder\ProjectFolder\bin\Relase\app.publish...

You can set the Copy Root to:

$(build.sourcesdirectory)\SolutionFolder\ProjectFolder\bin\$(BuildConfiguration)

And Content set to:

**

Eddie Chen - MSFT
  • 29,708
  • 2
  • 46
  • 60