Skip to content

Commit 1be5e98

Browse files
committed
Use UPSTREAM_URL and UPSTREAM_SED ARGs for version checking
1 parent b5c0cc7 commit 1be5e98

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

Containerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ FROM ghcr.io/daemonless/arr-base:${BASE_VERSION}
33

44
ARG FREEBSD_ARCH=amd64
55
ARG PACKAGES="sonarr"
6+
ARG UPSTREAM_URL="https://services.sonarr.tv/v1/releases"
7+
ARG UPSTREAM_SED="s/.*\"v4-stable\":{[^}]*\"version\":\"\\([^\"]*\\)\".*/\\1/p"
68

79
LABEL org.opencontainers.image.title="Sonarr" \
810
org.opencontainers.image.description="Sonarr TV show management on FreeBSD" \
@@ -17,8 +19,8 @@ LABEL org.opencontainers.image.title="Sonarr" \
1719
io.daemonless.volumes="/tv,/downloads" \
1820
org.freebsd.jail.allow.mlock="required" \
1921
io.daemonless.category="Media Management" \
20-
io.daemonless.upstream-mode="sonarr" \
21-
io.daemonless.upstream-url="https://services.sonarr.tv/v1/releases" \
22+
io.daemonless.upstream-url="${UPSTREAM_URL}" \
23+
io.daemonless.upstream-sed="${UPSTREAM_SED}" \
2224
io.daemonless.packages="${PACKAGES}"
2325

2426
# Install Sonarr from FreeBSD packages
@@ -29,8 +31,8 @@ RUN pkg update && \
2931

3032
# Download and install Sonarr (fetch latest v4-stable FreeBSD URL from API)
3133
RUN mkdir -p /usr/local/share/sonarr /config && \
32-
SONARR_VERSION=$(fetch -qo - "https://services.sonarr.tv/v1/releases" | \
33-
grep -o '"version":"[^"]*"' | head -n 1 | cut -d '"' -f 4) && \
34+
SONARR_VERSION=$(fetch -qo - "${UPSTREAM_URL}" | \
35+
sed -n "${UPSTREAM_SED}" | head -1) && \
3436
SONARR_URL=$(fetch -qo - "https://services.sonarr.tv/v1/releases" | \
3537
grep -o '"freeBsd":{"x64":{"archive":{"url":"[^"]*"' | \
3638
sed -n '1s/.*"url":"\([^"]*\)".*/\1/p') && \

0 commit comments

Comments
 (0)