Compare commits

..

3 Commits

Author SHA1 Message Date
Gautham Varma K 712841f292 🔨 Migrate old-style base scripts s6-rc 2023-02-19 21:05:33 +05:30
Gautham Varma K 5514b1bb3d 🚧 Fix Deploy Script 2023-02-19 14:15:42 +05:30
Gautham Varma K 9d9f43814d Fix typo in deploy file 2023-02-19 14:04:59 +05:30
23 changed files with 71 additions and 25 deletions
+7 -7
View File
@@ -87,7 +87,7 @@ jobs:
run: | run: |
echo "date=$(date +"%Y-%m-%dT%H:%M:%SZ")" >> "$GITHUB_OUTPUT" echo "date=$(date +"%Y-%m-%dT%H:%M:%SZ")" >> "$GITHUB_OUTPUT"
from=$(yq --no-colors eval ".build_from.${{ matrix.architecture }}" "${{ needs.information.outputs.build }}") from=$(yq --no-colors eval ".build_from.${{ matrix.architecture }}" "${{ needs.information.outputs.build }}")
echo "from=${from}" >> "$GITHUB_OUTPUT" echo "from=${from}" >> "$GITHUB_OUTPUT"
if [[ "${{ matrix.architecture}}" = "amd64" ]]; then if [[ "${{ matrix.architecture}}" = "amd64" ]]; then
echo "platform=linux/amd64" >> "$GITHUB_OUTPUT" echo "platform=linux/amd64" >> "$GITHUB_OUTPUT"
@@ -117,14 +117,14 @@ jobs:
load: true load: true
# yamllint disable rule:line-length # yamllint disable rule:line-length
tags: | tags: |
ghcr.io/${{ github.repository_owner }}/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.environment }} ghcr.io/gauthamvarmak/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.environment }}
ghcr.io/${{ github.repository_owner }}/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.version }} ghcr.io/gauthamvarmak/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.version }}
# yamllint enable rule:line-length # yamllint enable rule:line-length
context: ${{ needs.information.outputs.target }} context: ${{ needs.information.outputs.target }}
file: ${{ needs.information.outputs.target }}/Dockerfile file: ${{ needs.information.outputs.target }}/Dockerfile
cache-from: | cache-from: |
type=local,src=/tmp/.docker-cache type=local,src=/tmp/.docker-cache
ghcr.io/${{ github.repository_owner }}/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:edge ghcr.io/gauthamvarmak/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:edge
cache-to: type=local,mode=max,dest=/tmp/.docker-cache-new cache-to: type=local,mode=max,dest=/tmp/.docker-cache-new
platforms: ${{ steps.flags.outputs.platform }} platforms: ${{ steps.flags.outputs.platform }}
build-args: | build-args: |
@@ -148,9 +148,9 @@ jobs:
# yamllint disable rule:line-length # yamllint disable rule:line-length
run: | run: |
docker push \ docker push \
"ghcr.io/${{ github.repository_owner }}/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.environment }}" "ghcr.io/gauthamvarmak/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.environment }}"
docker push \ docker push \
"ghcr.io/${{ github.repository_owner }}/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.version }}" "ghcr.io/gauthamvarmak/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.version }}"
publish-stable: publish-stable:
name: 📢 Publish to stable repository name: 📢 Publish to stable repository
@@ -166,7 +166,7 @@ jobs:
uses: peter-evans/repository-dispatch@v2.1.1 uses: peter-evans/repository-dispatch@v2.1.1
with: with:
token: ${{ secrets.DISPATCH_TOKEN }} token: ${{ secrets.DISPATCH_TOKEN }}
repository: ghcr.io/${{ github.repository_owner }}/hassio-addons repository: ${{ github.repository_owner }}/hassio-addons
event-type: update event-type: update
client-payload: > client-payload: >
{ {
@@ -0,0 +1,27 @@
#!/command/with-contenv bashio
# shellcheck shell=bash
# ==============================================================================
# Home Assistant Community Add-on: TVHeadend
# Take down the S6 supervision tree when cron fails
# ==============================================================================
declare exit_code
readonly exit_code_container=$(</run/s6-linux-init-container-results/exitcode)
readonly exit_code_service="${1}"
readonly exit_code_signal="${2}"
readonly service="cron"
bashio::log.info \
"Service ${service} exited with code ${exit_code_service}" \
"(by signal ${exit_code_signal})"
if [[ "${exit_code_service}" -eq 256 ]]; then
if [[ "${exit_code_container}" -eq 0 ]]; then
echo $((128 + $exit_code_signal)) > /run/s6-linux-init-container-results/exitcode
fi
[[ "${exit_code_signal}" -eq 15 ]] && exec /run/s6/basedir/bin/halt
elif [[ "${exit_code_service}" -ne 0 ]]; then
if [[ "${exit_code_container}" -eq 0 ]]; then
echo "${exit_code_service}" > /run/s6-linux-init-container-results/exitcode
fi
exec /run/s6/basedir/bin/halt
fi
@@ -1,4 +1,5 @@
#!/usr/bin/with-contenv bashio #!/usr/bin/with-contenv bashio
# shellcheck shell=bash
# ============================================================================== # ==============================================================================
# Home Assistant Community Add-on: TVHeadend # Home Assistant Community Add-on: TVHeadend
# Runs the cron daemon # Runs the cron daemon
@@ -0,0 +1 @@
longrun
@@ -1,4 +1,5 @@
#!/usr/bin/with-contenv bashio #!/usr/bin/with-contenv bashio
# shellcheck shell=bash
# ============================================================================== # ==============================================================================
# Home Assistant Community Add-on: TVHeadend # Home Assistant Community Add-on: TVHeadend
# Executes user customizations on startup # Executes user customizations on startup
@@ -0,0 +1 @@
oneshot
@@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/init-customizations/run
@@ -1,4 +1,5 @@
#!/usr/bin/with-contenv bashio #!/usr/bin/with-contenv bashio
# shellcheck shell=bash
# ============================================================================== # ==============================================================================
# Home Assistant Community Add-on: TVHeadend # Home Assistant Community Add-on: TVHeadend
# Executes user customizations on startup # Executes user customizations on startup
@@ -0,0 +1 @@
oneshot
@@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/init-tvheadend/run
@@ -0,0 +1,27 @@
#!/command/with-contenv bashio
# shellcheck shell=bash
# ==============================================================================
# Home Assistant Community Add-on: TVHeadend
# Take down the S6 supervision tree when tvheadend fails
# ==============================================================================
declare exit_code
readonly exit_code_container=$(</run/s6-linux-init-container-results/exitcode)
readonly exit_code_service="${1}"
readonly exit_code_signal="${2}"
readonly service="tvheadend"
bashio::log.info \
"Service ${service} exited with code ${exit_code_service}" \
"(by signal ${exit_code_signal})"
if [[ "${exit_code_service}" -eq 256 ]]; then
if [[ "${exit_code_container}" -eq 0 ]]; then
echo $((128 + $exit_code_signal)) > /run/s6-linux-init-container-results/exitcode
fi
[[ "${exit_code_signal}" -eq 15 ]] && exec /run/s6/basedir/bin/halt
elif [[ "${exit_code_service}" -ne 0 ]]; then
if [[ "${exit_code_container}" -eq 0 ]]; then
echo "${exit_code_service}" > /run/s6-linux-init-container-results/exitcode
fi
exec /run/s6/basedir/bin/halt
fi
@@ -1,4 +1,5 @@
#!/usr/bin/with-contenv bashio #!/usr/bin/with-contenv bashio
# shellcheck shell=bash
# ============================================================================== # ==============================================================================
# Home Assistant Community Add-on: TVHeadend # Home Assistant Community Add-on: TVHeadend
# Starts TVHeadend # Starts TVHeadend
@@ -0,0 +1 @@
longrun
@@ -1,9 +0,0 @@
#!/usr/bin/execlineb -S0
# ==============================================================================
# Home Assistant Community Add-on: TVHeadend
# Take down the S6 supervision tree when crond fails
# ==============================================================================
if -n { s6-test $# -ne 0 }
if -n { s6-test ${1} -eq 256 }
s6-svscanctl -t /var/run/s6/services
@@ -1,9 +0,0 @@
#!/usr/bin/execlineb -S0
# ==============================================================================
# Home Assistant Community Add-on: TVHeadend
# Take down the S6 supervision tree when TVHeadend fails
# ==============================================================================
if -n { s6-test $# -ne 0 }
if -n { s6-test ${1} -eq 256 }
s6-svscanctl -t /var/run/s6/services