mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-13 03:11:02 +01:00
Update daily_README.yaml
This commit is contained in:
36
.github/workflows/daily_README.yaml
vendored
36
.github/workflows/daily_README.yaml
vendored
@@ -48,23 +48,24 @@ jobs:
|
||||
COUNT3=0
|
||||
|
||||
# Go through all folders, add to filters if not existing
|
||||
# shellcheck disable=SC2086
|
||||
for f in $( find -- * -maxdepth 0 -type d | sort -r ); do
|
||||
DOWNLOADS=0
|
||||
if [ -f "$f"/config.json ]; then
|
||||
SLUG=$(jq -r '.image' "$f/config.json" | awk -F 'alexbelgium/|-{arch' '{print $2}')
|
||||
if [[ $(jq '.arch[]' "$f/config.json") == *"armv7"* ]]; then
|
||||
SLUG="$(jq -r '.image' "$f/config.json" | awk -F 'alexbelgium/|-{arch' '{print $2}')"
|
||||
if [[ "$(jq '.arch[]' "$f/config.json")" == *"armv7"* ]]; then
|
||||
ARCH=armv7 && COUNT="$(curl -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')"
|
||||
if [ -z "$COUNT" ]; then echo "$(curl -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}')"; fi
|
||||
COUNT1="$COUNT"
|
||||
echo "$COUNT $ARCH users with $SLUG" && DOWNLOADS="$(( DOWNLOADS + COUNT))"
|
||||
else COUNT1="-"; fi
|
||||
if [[ $(jq '.arch[]' "$f/config.json") == *"amd64"* ]]; then
|
||||
if [[ "$(jq '.arch[]' "$f/config.json")" == *"amd64"* ]]; then
|
||||
ARCH=amd64 && COUNT="$(curl -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')"
|
||||
until [ ! -z "$COUNT" ]; do COUNT="$(curl -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')" && sleep 5; done
|
||||
COUNT2="$COUNT"
|
||||
echo "$COUNT $ARCH users with $SLUG" && DOWNLOADS="$(( DOWNLOADS + COUNT))"
|
||||
else COUNT2="-"; fi
|
||||
if [[ $(jq '.arch[]' "$f/config.json") == *"aarch64"* ]]; then
|
||||
if [[ "$(jq '.arch[]' "$f/config.json")" == *"aarch64"* ]]; then
|
||||
ARCH=aarch64 && COUNT="$(curl -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')"
|
||||
if [ -z "$COUNT" ]; then echo "$(curl -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}')"; fi
|
||||
COUNT3="$COUNT"
|
||||
@@ -96,8 +97,6 @@ jobs:
|
||||
# Init
|
||||
|
||||
echo "Starting"
|
||||
declare -i DOWNLOADS
|
||||
declare -i COUNT
|
||||
|
||||
# Prepare template
|
||||
|
||||
@@ -109,6 +108,7 @@ jobs:
|
||||
|
||||
# Sort folders by addon name
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
for f in $( find -- * -maxdepth 0 -type d | sort -r ); do
|
||||
if [ -f "$f"/config.json ]; then
|
||||
NAME=$(jq -r '.name' "$f"/config.json)
|
||||
@@ -130,12 +130,12 @@ jobs:
|
||||
|
||||
# Get variables
|
||||
if [ -f "$f/oldname" ]; then FOLDERNAME="$(cat "$f/oldname")"; else FOLDERNAME="$f"; fi
|
||||
NAME=$(jq -r '.name' "$f/config.json")
|
||||
DESCRIPTION=$(jq -r '.description' "$f/config.json")
|
||||
NAME="$(jq -r '.name' "$f/config.json")"
|
||||
DESCRIPTION="$(jq -r '.description' "$f/config.json")"
|
||||
# Get icon
|
||||
if [ "$(jq '.panel_icon' "$f/config.json")" != null ]; then
|
||||
ICON="$(jq -r '.panel_icon' "$f/config.json")"
|
||||
ICON=${ICON#*:}
|
||||
ICON="${ICON#*:}"
|
||||
ICON=""
|
||||
else
|
||||
ICON=""
|
||||
@@ -144,19 +144,19 @@ jobs:
|
||||
# Write infos
|
||||
echo "Writing infos"
|
||||
sed -i "$ADDONSLINE"'{G;}' README2.md
|
||||
if [[ $(jq '.schema' "$f/config.json" 2>/dev/null) == *"localdisks"* ]]; then sed -i "$ADDONSLINE"'a ![localdisks][localdisks-badge]' README2.md; fi
|
||||
if [[ $(jq '.schema' "$f/config.json" 2>/dev/null) == *"networkdisks"* ]]; then sed -i "$ADDONSLINE"'a ![smb][smb-badge]' README2.md; fi
|
||||
if [[ $(jq '.full_access' "$f/config.json" 2>/dev/null) == "true" ]]; then sed -i "$ADDONSLINE"'a ![full_access][full_access-badge]' README2.md; fi
|
||||
if [[ $(jq '.services[]' "$f/config.json" 2>/dev/null) == *"mqtt"* ]]; then sed -i "$ADDONSLINE"'a ![mqtt][mqtt-badge]' README2.md; fi
|
||||
if [[ $(jq '.services[]' "$f/config.json" 2>/dev/null) == *"mysql"* ]]; then sed -i "$ADDONSLINE"'a ![MariaDB][mariadb-badge]' README2.md; fi
|
||||
if [[ $(jq '.ingress' "$f/config.json" 2>/dev/null) == "true" ]]; then sed -i "$ADDONSLINE"'a ![ingress][ingress-badge]' README2.md; fi
|
||||
if [[ $(jq '.arch[]' "$f/config.json") == *"armv7"* ]]; then
|
||||
if [[ "$(jq '.schema' "$f/config.json" 2>/dev/null)" == *"localdisks"* ]]; then sed -i "$ADDONSLINE"'a ![localdisks][localdisks-badge]' README2.md; fi
|
||||
if [[ "$(jq '.schema' "$f/config.json" 2>/dev/null)" == *"networkdisks"* ]]; then sed -i "$ADDONSLINE"'a ![smb][smb-badge]' README2.md; fi
|
||||
if [[ "$(jq '.full_access' "$f/config.json" 2>/dev/null)" == "true" ]]; then sed -i "$ADDONSLINE"'a ![full_access][full_access-badge]' README2.md; fi
|
||||
if [[ "$(jq '.services[]' "$f/config.json" 2>/dev/null)" == *"mqtt"* ]]; then sed -i "$ADDONSLINE"'a ![mqtt][mqtt-badge]' README2.md; fi
|
||||
if [[ "$(jq '.services[]' "$f/config.json" 2>/dev/null)" == *"mysql"* ]]; then sed -i "$ADDONSLINE"'a ![MariaDB][mariadb-badge]' README2.md; fi
|
||||
if [[ "$(jq '.ingress' "$f/config.json" 2>/dev/null)" == "true" ]]; then sed -i "$ADDONSLINE"'a ![ingress][ingress-badge]' README2.md; fi
|
||||
if [[ "$(jq '.arch[]' "$f/config.json")" == *"armv7"* ]]; then
|
||||
sed -i "$ADDONSLINE"'a ![armv7][armv7-badge]' README2.md
|
||||
else sed -i "$ADDONSLINE"'a ![armv7no][armv7no-badge]' README2.md; fi || true
|
||||
if [[ $(jq '.arch[]' "$f/config.json") == *"amd64"* ]]; then
|
||||
if [[ "$(jq '.arch[]' "$f/config.json")" == *"amd64"* ]]; then
|
||||
sed -i "$ADDONSLINE"'a ![amd64][amd64-badge]' README2.md
|
||||
else sed -i "$ADDONSLINE"'a ![amd64no][amd64no-badge]' README2.md; fi || true
|
||||
if [[ $(jq '.arch[]' "$f/config.json") == *"aarch64"* ]]; then
|
||||
if [[ "$(jq '.arch[]' "$f/config.json")" == *"aarch64"* ]]; then
|
||||
sed -i "$ADDONSLINE"'a ![aarch64][aarch64-badge]' README2.md
|
||||
else sed -i "$ADDONSLINE"'a ![aarch64no][aarch64no-badge]' README2.md; fi || true
|
||||
if [[ -f "$f/updater.json" ]]; then sed -i "$ADDONSLINE"'a ' README2.md; fi
|
||||
|
||||
Reference in New Issue
Block a user