Dependency not sticking around
I'm sure this is a dumb mistake on my part but I can't find the right answer.
I have a project that has a snapshot dependency on another project. For sake of discussion website is dependent on toolkit.
Monitoring the build folder:
c:\programs\Teamcity\buildagent\work
I see the toolkit get built and the folders all exist as expected:
c:\programs\teamcity\buildagent\work\toolkit
Then the website build kicks off and the folder above gets deleted before the website build starts.
This results in the website saying the reference couldn't be found. What setting am I missing?
Please sign in to leave a comment.
Should have mentioned I am using TC 7.1.2.
Have a security review process at my employer and am working on upgrading.
*bump*
Hi,
Sorry for delay. If I correctly understood your use case, you need to use artifact and snapshot dependency. Toolkit will publish artifacts and website build will download artifacts in its working folder before running.
My problem though is that I need the files to stay where they were checked out and built.
This all worked at some point for another employee, but now that I'm trying to use it (no changes to the build script/settings) it is wiping out the /toolkit/ folder before it builds the website. The website is looking in ../../../toolkit for the files, and if that folder stays there, it will find it.
When I build toolkit on its own the files stay put, but when I run the website, it kicks off a toolkit build and then deletes the output.
TeamCity assumes control over the <buildAgent>/work directory and can delete subdirectories if they are not used by any of the builds. For more details please see Automatic Checkout Directory Cleaning section. Also by default, each build has the required free space set to 3Gb. Please also read this section.
It is not recommended to use work directory to share files between builds, as you can see it is not reliably. As I mentioned please use artifact dependencies in this case.
I'm not sure what should go in the text box when creating an artifact dependancy to get the resources I need.
The toolkit build looks like this:
toolkit/web/bin/*.dll
toolkit/common/bin/*.dll
toolkit/example/bin/*.dll
How can I get all of those dlls?
You need to put relative to the Build Checkout Directory path to needed dlls, wildcards are supported. For more details see this section.
If toolkit folder is in working directory then artifact path should be as you wrote above.
FYI: Since TeamCity 8.1, if you have a build finished on an agent, you can browse the checkout directory and select artifacts from a tree. So we would recommend you to upgrade.