Reputation: 35
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
Behavior on second run of pipeline
Behavior on third run of pipeline
Manual Cleanup
Why is the folder duplicated on the second run of the pipeline, and is there anyway to stop this?
Upvotes: 0
Views: 586
Reputation: 28196
Why is the folder duplicated on the second run of the pipeline, and is there anyway to stop this?
The behavior you encountered has something to do with the Commit to Git task
from Azure Devops Service extension: Backup data during build or release.
I reproduced same issue and found that this strange behavior would happen if your files were placed in one folder (Solutions
). If our files are in root directory of Path
, it works well to override the old files with same names.
To answer your original question:
1.The reason why the folder is duplicated on the second run
is related to the design of the task itself instead of Azure Devops Service.
2.And the only way to stop this is to place your xx.zip
directly in path ($.Build.ArtifactStagingDirectory)
instead of creating Solutions
folder. Also, you may try opening issue here to contact the author of this extension. I guess the author would consider modifying the extension if he gets your feedback.
In addition:
Though using git-related tasks is very easy to do some git actions, I suggest you can also consider using CMD/PS task to use git commands to do the commit/push/... You can find many topics online and here's one of my related issue.
Hope it helps :)
Upvotes: 1