Change snapshot tag to contain the date

This commit is contained in:
Lars Gohr
2019-08-25 19:56:47 +02:00
parent 12169ed809
commit 07e6ebee2d
6 changed files with 26 additions and 15 deletions

View File

@@ -36,7 +36,9 @@ fi
echo ${INPUT_PASSWORD} | docker login -u ${INPUT_USERNAME} --password-stdin ${INPUT_REGISTRY}
if [ "${INPUT_SNAPSHOT}" == "true" ]; then
SHA_DOCKER_NAME="${INPUT_NAME}:${GITHUB_SHA}"
timestamp=`date +%Y%m%d%H%M%S`
shortSha=$(echo "${GITHUB_SHA}" | cut -c1-6)
SHA_DOCKER_NAME="${INPUT_NAME}:${timestamp}${shortSha}"
docker build $CUSTOMDOCKERFILE -t ${DOCKERNAME} -t ${SHA_DOCKER_NAME} .
docker push ${DOCKERNAME}
docker push ${SHA_DOCKER_NAME}