We have a (Gradle) build that we run from TeacmCity to do a full release of our product. As part of this build, we need to pin the build. We are able to do this technically with the build id from the TeamCity properties and calling the REST API but... while the build is still running, I cannot invoke this REST API yet (we get a 400 error code back). We also tried to add a depending build that does just the pinning once the release build has passed. But in that 'pinning' build, we do not have the build id available of the release build that was the trigger.
Is there any way you could think of that we can achieve this: pinning a build while the build is running? Some post-processing build or...?
Thanks for any input.