checkout directory question

Answered

Just a quick question about the checkout directory process - will a unique directory be created for each build, or can two builds (that aren't running in parallel) use the same checkout dir?

 

I'm asking that because I would like the have the option of investigating old builds and looking at the files in their checkout dir. But I think I noticed that if I run a build over and over again, it seems to use the same checkout dir, so I cant assume old files would be saved and not ve overwritten.

 

If that's the case, my only option is to manually create a unique dir inside the checkout dir for each build (using the current timestamp for example)

 

thanks!

0
3 comments

Hello Tamir,

This section of documentation (https://www.jetbrains.com/help/teamcity/build-checkout-directory.html#Custom+checkout+directory) covers the logic behind the checkout directory generation. Long story short, checkout directory will be shared for the builds which have the same VCS settings (e.g. the same set of VCS roots, with same checkout rules and root settings).

Indeed, data would be overwritten by the new builds running in the same checkout directory. Please mind that creating a directory inside of the checkout directory is not recommended for the long-term storage as the checkout directory is considered to be temporary and could be cleared if you would run Clean Checkout or if auto-cleanup conditions are met (https://www.jetbrains.com/help/teamcity/build-checkout-directory.html#Automatic+Checkout+Directory+Cleaning). 

For your case, there are two approaches I can think of:
1) you may publish the build files as artifacts (depending on size of the files, this may or may not be feasible, and at any rate you would probably want to set up a cleanup rule to remove the older than X builds).
2) you may also specify a custom checkout directory *https://www.jetbrains.com/help/teamcity/2020.1/build-checkout-directory.html#Custom+checkout+directory) at the VCS settings of the build; you can reference the build parameters there, so for instance you could concatenate the build configuration ID and build number for a semi-unique folder name.

I hope this helps; please let me know in case of any further questions.

1

thanks! this solves the issue.

 

just another question about it- for default checkout folder, i know they are deleted after 8 days by default. does this apply for custom checkout dirs as well?

and if not, is it possible to configure when it should be deleted in teamcity?

 

thanks!

 

 

0

Hello Tamir,

Sorry for the delay - for this matter, custom checkout dir will not differ from the "regular" one, and it will be cleaned up on the same conditions.

0

Please sign in to leave a comment.