Let's be honest - deployment story with J2EE application servers was total mess and I still have nightmares.
But you're right - today's world of YAML programming is no better.
Nix and Guix are steps in the right direction (but both have their fair share of issues)