Description
Summary (Original content by the reporter)
When checking out code, the 'Source Code Checkout' task has an option named 'Force Clean Build' to clean out the directory prior to checking out the code. I've discovered that although this option is checked, the code directory is not being consistently cleaned out before fresh code is being checked out.
Files that have been deleted from the repository are still present in the per-plan directory on each agent that has run the plan, even after several manual runs of the plan have been run on the agents. This causes confusion and delay to the builds as outdated information is used.
Please ensure that 'Force Clean Build' actually does what the documentation says it does, that is, remove the directory before running the build.
Steps to Reproduce
- Install latest Bamboo v5.9.4 (OS does not matter)
- Link to a Git repository
- Create a plan with 2 stages:
- Stage1: It has a single job with 'Source Code Checkout' task
- It checks out the source code from the linked Git repository
- It enables 'Force Clean Build'
- It shares every file as an artifact (i.e. copy pattern: **/*)
- Stage2: It has a single job with 'Script' task
- It has a artifact dependency to be shared the artifact
- It executes $ find . to check the working copy of the repository
- Stage1: It has a single job with 'Source Code Checkout' task
- Execute the plan
- Delete a file from the repository
- Execute the plan again. The log of Stage2 tells that the deleted file is still accessible
Expected Results
The deleted file is not accessible any more
Actual Results
The deleted file is still accessible
Workaround
Delete the working directory manually before the plan is run (<BAMBOO_HOME>/xml-data/build-dire/<PROJ>-<PLAN>-<JOB> directory). You may do it in another task which is executed prior to 'Source code checkout' task