Notifying Eyes when a build is complete
By setting the APPLITOOLS_BATCH_ID environment variable, (as described in Configuring your CI for Bitbucket integration), Eyes puts the results of all tests in a particular CI build in the same Test Manager batch. In some setups, you need to disable this automatic notification and add a cURL command to notify Eyes when a build is complete. Below are the most common setups when this command is needed:
-
In your CI system, Bitbucket cannot recognize an End of Build event, in which case add the cURL command to the end of the build script to notify Eyes that the build is complete.
-
If you have multiple concurrent builds, add the cURL command to the end of main script build to prevent Eyes from receiving End of Build notifications before all builds have completed.
Setting an End of Build notification to Eyes
-
If you have multiple concurrent builds, on the Bitbucket integration page of the Test Manager, disable automatic batch closing. This is a one-time configuration that needs to be done by each team for each repository that has concurrent builds.
-
Add an cURL command at the end of the build script to tell Eyes that the build is complete. The following is an example of the required script in a Linux-based system:
Copycurl -X POST "$APPLITOOLS_SERVER_URL/api/externals/bitbucket/servers/<bitbucket server host>/commit/$APPLITOOLS_BATCH_ID/complete?apiKey=$APPLITOOLS_API_KEY"
Where:
-
$APPLITOOLS_SERVER_URL
: The URL of the Eyes server as configured in Configuring your CI for Bitbucket integration. -
<bitbucket server host>
: The URL of the Eyes server. If you use the public Bitbucket server, the URL isbitbucket.org
. -
$APPLITOOLS_BATCH_ID
: The Commit SHA of the current build as configured in Configuring your CI for Bitbucket integration. -
$APPLITOOLS_API_KEY"
: Your API key. To obtain your key see How to obtain your API key.
-