Custom condtition for "Suitable Builds"
Is there way to provide custom condition for the build to be "Suitable"?
Im using two configurations. One configuration produces artifacts for another but its not have a VSC Root. I need to build this only if there no build for specified version otherwise dependent configuration must use artifacts from last successful build
Please sign in to leave a comment.
Hi! It isn't possible to adjust the criteria for build suitability for snapshot dependencies described in the documentation. Still, in most cases, you can configure TeamCity for your scenario without having to adjust those.
As I understand, you are looking for some custom logic for deciding which build to download the artifact from. I am not sure I fully understand your use case, though. Here are my takeaways from the provided description:
Assuming my understanding is correct, that should be achievable with a custom script. In such a scenario, the consumer will not "reuse" the builds of the producer but rather will download the artifact from the required build selected based on the logic specified in a custom script.
You can access the artifacts from a build with a given ID or the latest successful build using the patterns provided here.
How you determine the build ID may vary depending on how you specify the version and what you use as the version. Feel free to explain that if you need further guidance.
Alternatively, if you are willing to let your producer configuration run a new build if there isn't an artifact of the specified version, you can rely on snapshot dependency + artifact dependency on the build from the same chain. To make it work, do this:
I hope that helps!