Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSTS build Copy Files task copies full path to destination

I'm using a Copy Files task in a VSTS build to copy the results of a VS project (bin\Release folder) to a subfolder in the staging directory.

Copy Files task

What I expect is that the contents of the bin folder should be in the staging\bin folder:

drop\bin\

but instead it copies the full path to the the destination. So my binaries are all in

drop\bin\src\MySolution\MyProject\bin\Release\

Is there a way to copy just the files in my release folder to the staging folder without copying the full path?

like image 387
gregsdennis Avatar asked May 09 '17 22:05

gregsdennis


People also ask

Is it possible to copy build artifact from pipeline into repo?

You could download the artifact and use the git command in command line task to push it to the repo, refer to the sample as below, it works for me. # 'Allow scripts to access the OAuth token' was selected in pipeline.

How do I copy a pipeline from one folder to another?

Clone a pipeline For YAML pipelines, the process for cloning is to copy the YAML from the source pipeline and use it as the basis for the new pipeline. Navigate to your pipeline, and choose Edit. Copy the pipeline YAML from the editor, and paste it into the YAML editor for your new pipeline.

What is $( build SourcesDirectory?

$(Build. SourcesDirectory) : The local path on the agent where your source code files are downloaded. For example: c:\agent_work\1\s By default, new build definitions update only the changed files. You can modify how files are downloaded on the Repository tab.


1 Answers

So it turns out I just needed to change my source directory to the folder where the binaries were.

enter image description here

NOTE This only works because I know exactly where the desired files are. If you find this and you're trying to copy from multiple directories, you have a couple options:

  1. Multiple Copy Files tasks
  2. Just deal with the extra directories.
like image 63
gregsdennis Avatar answered Oct 11 '22 12:10

gregsdennis