compose/script/build/write-git-sha
Ulysses Souza 2b24eb693c Refactor release and build scripts
- Make use of the same Dockerfile when producing
an image for testing and for deploying to
DockerHub

Signed-off-by: Ulysses Souza <ulysses.souza@docker.com>
2019-04-17 16:08:33 +02:00

13 lines
474 B
Bash
Executable File

#!/bin/bash
#
# Write the current commit sha to the file GITSHA. This file is included in
# packaging so that `docker-compose version` can include the git sha.
# sets to 'unknown' and echoes a message if the command is not successful
DOCKER_COMPOSE_GITSHA="$(git rev-parse --short HEAD)"
if [[ "${?}" != "0" ]]; then
echo "Couldn't get revision of the git repository. Setting to 'unknown' instead"
DOCKER_COMPOSE_GITSHA="unknown"
fi
echo "${DOCKER_COMPOSE_GITSHA}"