blob: 85ac0f67fa280aee0a719287ffdf5b2b74094f01 [file] [log] [blame]
#!/bin/bash
# Build a tag for the Docker image based on the current datetime, user, and
# repo state.
set -e
REL=$(dirname "$BASH_SOURCE")
DATETIME=`date --utc "+%Y-%m-%dT%H_%M_%SZ"`
HASH=`git rev-parse HEAD`
# Determine repo state.
GITSTATE=`${REL}/gitstate.sh`
REPO_STATE=clean
if [ "$GITSTATE" = "dirty" ]; then
REPO_STATE=dirty
fi
echo "${DATETIME}-${USER}-${HASH:0:7}-${REPO_STATE}"