Skip to content

Commit f0bef9e

Browse files
pvizelifrenck
andauthored
Migrate to S6-Overlay (#98)
* Migrate to S6-Overlay * Migrate builder generic * Update base/rootfs/etc/cont-init.d/udev.sh Co-Authored-By: Franck Nijhof <[email protected]> * Update landingpage/rootfs/etc/services.d/nginx/run Co-Authored-By: Franck Nijhof <[email protected]> * Fix validate Co-authored-by: Franck Nijhof <[email protected]>
1 parent 0bb057b commit f0bef9e

File tree

19 files changed

+51
-38
lines changed

19 files changed

+51
-38
lines changed

azure-pipelines.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ pr:
1414
- master
1515

1616
variables:
17-
- name: basePythonTag
18-
value: '3.7-alpine3.10'
1917
- name: versionHadolint
2018
value: 'v1.17.2'
2119
- name: versionShellCheck
2220
value: 'v0.7.0'
2321
- name: versionBuilder
24-
value: '6.9'
22+
value: '7.1'
2523
- group: docker
2624

2725
jobs:
@@ -54,7 +52,7 @@ jobs:
5452
- script: |
5553
shopt -s globstar
5654
sudo docker run --rm -i \
57-
-v $(pwd):/mnt:ro koalaman/shellcheck:$(versionShellCheck) **/*.sh
55+
-v $(pwd):/mnt:ro koalaman/shellcheck:$(versionShellCheck) -s bash **/{*.sh,run,finish}
5856
displayName: 'Run ShellCheck'
5957
6058
@@ -89,6 +87,5 @@ jobs:
8987
-v ~/.docker:/root/.docker \
9088
-v /run/docker.sock:/run/docker.sock:rw -v $(pwd):/data:ro \
9189
homeassistant/amd64-builder:$(versionBuilder) \
92-
--homeassistant-base $(Build.SourceBranchName)=$(basePythonTag) \
93-
"--$(buildArch)" -t /data/base --docker-hub homeassistant
90+
--generic $(Build.SourceBranchName) "--$(buildArch)" -t /data/base
9491
displayName: 'Build Home Assistant Base'

base/Dockerfile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ RUN apk add --no-cache \
5454
unixodbc \
5555
zlib
5656

57-
###
58-
# Create /etc/odbcinst.ini for FreeTDS ODBC driver
59-
COPY odbcinst.ini /etc/
60-
6157
####
6258
## Install pip module for component/homeassistant
6359
COPY requirements.txt /usr/src/
@@ -125,7 +121,5 @@ RUN apk add --no-cache \
125121
&& rm -rf /usr/src/telldus
126122

127123
###
128-
# Setup entry point for udevd
129-
COPY entry.sh /bin/
130-
131-
ENTRYPOINT ["/bin/entry.sh"]
124+
# Base S6-Overlay
125+
COPY rootfs /

base/build.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"image": "homeassistant/{arch}-homeassistant-base",
3+
"build_from": {
4+
"aarch64": "homeassistant/aarch64-base-python:3.7-alpine3.10",
5+
"armhf": "homeassistant/armhf-base-python:3.7-alpine3.10",
6+
"armv7": "homeassistant/armv7-base-python:3.7-alpine3.10",
7+
"amd64": "homeassistant/amd64-base-python:3.7-alpine3.10",
8+
"i386": "homeassistant/i386-base-python:3.7-alpine3.10"
9+
},
10+
"labels": {
11+
"io.hass.type": "homeassistant-base"
12+
}
13+
}

base/entry.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

base/rootfs/etc/cont-init.d/udev.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/with-contenv bashio
2+
# ==============================================================================
3+
# Start udev service
4+
# ==============================================================================
5+
udevd --daemon
6+
7+
bashio::log.info "Update udev information"
8+
udevadm trigger
9+
udevadm settle
File renamed without changes.

generic/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ RUN pip3 install --no-cache-dir --no-index --only-binary=:all: --find-links "${W
1111
-e ./homeassistant \
1212
&& python3 -m compileall homeassistant/homeassistant
1313

14-
# Run Home Assistant
14+
# Home Assistant S6-Overlay
15+
COPY rootfs /
16+
1517
WORKDIR /config
16-
CMD [ "python3", "-m", "homeassistant", "--config", "/config" ]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/execlineb -S0
2+
# ==============================================================================
3+
# Take down the S6 supervision tree when Home Assistant fails
4+
# ==============================================================================
5+
s6-svscanctl -t /var/run/s6/services
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/with-contenv bashio
2+
# ==============================================================================
3+
# Start Home Assistant service
4+
# ==============================================================================
5+
exec python3 -m homeassistant --config /config

landingpage/Dockerfile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,4 @@ FROM $BUILD_FROM
55
RUN apk --no-cache add nginx
66

77
# Copy data
8-
COPY www/ /usr/share/www/
9-
COPY data/nginx.conf /etc/nginx/
10-
COPY data/run.sh /
11-
12-
CMD ["/run.sh"]
8+
COPY rootfs /

landingpage/data/run.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.
File renamed without changes.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/execlineb -S0
2+
# ==============================================================================
3+
# Take down the S6 supervision tree when Nginx fails
4+
# ==============================================================================
5+
s6-svscanctl -t /var/run/s6/services
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/with-contenv bashio
2+
# ==============================================================================
3+
# Start Nginx service
4+
# ==============================================================================
5+
exec nginx
File renamed without changes.

0 commit comments

Comments
 (0)