I’m trying to do a slight modification to this plugin https://github.com/bitbar/testdroid-run-in-cloud-plugin.
I want to export the test results URL that are provided by the Testdroid API as a job environment variable something like TEST_CLOUD_LINK. I found the variable that holds this information in the CloudLink class but I’m not sure on how I could export it as a env variable to use in the build.
Anyone can help with an example?
I managed to get it working.
Fist I defined an Action class implementing EnvironmentContributingAction interface.
After that I modified this snippet bellow inside the @Override perform() method of the class that implements the abstract builder.
Now I can use my CLOUD_LINK environment variable inside the Jenkins build to post the results url in a Slack notification for example.
Here is the pull request https://github.com/jenkinsci/testdroid-run-in-cloud-plugin/pull/4