Is it possible to set a parameter on a completed build?

For our CI setup, I set up a composite build configuration that builds a project, runs some tests, then deploys the artifacts to a service that makes them available to the team. The deploy configuration had a dependency on both the build and the test configurations to ensure only good builds are deployed.

The deploy process gets a buildid from that service at the end of the deployment representing the artifacts uploaded to it. Currently I'm scraping that buildid from the output, and I'd like to set it as a parameter back on the build part of the chain. 

The goal here is to have the parameter on the build, so that if a new deploy is run it can skip the upload to the service, and instead have the service push the already existing upload to a different environment. Uploading the same artifacts again would take a while, and would result in duplicated builds on the service we upload to.

From what I can tell, setting a parameter on an already completed build might be possible with the reverse.dep system, but I'm not having luck prototyping this setup so far.

One alternative I've considered is using the REST API to set a comment containing the buildid back on the build once the deploy is finished. I can then modify the deploy configuration to check for comments and skip the upload and simply pass the buildid to the service.

Any other thoughts/suggestions for this scenario?

1 comment
Comment actions Permalink

Hello Tom,

I believe that using the REST API would work well for what you want to achieve. Alternatively, you could approach your scenario using one of the following approaches:

  • The easiest way to solve this scenario would probably be by using the option in Snapshot Dependencies to reuse the suitable builds, about which you can find more information in the documentation:
    https://www.jetbrains.com/help/teamcity/snapshot-dependencies.html#Suitable+Builds
  • Using service messages to set the parameter containing your build Id. You can find more about using service messages here;
  • By putting the parameters that you need in a file as an artefact and having a build configuration with a circular dependency on this artifact.

We would like to ask you for more details to see if we can guide you in the best way possible through this scenario:

  • A more detailed description about why you need the build id from the service;
  • Screenshots of your composite build configuration: you can upload them to https://uploads.jetbrains.com/ and share the upload ID with us.

Please let me know if you have any more questions.

Guilherme

 

0

Please sign in to leave a comment.