If you’ve ever forgotten to push your changes to the remote repository before trying to make a deploy, you will know that it can be really frustrating to think that everything has gone live when actually it has not. This little script will help you avoid this situations.
What this does is check that we have different revisions deployed between our deployed version and the version in repositories and it will ask for confirmation in case they are the same. Just include the above code in your deploy recipe and then for the environment you want to deploy to just include the following:
If you’re doing any kind of automated deployment, let’s say from you continuous integration server to your staging server don’t include that code since it will sometimes just wait for an answer that is never going to come.
Hope this helps you and happy deployments!