Skip to content

Commit

Permalink
🤖 Fetch AirConnect on build time, let Renovate handle upgrades (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck authored Jan 6, 2024
1 parent 855bf49 commit 6a7f4b4
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
"(aarch64|amd64|armhf|armv7|i386):\\s[\"']?(?<depName>.*?):(?<currentValue>.*?)[\"']?\\s"
],
"datasourceTemplate": "docker"
},
{
"fileMatch": ["/Dockerfile$"],
"matchStrings": [
"ARG AIRCONNECT_VERSION=[\"']?(?<currentValue>.+?)[\"']?\\s+"
],
"datasourceTemplate": "github-releases",
"depNameTemplate": "philippe44/AirConnect"
}
],
"packageRules": [
Expand Down
26 changes: 24 additions & 2 deletions airsonos/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,31 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Copy root filesystem
COPY rootfs /

# Add airsonos binary
# Setup base
ARG BUILD_ARCH=amd64
COPY bin/airsonos-${BUILD_ARCH} /usr/bin/airsonos
ARG AIRCONNECT_VERSION="1.2.0"
RUN \
apt-get update \
&& apt-get install -y --no-install-recommends \
unzip=6.0-28 \
\
&& curl -J -L -o /tmp/airconnect.zip \
"https://github.com/philippe44/AirConnect/releases/download/${AIRCONNECT_VERSION}/AirConnect-${AIRCONNECT_VERSION}.zip" \
&& unzip -d /tmp /tmp/airconnect.zip \
\
&& if [ "${BUILD_ARCH}" = "aarch64" ]; then AIRCONNECT_ARCH="aarch64"; \
elif [ "${BUILD_ARCH}" = "amd64" ]; then AIRCONNECT_ARCH="x86_64"; \
elif [ "${BUILD_ARCH}" = "armv7" ]; then AIRCONNECT_ARCH="arm"; fi \
\
&& cp "/tmp/airupnp-linux-${AIRCONNECT_ARCH}-static" /usr/bin/airsonos \
&& chmod a+x /usr/bin/airsonos \
\
&& apt-get purge -y --auto-remove \
unzip \
&& rm -fr \
/tmp/* \
/var/{cache,log}/* \
/var/lib/apt/lists/*

# Build arguments
ARG BUILD_ARCH
Expand Down
Binary file removed airsonos/bin/airsonos-aarch64
Binary file not shown.
Binary file removed airsonos/bin/airsonos-amd64
Binary file not shown.
Binary file removed airsonos/bin/airsonos-armv7
Binary file not shown.

0 comments on commit 6a7f4b4

Please sign in to comment.