We have following build chain:
- deploy (snapshot& artifact dep. on 1)
- integration tests (snapshot dep. on 2) - issues remote calls to the deployed application
The problem is that the snapshot dependency between 3 and 2:
- If I check "Do not run new build if there is a suitable one" then it will not trigger deployment if given branch was built in the past. E.g. chain is executed for branch A rev 1 (build, deploy, tests), then for branch B rev 2 (build, deploy tests), then when someone runs the tests for A-1 it will skip the the build (ok) and the deployment (will "reuse" it) - that's bad
- If I do not check "Do not run new build if there is a suitable one" then every time someone wants to run the tests will also trigger the deployment - that's bad.
What I want is the following behavior: when someone runs the tests on A-1 it should run deploy only if the most recent deployment was for version other than A-1.
How to achieve that?