Skip to content

Commit

Permalink
Add openHAB 5 support
Browse files Browse the repository at this point in the history
* Use Java 21 with openHAB 5
* Remove linux/arm/v7 support
* Update versions in build help

Related to openhab/openhab-distro#1689

Signed-off-by: Wouter Born <[email protected]>
  • Loading branch information
wborn committed Dec 15, 2024
1 parent 2b10850 commit 447b4de
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@ The following Docker platforms are supported (automatically determined):

* `linux/amd64`
* `linux/arm64`
* `linux/arm/v7`

There is no `linux/arm/v7` Alpine image for openHAB 3 (or newer) because the required openjdk package is unavailable for this platform.
* `linux/arm/v7` (Debian openHAB 4 (or older), Alpine openHAB 2 (or older))

## Usage

Expand Down
14 changes: 7 additions & 7 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ resolve_version_tags() {
}

print_help() {
local snapshot_4x=$(grep -E '^4\.[0-9]+\.[0-9]+-snapshot$' <<< $VERSIONS | tail -n 1)
local snapshot_5x=$(grep -E '^5\.[0-9]+\.[0-9]+-snapshot$' <<< $VERSIONS | tail -n 1)
local milestone_4x=$(grep -E '^4\.[0-9]+\.[0-9]+.(M[0-9]+)$' <<< $VERSIONS | tail -n 1)
local stable_3x=$(grep -E '^3\.[0-9]+\.[0-9]+$' <<< $VERSIONS | tail -n 1)
local stable_40x=$(grep -E '^4\.0\.[0-9]+$' <<< $VERSIONS | tail -n 1)
local stable_42x=$(grep -E '^4\.2\.[0-9]+$' <<< $VERSIONS | tail -n 1)
local stable_43x=$(grep -E '^4\.3\.[0-9]+$' <<< $VERSIONS | tail -n 1)

cat <<-EOI
Usage: ./build [OPTIONS]
Expand All @@ -67,17 +67,17 @@ Log in to the Docker Registry with "docker login" before building and pushing th
Examples:
Build the Debian and Alpine $snapshot_4x images:
Build the Debian and Alpine $snapshot_5x images:
./build
Build the Debian $snapshot_4x images:
Build the Debian $snapshot_5x images:
./build debian
Build the Alpine $milestone_4x images:
./build $milestone_4x alpine
Build the $stable_40x and $stable_3x Debian/Alpine images and push them to $(docker_repo):
./build $stable_40x $stable_3x --push
Build the $stable_43x and $stable_42x Debian/Alpine images and push them to $(docker_repo):
./build $stable_43x $stable_42x --push
Build the latest/snapshot Debian images by resolving the versions ("milestone" can also be resolved):
./build latest snapshot debian
Expand Down
13 changes: 7 additions & 6 deletions helper-functions
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ platforms() {
local version="$1"
local base="$2"

if [ "$base" == "alpine" ]; then
# There is no linux/arm/v7 Alpine image for openHAB 3 (or newer) because the required openjdk package is unavailable for this architecture
echo "linux/amd64,linux/arm64"
else
if [[ "$version" =~ ^4.*$ ]] && [ "$base" == "debian" ]; then
echo "linux/amd64,linux/arm64,linux/arm/v7"
else
# There are no linux/arm/v7 images for openHAB 5 (or newer) because this platform is no longer supported.
# There are no linux/arm/v7 Alpine images for openHAB 3 (or newer) because the required openjdk package is unavailable for this platform.
echo "linux/amd64,linux/arm64"
fi
}

Expand Down Expand Up @@ -219,8 +220,8 @@ build() {

local java_version=""
case $openhab_version in
3.*) java_version="11";;
*) java_version="17";;
4.*) java_version="17";;
*) java_version="21";;
esac

local build_arg_options="--build-arg BUILD_DATE=$(date +"%Y-%m-%dT%H:%M:%SZ") --build-arg VCS_REF=$(git rev-parse HEAD) --build-arg JAVA_VERSION=$java_version --build-arg OPENHAB_VERSION=$openhab_version"
Expand Down

0 comments on commit 447b4de

Please sign in to comment.