mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-15 17:08:19 +01:00
Remove stats
This commit is contained in:
69
.github/workflows/daily_README.yaml
vendored
69
.github/workflows/daily_README.yaml
vendored
@@ -36,75 +36,6 @@ jobs:
|
||||
fi
|
||||
done
|
||||
|
||||
# Sort yaml
|
||||
sort -t= ".github/paths-filter.yml" -o ".github/paths-filter.yml"
|
||||
- name: Create stats
|
||||
run: |
|
||||
echo "Starting"
|
||||
COUNT=0
|
||||
COUNT1=0
|
||||
COUNT2=0
|
||||
COUNT3=0
|
||||
# Make sure file exists
|
||||
touch Stats
|
||||
if ! grep -q "Date" Stats; then
|
||||
sed -i "1i Date" Stats
|
||||
fi
|
||||
# Add new column
|
||||
sed -i 's/^/- /' a
|
||||
# Add date
|
||||
sed -i "/Date/s|^-|$(date '+%Y-%m-%d')|" a
|
||||
|
||||
# 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
|
||||
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}')"
|
||||
until [ -n "$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
|
||||
COUNT1="$COUNT"
|
||||
echo "$COUNT $ARCH users with $SLUG" && DOWNLOADS="$(( DOWNLOADS + COUNT))"
|
||||
else COUNT1="-"; fi
|
||||
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 [ -n "$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
|
||||
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}')"
|
||||
until [ -n "$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
|
||||
COUNT3="$COUNT"
|
||||
echo "$COUNT $ARCH users with $SLUG" && DOWNLOADS="$(( DOWNLOADS + COUNT))"
|
||||
else COUNT3="-";fi
|
||||
echo "$SLUG $DOWNLOADS $COUNT1 $COUNT2 $COUNT3" >> Stats
|
||||
# Create line if not existing
|
||||
if ! grep -q "$SLUG" Stats; then
|
||||
sed -ie "\$a$SLUG" Stats
|
||||
for i in $(seq $(head -n 1 Stats | tr -cd ' \t' | wc -c )); do
|
||||
sed -i "/$slug/s|^|- |" Stats
|
||||
done
|
||||
fi
|
||||
# Add data
|
||||
sed -i "/$SLUG/s|^-|$DOWNLOADS|" a
|
||||
fi
|
||||
done
|
||||
|
||||
# Make stats
|
||||
sort -k1 -r -n Stats > tmp && mv tmp Stats
|
||||
#sed -i "1i Name Total armv7 amd64 aarch64" Stats
|
||||
#TOTAL="$(awk '{SUM+=$2}END{print SUM}' Stats)"
|
||||
#TOTAL1="$(awk '{SUM+=$2}END{print SUM}' Stats)"
|
||||
#TOTAL2="$(awk '{SUM+=$2}END{print SUM}' Stats)"
|
||||
#TOTAL3="$(awk '{SUM+=$2}END{print SUM}' Stats)"
|
||||
|
||||
# Make plot
|
||||
|
||||
#apt-get install gnuplot -y
|
||||
#https://www.xmodulo.com/draw-stacked-histogram-gnuplot.html
|
||||
|
||||
# Sort yaml
|
||||
sort -t= ".github/paths-filter.yml" -o ".github/paths-filter.yml"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user