Skip to content

Commit dc003fe

Browse files
committed
compatibility with upstream build pipeline changes
1 parent 09c6d30 commit dc003fe

File tree

2 files changed

+26
-20
lines changed

2 files changed

+26
-20
lines changed

Dockerfile

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,20 +91,23 @@ RUN \
9191
HASS_RELEASE=$(curl -sX GET https://api.github.com/repos/home-assistant/core/releases/latest \
9292
| jq -r .tag_name); \
9393
fi && \
94+
echo "HASS_RELEASE retrieved as ${HASS_RELEASE}" && \
9495
curl -o \
9596
/tmp/core.tar.gz -L \
9697
"https://github.com/home-assistant/core/archive/${HASS_RELEASE}.tar.gz" && \
9798
tar xf \
9899
/tmp/core.tar.gz -C \
99100
/tmp/core --strip-components=1 && \
100-
HASS_BASE=$(cat /tmp/core/build.yaml \
101-
| grep 'amd64: ' \
102-
| cut -d: -f3) && \
101+
HASS_BASE=$(cat /tmp/core/.github/workflows/builder.yml \
102+
| grep 'BASE_IMAGE_VERSION: ' \
103+
| sed 's|.*: "||' | sed 's|".*||') && \
104+
echo "HASS_BASE retrieved as ${HASS_BASE}" && \
103105
HA_PY_MAJOR=$(curl -fsL https://raw.githubusercontent.com/home-assistant/docker/${HASS_BASE}/build.yaml \
104106
| grep 'amd64: ' \
105107
| cut -d: -f3 \
106108
| sed 's|-alpine.*||') && \
107-
HASS_BASE_RELEASE=$(curl -sL https://api.github.com/repos/home-assistant/docker/releases) && \
109+
echo "HA_PY_MAJOR retrieved as ${HA_PY_MAJOR}" && \
110+
HASS_BASE_RELEASE=$(curl -fSsL https://api.github.com/repos/home-assistant/docker/releases) && \
108111
HASS_BASE_TIME=$(date -d $(echo $HASS_BASE_RELEASE | \
109112
jq -r ".[] | select(.tag_name | match(\"${HASS_BASE}\")) .published_at") +%s) && \
110113
for i in 0 1 2 3 4 5 6; do \
@@ -130,7 +133,8 @@ RUN \
130133
HA_ALPINE_VER=$(curl -fsL https://raw.githubusercontent.com/home-assistant/docker/${HASS_BASE}/build.yaml \
131134
| grep 'amd64: ' \
132135
| cut -d: -f3 \
133-
| sed 's|.*-alpine||') && \
136+
| sed 's|.*-alpine||' \
137+
| sed 's|-.*||') && \
134138
IMAGE_ALPINE_VER=$(cat /etc/os-release | grep PRETTY_NAME | sed 's|.*Linux v||' | sed 's|"||') && \
135139
if [[ "${HA_ALPINE_VER}" != "${IMAGE_ALPINE_VER}" ]]; then \
136140
echo -e "**** Incorrect OS version detected, canceling build ****\n**** Upstream expected OS: ${HA_ALPINE_VER} ****\n**** Detected OS: ${IMAGE_ALPINE_VER}****"; \
@@ -140,11 +144,11 @@ RUN \
140144
| grep 'PIP_VERSION: ' \
141145
| sed 's|.*PIP_VERSION: ||' \
142146
| sed 's|"||g') && \
143-
HA_UV_VERSION=$(curl -fsL "https://raw.githubusercontent.com/home-assistant/core/refs/tags/${HASS_RELEASE}/Dockerfile" | grep 'install uv==' | sed 's|RUN pip3 install uv==||') && \
144-
HA_GO2RTC_VERSION=$(curl -fsL "https://raw.githubusercontent.com/home-assistant/core/refs/tags/${HASS_RELEASE}/Dockerfile" | grep 'AlexxIT/go2rtc/releases/download' | sed -r 's|^.*AlexxIT/go2rtc/releases/download/(.*)/go2rtc_linux.*$|\1|') && \
147+
HA_UV_VERSION=$(curl -fsL "https://raw.githubusercontent.com/home-assistant/core/refs/tags/${HASS_RELEASE}/Dockerfile" | grep 'install uv==' | sed 's|.*install uv==||') && \
148+
HA_GO2RTC_VERSION=$(curl -fsL "https://raw.githubusercontent.com/home-assistant/core/refs/tags/${HASS_RELEASE}/homeassistant/components/go2rtc/const.py" | grep 'RECOMMENDED_VERSION' | sed 's|.*RECOMMENDED_VERSION = "||' | sed 's|".*||') && \
145149
curl -o \
146150
/bin/go2rtc -fL \
147-
"https://github.com/AlexxIT/go2rtc/releases/download/${HA_GO2RTC_VERSION}/go2rtc_linux_amd64" && \
151+
"https://github.com/AlexxIT/go2rtc/releases/download/v${HA_GO2RTC_VERSION}/go2rtc_linux_amd64" && \
148152
chmod +x /bin/go2rtc && \
149153
echo "**** Quick test go2rtc binary: ****" && \
150154
/bin/go2rtc --version && \
@@ -232,11 +236,10 @@ RUN \
232236
-r https://raw.githubusercontent.com/home-assistant/docker/${HASS_BASE}/requirements.txt && \
233237
uv pip install --no-build \
234238
-r requirements.txt && \
235-
PYCUPS_VER=$(grep "pycups" requirements_all.txt | sed 's|.*==||') && \
236239
uv pip install --no-build \
237240
-r requirements_all.txt \
238241
isal \
239-
pycups==${PYCUPS_VER} && \
242+
pycups && \
240243
uv pip install \
241244
homeassistant==${HASS_RELEASE} && \
242245
for cleanfiles in *.pyc *.pyo; do \

Dockerfile.aarch64

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,20 +91,23 @@ RUN \
9191
HASS_RELEASE=$(curl -sX GET https://api.github.com/repos/home-assistant/core/releases/latest \
9292
| jq -r .tag_name); \
9393
fi && \
94+
echo "HASS_RELEASE retrieved as ${HASS_RELEASE}" && \
9495
curl -o \
9596
/tmp/core.tar.gz -L \
9697
"https://github.com/home-assistant/core/archive/${HASS_RELEASE}.tar.gz" && \
9798
tar xf \
9899
/tmp/core.tar.gz -C \
99100
/tmp/core --strip-components=1 && \
100-
HASS_BASE=$(cat /tmp/core/build.yaml \
101-
| grep 'amd64: ' \
102-
| cut -d: -f3) && \
101+
HASS_BASE=$(cat /tmp/core/.github/workflows/builder.yml \
102+
| grep 'BASE_IMAGE_VERSION: ' \
103+
| sed 's|.*: "||' | sed 's|".*||') && \
104+
echo "HASS_BASE retrieved as ${HASS_BASE}" && \
103105
HA_PY_MAJOR=$(curl -fsL https://raw.githubusercontent.com/home-assistant/docker/${HASS_BASE}/build.yaml \
104106
| grep 'amd64: ' \
105107
| cut -d: -f3 \
106108
| sed 's|-alpine.*||') && \
107-
HASS_BASE_RELEASE=$(curl -sL https://api.github.com/repos/home-assistant/docker/releases) && \
109+
echo "HA_PY_MAJOR retrieved as ${HA_PY_MAJOR}" && \
110+
HASS_BASE_RELEASE=$(curl -fSsL https://api.github.com/repos/home-assistant/docker/releases) && \
108111
HASS_BASE_TIME=$(date -d $(echo $HASS_BASE_RELEASE | \
109112
jq -r ".[] | select(.tag_name | match(\"${HASS_BASE}\")) .published_at") +%s) && \
110113
for i in 0 1 2 3 4 5 6; do \
@@ -130,7 +133,8 @@ RUN \
130133
HA_ALPINE_VER=$(curl -fsL https://raw.githubusercontent.com/home-assistant/docker/${HASS_BASE}/build.yaml \
131134
| grep 'amd64: ' \
132135
| cut -d: -f3 \
133-
| sed 's|.*-alpine||') && \
136+
| sed 's|.*-alpine||' \
137+
| sed 's|-.*||') && \
134138
IMAGE_ALPINE_VER=$(cat /etc/os-release | grep PRETTY_NAME | sed 's|.*Linux v||' | sed 's|"||') && \
135139
if [[ "${HA_ALPINE_VER}" != "${IMAGE_ALPINE_VER}" ]]; then \
136140
echo -e "**** Incorrect OS version detected, canceling build ****\n**** Upstream expected OS: ${HA_ALPINE_VER} ****\n**** Detected OS: ${IMAGE_ALPINE_VER}****"; \
@@ -140,11 +144,11 @@ RUN \
140144
| grep 'PIP_VERSION: ' \
141145
| sed 's|.*PIP_VERSION: ||' \
142146
| sed 's|"||g') && \
143-
HA_UV_VERSION=$(curl -fsL "https://raw.githubusercontent.com/home-assistant/core/refs/tags/${HASS_RELEASE}/Dockerfile" | grep 'install uv==' | sed 's|RUN pip3 install uv==||') && \
144-
HA_GO2RTC_VERSION=$(curl -fsL "https://raw.githubusercontent.com/home-assistant/core/refs/tags/${HASS_RELEASE}/Dockerfile" | grep 'AlexxIT/go2rtc/releases/download' | sed -r 's|^.*AlexxIT/go2rtc/releases/download/(.*)/go2rtc_linux.*$|\1|') && \
147+
HA_UV_VERSION=$(curl -fsL "https://raw.githubusercontent.com/home-assistant/core/refs/tags/${HASS_RELEASE}/Dockerfile" | grep 'install uv==' | sed 's|.*install uv==||') && \
148+
HA_GO2RTC_VERSION=$(curl -fsL "https://raw.githubusercontent.com/home-assistant/core/refs/tags/${HASS_RELEASE}/homeassistant/components/go2rtc/const.py" | grep 'RECOMMENDED_VERSION' | sed 's|.*RECOMMENDED_VERSION = "||' | sed 's|".*||') && \
145149
curl -o \
146150
/bin/go2rtc -fL \
147-
"https://github.com/AlexxIT/go2rtc/releases/download/${HA_GO2RTC_VERSION}/go2rtc_linux_arm64" && \
151+
"https://github.com/AlexxIT/go2rtc/releases/download/v${HA_GO2RTC_VERSION}/go2rtc_linux_arm64" && \
148152
chmod +x /bin/go2rtc && \
149153
echo "**** Quick test go2rtc binary: ****" && \
150154
/bin/go2rtc --version && \
@@ -232,11 +236,10 @@ RUN \
232236
-r https://raw.githubusercontent.com/home-assistant/docker/${HASS_BASE}/requirements.txt && \
233237
uv pip install --no-build \
234238
-r requirements.txt && \
235-
PYCUPS_VER=$(grep "pycups" requirements_all.txt | sed 's|.*==||') && \
236239
uv pip install --no-build \
237240
-r requirements_all.txt \
238241
isal \
239-
pycups==${PYCUPS_VER} && \
242+
pycups && \
240243
uv pip install \
241244
homeassistant==${HASS_RELEASE} && \
242245
for cleanfiles in *.pyc *.pyo; do \

0 commit comments

Comments
 (0)