I've set up a Jenkins build pipeline using the Build Pipeline Plugin and the Jenkins Clone Workspace SCM Plug-in as described by Jochen Wierum
This is very useful, but I have a question... The Clone Workspace SCM plugin only lets you get the most recent (good) build, so the pipeline diagram can be a little misleading. If I manually trigger my pipeline's second stage in, say, build number 4, but the first stage in build number 5 has already happened, then the second stage I'm triggering will actually use the build artifcats from build number 5. This could be confusing and potentially dangerous.
Is there a better workflow for build pipelines that's guaranteed to use the specific upstream build artifacts of this particular build set?
I understand that the Clone Workspace SCM plugin only stores the most recent, but I'm thinking there might be a way to achieve my goal using the standard Archive the artifacts post-build action to keep acrhives of all successful builds. I just can't figure out how to use that as the source of the next stage.
I've already found this answer but in my case I'm not trying to use a specific revision, but the exact result of the previous build stage. For example one of my build stage jobs might be to publish to staging environment. For that I don't want to have to go all the way back to source control and build from scratch when the whole point is that my earlier stages have built, run tests, etc.