The process outlined below is simplified to demonstrate the issue I'm facing.
Process:
Create ‘Solutions’ folder in artifact staging directory ($.Build.ArtifactStagingDirectory).
Install required tools
Export .zip package from Dynamics 365 source system to ‘Solutions’ folder in artifact directory ($.Build.ArtifactStagingDirectory\Solutions)
Publish Artifact ($.Build.ArtifactStagingDirectory)
Commit Artifact to a Git Repo
Behavior on first run of pipeline
- Correct folder structure is observed.
Behavior on second run of pipeline
- Duplication of root folder
Behavior on third run of pipeline
- Second level down Solution folder is found and updated.
- It is only the second run of the pipeline that duplicates the root folder. From here on in, it will find and update the file in the duplicated, second level down, folder.
Manual Cleanup
- I can remove the contents of the top-level solutions folder to give me this structure – which looks cleaner. Still, this is not ideal given there is an unnecessary Solutions folder with no contents.
Why is the folder duplicated on the second run of the pipeline, and is there anyway to stop this?