1
0
mirror of https://github.com/zokradonh/kopano-docker synced 2025-06-07 07:56:12 +00:00
kopano-docker/version.sh
Felix Bartels 119826e180 make it possible to build official kopano releases
Signed-off-by: Felix Bartels <felix@host-consultants.de>
2018-11-06 12:14:11 +01:00

37 lines
900 B
Bash
Executable File

#!/bin/bash
if ! hash jq; then
echo "Please install jq in order to run this build script."
exit 1
fi
source base/create-kopano-repo.sh
component=${1:-core}
if [ -e ./env ]; then
source ./env
fi
KOPANO_CORE_REPOSITORY_URL=${KOPANO_CORE_REPOSITORY_URL:-""}
KOPANO_WEBAPP_REPOSITORY_URL=${KOPANO_WEBAPP_REPOSITORY_URL:-""}
if [[ $KOPANO_CORE_REPOSITORY_URL == http* ]] || [[ $KOPANO_WEBAPP_REPOSITORY_URL == http* ]]; then
case $component in
core)
version=$(curl -s -S -L $KOPANO_CORE_REPOSITORY_URL/Packages | grep -A2 "Package: kopano-server-packages")
echo "${version##* }"
;;
webapp)
version=$(curl -s -S -L $KOPANO_WEBAPP_REPOSITORY_URL/Packages | grep -m1 -A1 "Package: kopano-webapp")
echo "${version##* }"
;;
esac
exit
fi
# query community server by h5ai API
filename=$(h5ai_query "$component")
currentVersion=$(version_from_filename "$filename")
echo $currentVersion