We have a Jenkins job that compiles our developers code each time they push to the repository and stores the build as an artifact (lets call it CompileApp). I have another job that smoke tests that code, copying the latest successful artifact from the build. However it cannot run against every single build due to resource constraints (call this job SmokeTest).
So SmokeTest executes periodically and each time it does I want to be able to set the build number of that job to the same build number of the CompileApp artifact I copied so that it is clear which build was tested. (I will also add a timestamp to the build number incase no builds have completed within this timeframe)
I can set the build number with the build name setter plugin which uses environment variables. But I am not sure how to access the CompileApp jobs build number using it. I have looked at the EnvInject plugin but haven't understood how to use it correctly.
Any advice and pointers would be very much appreciated.