If we just include the first 10 characters of the commit, this will push containers that are well versioned! However (as a lazy) user, I sometimes really do just want the latest, whatever it may be :) How about, as a suggestion, at the end also tagging the image for latest, and pushing with the tagged? E.g., it would look like this:
echo "Container name set to ${CONTAINER_NAME}:${DOCKER_TAG}"
if [[ -n "$DOCKER_PASS" ]]; then
docker login -u $DOCKER_USER -p $DOCKER_PASS
docker push ${CONTAINER_NAME}:${DOCKER_TAG}
echo "Tagging latest image..."
docker tag ${CONTAINER_NAME}:${DOCKER_TAG} ${CONTAINER_NAME}:latest
docker push ${CONTAINER_NAME}:latest
fi
If we just include the first 10 characters of the commit, this will push containers that are well versioned! However (as a lazy) user, I sometimes really do just want the latest, whatever it may be :) How about, as a suggestion, at the end also tagging the image for latest, and pushing with the tagged? E.g., it would look like this: