is it possible to make an artifact dependency conditional?

Hi Experts!

Our stack consists of about 50 python services. A full build in TeamCity builds all of them. We also have things setup so we can just build one or more. We do that with a build job that takes a filter of service names, and it only builds those you list in the filter.

One of the services, let's call it DEP, uses a big binary that is compiled from C++ and it's rather expensive to compile, takes something like 20 minutes. Let's call that binary BIG.

So only DEP depends on BIG, no other of the remaining 49 services need it.

In the full build, it makes sense to compile BIG as an artifact dependency so it's always built first when doing the full build.

But for the filtered one, I'd like to only build BIG if DEP is in the filter list. Is that possible? I don't think there's any way to make an artifact dependency conditional, but I could be wrong. Not an expert in TeamCity!

If there is no way to make the artifact dependency conditional, do you have any advice on how to handle this?

Thanks, 

Jesse

0
2 comments

Hi Jesse,

At the moment it is not possible, but there is a feature request for this that hopefully will be implemented later this year:

https://youtrack.jetbrains.com/issue/TW-65341/Execute-a-dependency-basing-on-condition

I don't know if it is possible to set up with your current configuration, but reusing builds is something I would definitely try to explore here.

Thanks,

Guilherme

 

0

Thanks we do have the “Do not run new build if there is a suitable one” and “Only use successful builds from suitable ones” boxes checked. The point is that most of the services do not need BIG at all, only one of them does (DEP).

What we did to work around this is create a separate job in TC for building DEP so all the others are not slowed down in the case that BIG has not been built from same git hash already.

0

Please sign in to leave a comment.