Skip to content

Commit

Permalink
Dynamic version tags
Browse files Browse the repository at this point in the history
  • Loading branch information
gizmocuz committed Feb 3, 2022
1 parent c42f485 commit f5e42ee
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ RUN set -ex \
VOLUME /opt/domoticz/userdata

EXPOSE 8080
EXPOSE 6144
EXPOSE 443

ENV LOG_PATH=
Expand Down
16 changes: 13 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,21 @@ then
echo "Error downloading version file!";
exit 1
fi
curl -ksL https://releases.domoticz.com/releases/beta/history_linux_x86_64.txt --output history.h
if [ $? -ne 0 ]
then
echo "Error downloading version file!";
exit 1
fi

declare $(cat version.h | awk '{print $2"="$3}')
RELEASE_DATE="$(date -d @$APPDATE -u +"%Y-%m-%dT%H:%M:%SZ")"
BETA_VERSION=2022
echo "Building release $BETA_VERSION.$APPVERSION from commit $APPHASH ($RELEASE_DATE)";

VERSION_TAG_RAW=$(cat history.h | head -1 | awk '{print $2}')
IFS='.' read -r -a array <<< "$VERSION_TAG_RAW"
VERSION_TAG="${array[0]}"

echo "Building release $VERSION_TAG.$APPVERSION from commit $APPHASH ($RELEASE_DATE)";

# Remove double quotes in APPHASH
APPHASH="${APPHASH%\"}"
Expand All @@ -25,4 +35,4 @@ docker buildx rm domoticz_build >/dev/null 2>&1 || true
docker buildx create --name domoticz_build
docker buildx use domoticz_build
docker buildx inspect --bootstrap
echo "docker buildx build --push --no-cache --platform ${BUILDX_PLATFORMS} --build-arg APP_VERSION=$APPVERSION --build-arg APP_HASH=$APPHASH --build-arg BUILD_DATE=$RELEASE_DATE --tag domoticz/domoticz:latest --tag domoticz/domoticz:beta --tag domoticz/domoticz:$BETA_VERSION-beta.$APPVERSION ."
echo "docker buildx build --push --no-cache --platform ${BUILDX_PLATFORMS} --build-arg APP_VERSION=$APPVERSION --build-arg APP_HASH=$APPHASH --build-arg BUILD_DATE=$RELEASE_DATE --tag domoticz/domoticz:latest --tag domoticz/domoticz:beta --tag domoticz/domoticz:$VERSION_TAG-beta.$APPVERSION ."
16 changes: 13 additions & 3 deletions buildstable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,21 @@ then
echo "Error downloading version file!";
exit 1
fi
curl -ksL https://releases.domoticz.com/releases/release/history_linux_x86_64.txt --output history.h
if [ $? -ne 0 ]
then
echo "Error downloading version file!";
exit 1
fi

declare $(cat version.h | awk '{print $2"="$3}')
RELEASE_DATE="$(date -d @$APPDATE -u +"%Y-%m-%dT%H:%M:%SZ")"
STABLE_VERSION=2022.1
echo "Building release $STABLE_VERSION.$APPVERSION from commit $APPHASH ($RELEASE_DATE)";

VERSION_TAG_RAW=$(cat history.h | head -1 | awk '{print $2}')
IFS='.' read -r -a array <<< "$VERSION_TAG_RAW"
VERSION_TAG="${array[0]}.${array[1]}"

echo "Building release $VERSION_TAG.$APPVERSION from commit $APPHASH ($RELEASE_DATE)";

# Remove double quotes in APPHASH
APPHASH="${APPHASH%\"}"
Expand All @@ -25,4 +35,4 @@ docker buildx rm domoticz_build >/dev/null 2>&1 || true
docker buildx create --name domoticz_build
docker buildx use domoticz_build
docker buildx inspect --bootstrap
echo "docker buildx build --push --no-cache --platform ${BUILDX_PLATFORMS} --build-arg APP_VERSION=$APPVERSION --build-arg APP_HASH=$APPHASH --build-arg BUILD_DATE=$RELEASE_DATE --build-arg STABLE=true --tag domoticz/domoticz:stable --tag domoticz/domoticz:$STABLE_VERSION ."
echo "docker buildx build --push --no-cache --platform ${BUILDX_PLATFORMS} --build-arg APP_VERSION=$APPVERSION --build-arg APP_HASH=$APPHASH --build-arg BUILD_DATE=$RELEASE_DATE --build-arg STABLE=true --tag domoticz/domoticz:stable --tag domoticz/domoticz:$VERSION_TAG ."

0 comments on commit f5e42ee

Please sign in to comment.