2015-11-12 23:29:58 +01:00
|
|
|
#!/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.
|
2018-11-22 15:58:41 +01:00
|
|
|
# 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
|
2019-04-12 18:46:06 +02:00
|
|
|
echo "${DOCKER_COMPOSE_GITSHA}"
|