2

I'm looking at creating a DevOps pipeline to build a .NET project within a repository and then to copy the output of that build into another folder in the repository.

So I have something like this

Root
    CommonFiles
    Project 1
    Project 2
    NetProject

So I want to build the project inside NetProject and copy the resultant DLL to the CommonFiles folder. The other projects will then use that DLL when they are build. The other projects that reference the DLL are VB6 projects, hence not using nuget or other package managers.

I can't see any variables or such like to use in the pipeline to copy the file to the correct location. Does anyone have any ideas or am I missing something obvious.

Thanks in advance

Ian Boggs
  • 522
  • 3
  • 16

1 Answers1

1

Devops pipeline to copy output into Repo

By default the source files are checked out to the Build.SourcesDirectory (e.g : Directory: D:\a\1\s), it can be considered as a temporary git repository.

To resolve this issue, you need to use the copy task to copy the files from the output folder of the NetProject to the CommonFiles.

After that all the files still in the Build.SourcesDirectory instead of our repo.

We need use the git command to push those files to the reppo, like:

git add Test.txt

git commit -m "Add a test file"

git push https://PAT@dev.azure.com/xxx/xxx/_git/xxx HEAD:master

You could check my another thread for some more details.

Note: Please note that you need to Grant version control permissions to the build service and enable Allow scripts to access the system token.

enter image description here

Leo Liu
  • 71,098
  • 10
  • 114
  • 135