@@ -20,12 +20,29 @@ DEFAULT_VERSION = dev-local
2020# make all VERSION=2026-03
2121VERSION ?= $(DEFAULT_VERSION )
2222
23+ # Stable release targets derive the container tag from RSYSLOG_VERSION using
24+ # 8.yymm.0 -> 20yy-mm. Example: 8.2602.0 -> 2026-02.
25+ RELEASE_CHANNEL ?= stable
26+ RELEASE_VERSION = $(strip $(shell \
27+ if [ "$(RELEASE_CHANNEL ) " = "daily-stable" ]; then \
28+ printf 'daily-stable\n'; \
29+ elif printf '% s\n' "$(RSYSLOG_VERSION ) " | grep -Eq '^8\.[0-9]{4}\.0$$'; then \
30+ printf '% s\n' "$(RSYSLOG_VERSION ) " | sed -E 's/^8\.([0-9]{2}) ([0-9]{2}) \.0$$/20\1-\2/'; \
31+ fi))
32+
2333# Default OCI metadata values for local builds.
2434BUILD_DATE ?= $(shell date -u +% Y-% m-% dT% H:% M:% SZ)
2535VCS_REF ?= $(shell git rev-parse --short=12 HEAD 2>/dev/null || echo unknown)
2636OCI_BUILD_ARGS = --build-arg BUILD_DATE="$(BUILD_DATE ) " \
2737 --build-arg VCS_REF="$(VCS_REF ) "
2838
39+ # Manual release publishing is downstream of PPA readiness. Operators must
40+ # provide the expected rsyslog release version explicitly before stable
41+ # release-tagged images are built or pushed. The readiness check keeps to
42+ # the minimum: confirm that the selected release channel exposes the
43+ # requested series.
44+ RELEASE_UBUNTU_VERSION ?= 24.04
45+
2946# Variable to control cache busting. Set to 'yes' to force a rebuild from scratch for all targets.
3047# Example: make all REBUILD=yes
3148REBUILD ?= no
@@ -63,7 +80,8 @@ ETL_IMAGE_TAG = $(strip $(ETL_IMAGE_NAME):$(VERSION))
6380 minimal standard collector dockerlogs etl \
6481 build_minimal_image build_standard_image build_collector_image build_dockerlogs_image build_etl_image \
6582 push_minimal push_standard push_collector push_dockerlogs push_etl \
66- rebuild_all check_publish_version
83+ rebuild_all check_publish_version check_release_inputs \
84+ check_ppa_release_ready release_build release_push release_publish
6785
6886# Default target: Builds all functional images.
6987# Assumed layering: minimal -> standard -> (collector, dockerlogs, etl)
@@ -169,6 +187,77 @@ check_publish_version:
169187 echo " Using publishable VERSION=$( VERSION) " ;; \
170188 esac
171189
190+ check_release_inputs :
191+ @if [ " $( RELEASE_CHANNEL) " = " stable" ] && [ -z " $( RSYSLOG_VERSION) " ]; then \
192+ echo " ERROR: stable release targets require RSYSLOG_VERSION." >&2 ; \
193+ echo " Example: make release_build RSYSLOG_VERSION=8.2602.0" >&2 ; \
194+ exit 1; \
195+ fi
196+ @if [ -z " $( RELEASE_VERSION) " ]; then \
197+ echo " ERROR: invalid release input for RELEASE_CHANNEL=$( RELEASE_CHANNEL) ." >&2 ; \
198+ echo " Stable example: make release_build RSYSLOG_VERSION=8.2602.0" >&2 ; \
199+ echo " Daily example: make release_build RELEASE_CHANNEL=daily-stable" >&2 ; \
200+ exit 1; \
201+ fi
202+ @if [ " $( VERSION) " != " $( DEFAULT_VERSION) " ] && [ " $( VERSION) " != " $( RELEASE_VERSION) " ]; then \
203+ echo " ERROR: VERSION=$( VERSION) does not match derived release tag $( RELEASE_VERSION) ." >&2 ; \
204+ echo " Omit VERSION for release targets or set VERSION=$( RELEASE_VERSION) ." >&2 ; \
205+ exit 1; \
206+ fi
207+ @echo " Using release channel $( RELEASE_CHANNEL) "
208+ @if [ -n " $( RSYSLOG_VERSION) " ]; then echo " Using rsyslog release version $( RSYSLOG_VERSION) " ; fi
209+ @echo " Derived container tag $( RELEASE_VERSION) "
210+
211+ check_ppa_release_ready : check_release_inputs
212+ @echo " --- Checking Adiscon PPA readiness for VERSION=$( RELEASE_VERSION) ---"
213+ @docker run --rm ubuntu:$(RELEASE_UBUNTU_VERSION ) bash -lc " \
214+ set -e; \
215+ export DEBIAN_FRONTEND=noninteractive; \
216+ apt-get update > /dev/null; \
217+ apt-get install -y --no-install-recommends ca-certificates software-properties-common > /dev/null; \
218+ if [ \" $( RELEASE_CHANNEL) \" = \" daily-stable\" ]; then \
219+ release_ppa=\" ppa:adiscon/daily-stable\" ; \
220+ else \
221+ release_ppa=\" ppa:adiscon/v8-stable\" ; \
222+ fi ; \
223+ add-apt-repository -y \"\$ $release_ppa \" > /dev/null; \
224+ apt-get update > /dev/null; \
225+ if [ \" $( RELEASE_CHANNEL) \" = \" daily-stable\" ]; then \
226+ resolved_version=\"\$ $(apt-cache madison rsyslog | awk 'NR==1 { print \$$3; exit }' ) \" ; \
227+ else \
228+ resolved_version=\"\$ $(apt-cache madison rsyslog | awk '\$$3 ~ /^$(RSYSLOG_VERSION ) -/ { print \$$3; exit }' ) \" ; \
229+ fi ; \
230+ if [ -z \"\$ $resolved_version \" ]; then \
231+ if [ \" $( RELEASE_CHANNEL) \" = \" daily-stable\" ]; then \
232+ echo \" ERROR: no rsyslog package is available in \$ $release_ppa .\" >&2 ; \
233+ else \
234+ echo \" ERROR: no rsyslog package matching $(RSYSLOG_VERSION ) -* is available in \$ $release_ppa .\" >&2 ; \
235+ fi ; \
236+ exit 1; \
237+ fi ; \
238+ echo \" Resolved PPA package version \$ $resolved_version from \$ $release_ppa .\" "
239+ @if [ " $( RELEASE_CHANNEL) " = " daily-stable" ]; then \
240+ echo " PPA is ready for daily-stable" ; \
241+ else \
242+ echo " PPA is ready for rsyslog $( RSYSLOG_VERSION) " ; \
243+ fi
244+
245+ release_build : check_ppa_release_ready
246+ @echo " --- Manual release build for VERSION=$( RELEASE_VERSION) ---"
247+ $(MAKE ) all VERSION=$(RELEASE_VERSION )
248+
249+ release_push : check_ppa_release_ready
250+ @echo " --- Manual release push for VERSION=$( RELEASE_VERSION) ---"
251+ $(MAKE ) all_push VERSION=$(RELEASE_VERSION )
252+
253+ release_publish : release_push
254+ @if [ " $( PUSH_LATEST) " = " yes" ]; then \
255+ echo " --- Updating latest tags for VERSION=$( RELEASE_VERSION) ---" ; \
256+ $(MAKE ) push_latest VERSION=$(RELEASE_VERSION ) ; \
257+ else \
258+ echo " Skipping latest tag update. Set PUSH_LATEST=yes to publish latest." ; \
259+ fi
260+
172261# --- Push Targets ---
173262push_minimal : check_publish_version build_minimal_image
174263 @echo " --- Pushing minimal image: $( MINIMAL_IMAGE_TAG) ---"
@@ -242,6 +331,10 @@ help:
242331 @echo " all_push - Builds and pushes all versioned images."
243332 @echo " tag_latest - Tags all built images with ':latest' in their respective repositories."
244333 @echo " push_latest - Pushes all ':latest' tagged images."
334+ @echo " release_build - Validates PPA readiness, then builds a release-tagged image set."
335+ @echo " release_push - Validates PPA readiness, then pushes release-tagged images."
336+ @echo " release_publish - Runs release_push and optionally updates ':latest'."
337+ @echo " Use PUSH_LATEST=yes to move latest."
245338 @echo " "
246339 @echo " Utility Targets:"
247340 @echo " clean - Removes all local built and ':latest' images."
@@ -252,12 +345,21 @@ help:
252345 @echo " Current default: $( VERSION) "
253346 @echo " The default is intentionally non-release for local builds."
254347 @echo " Publish/tag targets reject development-like values."
348+ @echo " RSYSLOG_VERSION - Expected rsyslog release version, for example 8.2602.0."
349+ @echo " Required for RELEASE_CHANNEL=stable."
350+ @echo " RELEASE_CHANNEL - Release source. Defaults to stable."
351+ @echo " stable -> ppa:adiscon/v8-stable and 8.yymm.0 -> 20yy-mm"
352+ @echo " daily-stable -> ppa:adiscon/daily-stable and tag daily-stable"
353+ @echo " PUSH_LATEST - Set to 'yes' to let release_publish update ':latest'."
354+ @echo " RELEASE_UBUNTU_VERSION - Ubuntu base used for the PPA readiness check."
255355 @echo " REBUILD - Set to 'yes' to force a full rebuild, bypassing Docker build cache."
256356 @echo " Example: make all REBUILD=yes"
257357 @echo " "
258358 @echo " Example Workflow:"
259359 @echo " 1. Local smoke build: make all"
260360 @echo " 2. Local release rehearsal: make VERSION=2026-03 all"
261361 @echo " 3. Force a full rebuild of all images: make rebuild_all"
262- @echo " 4. Push all release-tagged images: make VERSION=2026-03 all_push"
263- @echo " 5. Tag and push latest for a release build: make VERSION=2026-03 push_latest"
362+ @echo " 4. Check PPA readiness: make check_ppa_release_ready RSYSLOG_VERSION=8.2602.0"
363+ @echo " 5. Manual release push: make release_push RSYSLOG_VERSION=8.2602.0"
364+ @echo " 6. Release push plus latest: make release_publish RSYSLOG_VERSION=8.2602.0 PUSH_LATEST=yes"
365+ @echo " 7. Daily channel build: make release_build RELEASE_CHANNEL=daily-stable"
0 commit comments