libretime/build.sh

31 lines
900 B
Bash
Raw Normal View History

2021-08-16 17:44:19 +02:00
#!/usr/bin/env bash
set -e # Exit if any of the steps fails.
composer install --no-dev --no-interaction
git_build=""
if [ -d .git ]; then
2021-08-16 13:45:32 +02:00
echo " * Building from Git"
git_build="y"
fi
if [ "${git_build}" = "y" ]; then
2021-08-16 13:45:32 +02:00
git_version=$(git tag --points-at HEAD)
echo " * Version from tag: ${git_version}"
if [ "${git_version}" = "" ]; then
git_version=$(git rev-parse --short HEAD)
echo " * Overriding empty version with sha1 commit-ish: ${git_version}"
fi
2021-08-16 17:44:19 +02:00
echo "${git_version}" > VERSION
else
2021-08-16 13:45:32 +02:00
# if no file was in tarball we create one letting the user know
# if you run in to this you should grab an enriched tarball built
# by travis. It already contains the VERSION file and also bundles
# all the PHP you vendors files making the install much faster on
# your part.
if [ ! -f VERSION ]; then
echo "could not detect version for VERSION file" > VERSION
fi
fi