soziblewuup
soziblewuup

Reputation: 35

Duplication of folders when committing to Git Repo from Azure DevOps Pipeline

The process outlined below is simplified to demonstrate the issue I'm facing.

Process:

enter image description here

Behavior on first run of pipeline

enter image description here

Behavior on second run of pipeline

enter image description here

Behavior on third run of pipeline

enter image description here

Manual Cleanup

enter image description here

Why is the folder duplicated on the second run of the pipeline, and is there anyway to stop this?

Upvotes: 0

Views: 586

Answers (1)

LoLance
LoLance

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

Related Questions