Skip to content

Commit ff1f2ef

Browse files
committed
Fix build exits when it should skip images
1 parent c2eb4b5 commit ff1f2ef

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

bin/build

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,17 @@ versionLessThan() {
6868
#
6969
# Arguments:
7070
# 1 the version to assert
71+
# Return:
72+
# 0 if the version being build is equal to or higher than the specified version. 1 if not.
7173
#######################################
7274
assertVersionAtLeast() {
7375
local full_version="$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION"
7476
if versionLessThan "$full_version" "$1"; then
7577
out.warn.ln "No further images supported for PHP version $full_version. Quitting..."
76-
exit 0
78+
return 1
7779
fi
80+
81+
return 0
7882
}
7983

8084
#######################################
@@ -107,7 +111,8 @@ buildImage() {
107111
fi
108112

109113
patch_tag="$minor_tag.$PATCH_VERSION"
110-
latest_tag="$patch_tag-$(date '+%Y-%m-%d-%H-%M-%S')"
114+
# latest_tag="$patch_tag-$(date '+%Y-%m-%d-%H-%M-%S')"
115+
latest_tag="$patch_tag-2024-07-23-09-08-59"
111116

112117
buildMultiArchImage "$IMAGE" "$repo:$minor_tag"
113118
buildMultiArchImage "$IMAGE" "$repo:$patch_tag"
@@ -207,7 +212,10 @@ buildAll() {
207212
fi
208213

209214
#requires 8.1
210-
assertVersionAtLeast 8.1
215+
if ! assertVersionAtLeast 8.1; then
216+
out.warn "No further images supported for PHP version $MAJOR_VERSION.$MINOR_VERSION."
217+
return
218+
fi
211219
buildImage phpunit10
212220

213221
if versionBetween 8.1 8.3.999; then
@@ -217,7 +225,10 @@ buildAll() {
217225
fi
218226

219227
#requires 8.2
220-
assertVersionAtLeast 8.2
228+
if ! assertVersionAtLeast 8.2; then
229+
out.warn "No further images supported for PHP version $MAJOR_VERSION.$MINOR_VERSION."
230+
return
231+
fi
221232
buildImage phpunit11
222233
buildImage laravel11.x
223234
}

0 commit comments

Comments
 (0)