Closed HackproTm closed 1 year ago
Hi @HackproTm,
sorry for the late response, this has somehow slipped my attention. I can see that you're using the task in a YAML pipeline, which doesn't really work. Due to some major changes in how YAML pipelines store the clean information, the task isn't fully able to understand what to delete. In addition, the task doesn't know how to handle multiple repositories. In your screenshot I can see multiple post-job checkout steps which leads to the assumption that you have multiple checkout steps in your pipeline.
Otherwise, the clean option would work. We handle the .git folder in a very special way to ensure that the post-job checkout step also works when our cleanup task is enabled.
Unfortunately, there is no way to move the cleanup logic after the post-job checkout logic. A task can only require to run a post-job script but these scripts are always run in reverse order of the tasks. Since the checkout task is always the very first task, its post-job step automatically runs as the very last step.
Since it will be very hard to create a YAML-ready post build cleanup task, I'm currently thinking of publishing a couple YAML template that can achieve the same things. I'll let you know when these are ready.
Hi @ReneSchumacher
I found a workaround to solve this issue. I added the "Post Build Clean" task as the first task in our pipeline, also I forced the checkout "self" repository as an additional task (overriding the default behavior). Something like this:
This put the PostJob task as the last task. And now the checkout task doesn't fail.
Thanks for taking the time to respond.
Best regards
I have a pipeline with multiple checkout repositories, I add the PostBuildCleanUp task to clean the Source Directories, but my pipeline is failing due to a compatibility issue between the "checkout" task and the "PostBuildCleanup" task
The task PostBuildCleanup create automatically a Post-Job task to Clean some directories into the Pool Agent, the problem here is due a this Post-Job is not the last task, the task "checkout" also adds another Post-Job task and this task tries to run some command into the directories that Post-Job PostBuildCleanup task delete previously. This issue breaks the pipeline.
Please move the Post Build Cleanup task to last
Task logs Run your pipeline with the following variables:
System.Debug
andPBC.LogRawData
set totrue
Post-job: PostBuildCleanup LOGS
Post-job: Checkout Repository