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.
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?
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.
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.
$(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.
So it turns out I just needed to change my source directory to the folder where the binaries were.
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:
- Multiple Copy Files tasks
- Just deal with the extra directories.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With