  A Fabric Function for git Tagging    • submit to reddit
Listed below is a Fabric function for determining the
appropriate git reference to deploy during a deployment. It
works well with projects run using the git-flow development
model.   Assume there is a test environment where:    • the QA
team to assess release candidates   • developers to run
integration tests   • developers can deploy 'debug' builds from
a specific (untagged) commit  There will also be stage and
production environments.  Fabric function  The following
function can be used as part of Fabric build script. It's
purpose is to determine the git reference to deploy from.  def
determine_refspec_to_deploy_from(is_test=False)     local('git
fetch --tags')      if is_test:         create_tag = prompt('Tag
this release? [y/N] ')         if create_tag.lower() == 'y':
notify("Showing latest tags for reference")
local('git tag | sort -V | tail -5')             refspec =
prompt('Tag name [in format x.x.x]? ')             loca