Skip to content
Snippets Groups Projects
Unverified Commit 35fe2285 authored by Max Adamo's avatar Max Adamo
Browse files

remove builtin variable

parent 3fafd559
No related branches found
No related tags found
No related merge requests found
......@@ -7,8 +7,8 @@
# the certificate will be checked, if it is valid, if the key matches
# and if it contains at least the cert-name
#
VERSION="VERSION_SET_BY_CI"
BUILDTIME="BUILDTIME_SET_BY_CI"
PROG_VERSION="VERSION_SET_BY_CI"
BUILD_TIME="BUILDTIME_SET_BY_CI"
REDIS_URL="https://redis.geant.org/GET"
VAULT_URL="https://vault.geant.org/v1"
TMP_CERT=$(mktemp)
......@@ -44,9 +44,9 @@ check_version() {
SCRIPT_URL="https://artifactory.software.geant.org/artifactory/acme-downloader/acme-downloader.sh"
METADATA_URL="https://artifactory.software.geant.org/artifactory/api/storage/acme-downloader/acme-downloader.sh?properties=version"
REMOTE_VERSION=$(curl -s $METADATA_URL | jq -j .properties.version[0])
if [[ $VERSION != $REMOTE_VERSION ]]; then
if [[ $PROG_VERSION != $REMOTE_VERSION ]]; then
echo ""
echo "you are running version ${VERSION}"
echo "you are running version ${PROG_VERSION}"
echo "version $REMOTE_VERSION is available"
echo "in order to fetch and install the new version you can use the option: --update"
echo ""
......@@ -170,7 +170,7 @@ done
# print version buildtime and say goodbye
if [[ -n $PROG_VERSION ]]; then
echo "$(basename $0) version $VERSION built on ${BUILDTIME}"
echo "$(basename $0) version $PROG_VERSION built on ${BUILD_TIME}"
clean_up 0
fi
......
......@@ -3,9 +3,9 @@
# upload a copy of the script with version number and buildtime
#
if [ "$#" -gt 0 ]; then
VERSION=$1
PROG_VERSION=$1
else
VERSION=$(git describe --tags $(git rev-list --tags --max-count=1) | tr -d v)
PROG_VERSION=$(git describe --tags $(git rev-list --tags --max-count=1) | tr -d v)
fi
AFACTORY_SCRIPT="acme-downloader-afactory.sh"
BUILDTIME=$(date -u '+%Y-%m-%d_%H:%M:%S')
......@@ -17,5 +17,5 @@ fi
rm -f $AFACTORY_SCRIPT
cp acme-downloader.sh $AFACTORY_SCRIPT
sed -i s/VERSION_SET_BY_CI/$VERSION/ $AFACTORY_SCRIPT
sed -i s/VERSION_SET_BY_CI/$PROG_VERSION/ $AFACTORY_SCRIPT
sed -i s/BUILDTIME_SET_BY_CI/$BUILDTIME/ $AFACTORY_SCRIPT
......@@ -64,7 +64,7 @@ while true; do
;;
--version)
shift
VERSION="$1"
PROG_VERSION="$1"
;;
--)
shift
......@@ -74,8 +74,8 @@ while true; do
shift
done
if [[ -n $VERSION ]]; then
PROG_VERSION=$(echo $VERSION | tr -d v)
if [[ -n $PROG_VERSION ]]; then
PROG_VERSION=$(echo $PROG_VERSION | tr -d v)
else
PROG_VERSION=$(git describe --tags $(git rev-list --tags --max-count=1) | tr -d v)
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment