Last Updated: February 25, 2016
·
230
· glebm

Tag deployments in git

Here is a tiny script I use to tag deployments in git:

#!/usr/bin/env bash

set -e

create_and_push_tag() {
  local timestamp="$(date +'%y.%m.%d-%H.%M')"
  local tag="prod-${timestamp}"
  set -x
  git tag -a "$tag" -m "Production release on $timestamp"
  git push origin "$tag"
  set +x
}

create_and_push_tag