The contents of symlinks are getting removed by the clean working directory feature in Windows. This only affects Junctions. Windows also has a type of symlink just for directories, called Junctions (see Notes for more information). This does not affect soft links.
- Bamboo 6.x building on Windows agents.
- Create a test folder named TestDirectory inside the Windows server where the agent is running on.
- Create a couple text files in there that can be safely removed as part of the test. Do not place important files inside this directory because they will get removed.
- Set up a Script task inside your build plan with the following command:
- During the build process Bamboo will create a symlink (Junction) to the TestDirectory inside the build working directory.
- Inside the Job configuration page, go to the Miscellaneous tab.
- Check the Clean working directory after each build box.
- Run a new build.
The build working directory is clean after the build is finished. No errors. The symlink was successfully removed and the original directory exists with all its content.
The build working directory is clean after the build is finished. No errors. The symlink was successfully removed and the original directory exists BUT all the data inside the original directory is now gone.
Junctions look and act like soft links. The key difference is that they allow you to link directories that are located on different local volumes (but still on the same computer).
Do not use the Clean working directory after each build feature if you're using Junctions, instead add a new task at the end of your job and manually cleanup the build working directory using a Script task.