I have asp net solution and i'm using bamboo to deploy it. All has been working well since today. The new build has files that have been removed, but after deployment they are still in the new build folder. It looks like Bamboo creates new build folder and then gets somewhere files, that actually should not be deployed, and adds them to the new build. (old files have old last edited date, not today) If delete these old files manually - site works ok and it is a new version. We are working with SVN and files definitelly not under subversion. Artifacts 'sourcecode' and 'publishedsolution' don't have these old files. Also, I was trying to find where old files come from using files' name and last edited date - I didn't find anything on the server. Any idea? Any help will be usefull
2 Answers
You can:
- Specify that the build directory of a given job is cleaned after each build (this was mentioned above by Jonas Pedersen, however I see it as job configuration on the Miscellaneous tab, not stage).
- Force a clean build on the Source Code Checkout Task
- Use your build tool (Maven, Gradle, Grunt, Gulp, ...) to clean the project before building it.
If enabling the cleanup steps as suggested by rduncan doesn't help, another possibility to keep in mind is that your build could have absolute paths to locations outside of Bamboo's working directory. If that's the case none of the Bamboo cleanup options will help, you need to modify the build to perform the necessary cleanup (and preferably stop using those paths entirely).
As an example, I once ran into a similar issue when migrating a build into our Bamboo environment. Buried deep in the build I found some build projects included scripts that were copying specific files to C:\TEMP and a later script was packaging the entire contents of C:\TEMP into an installer. Our short-term fix was to add a script task to the start of the job build to delete the contents of C:\TEMP before the build to ensure it was empty, followed by a thorough combing of the project to make all path references relative to the root of the workspace.
Clean working directory after each build? This option is found under theActionsbutton >Configure plan>Stagestab > Click your build stage >Miscellaneoustab > CheckClean working directory after each build- Jonas Pedersen