Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-18554

Contents of Junctions are getting removed by the clean working directory feature in Windows

    XMLWordPrintable

Details

    Description

      Summary

      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.

      Environment

      • Bamboo 6.x building on Windows agents.

      Steps to Reproduce

      1. Create a test folder named TestDirectory inside the Windows server where the agent is running on.
      2. 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.
      3. Set up a Script task inside your build plan with the following command:
        • mklink /J "TestDirectory" "C:\Path\To\TestDirectory"
          
      4. During the build process Bamboo will create a symlink (Junction) to the TestDirectory inside the build working directory.
      5. Inside the Job configuration page, go to the Miscellaneous tab.
      6. Check the Clean working directory after each build box.
      7. Run a new build.

      Expected Results

      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.

      Actual Results

      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.

      Notes

      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).

      Workaround

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            brosa Bruno Rosa
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: