Disable Delele Unknown directory
Yesterday, we successfully upgraded version 9.1 to TeamCity version 10.0.3.
But after running the cleaning routine. We have verified that our artifacts have been excluded.
With the help of the cleaning log, we found the reason.
Unknown directory found while build artifacts directory expected. Will delete directory
But in our scenario, we created a symbolic link. With the name of the assembly version number of the build. And target to the same directory that TeamCity publishes the artifacts.
Step connects to the server that stores the file and executes the commands.
CD PATH_TEAMCITY_ARTIFACT_PROJECT
MKLINK ASSEMBLY_NUMBER TEAMCITY_BUILD_ID / J
RMDIR last
MKLINK last TEAMCITY_BUILD_ID / J
This caused the TeamCity routine to clean all artifacts from builds that contained mklink, even those pinned. We lost 30 GB of artifacts.
Would you like to disable this removal of unmapped directories?
Please sign in to leave a comment.
Sorry for delay with replying. Right now TeamCity assumes that it has full control over artifacts directory, but it looks like some additional precautions could be made, for instance there is no reason to follow symlinks during cleanup. Feel free to submit a request in our bug tracker.