Compare commits

...
3 Commits
Author SHA1 Message Date
junvandGitHub 56190aea72 Add new version checker (#180)
* Add logic to allow user check new version

* update action
2021-10-13 23:01:35 +11:00
junv 42f1317afe Ignore curl error in github action 2021-10-13 17:23:26 +11:00
junv a6c21b228e Fix syntax issue in bash 2021-10-13 17:13:25 +11:00
5 changed files with 47 additions and 4 deletions
+20 -3
View File
@@ -72,13 +72,30 @@ jobs:
if: contains(github.ref, '/heads/master') || contains(github.ref, '/tags/v')
run: |
docker buildx imagetools inspect ${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }}
- name: Update tag
-
name: Update APP VERSION
if: contains(github.ref, '/tags/v')
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo $VERSION > APP_VERSION
-
name: Commit changes
if: contains(github.ref, '/tags/v')
uses: EndBug/add-and-commit@v7
with:
author_name: junv-repo-bot
author_email: me@toozhao.com
message: 'Update version'
add: 'APP_VERSION'
push: true
-
name: Update tag
if: contains(github.ref, '/tags/v')
env:
API_KEY: ${{ secrets.BadgeAPIKey }}
run: |
VERSION=${GITHUB_REF#refs/tags/v}
curl -XPUT -D- 'https://badges.toozhao.com/val/aria2-ui-docker' \
-H 'Content-Type: application/json' \
-H 'API_KEY': ${API_KEY} \
-d '{"value": "${GITHUB_REF#refs/tags/v}"}'
-d '{"value": "'${VERSION}'"}' || true
+1
View File
@@ -0,0 +1 @@
4.8.2.2
+1 -1
View File
@@ -35,7 +35,7 @@ ENV XDG_DATA_HOME=/app/.caddy/data
ENV XDG_CONFIG_HOME=/app/.caddy/config
ENV RCLONE_CONFIG_BASE64=""
ADD install.sh aria2c.sh caddy.sh Procfile init.sh start.sh rclone.sh /app/
ADD install.sh aria2c.sh caddy.sh Procfile init.sh start.sh rclone.sh new-version-checker.sh APP_VERSION /app/
ADD conf /app/conf
ADD Caddyfile SecureCaddyfile HerokuCaddyfile /usr/local/caddy/
+1
View File
@@ -2,3 +2,4 @@ caddy: /app/caddy.sh
filebrowser: /app/filebrowser -p 8080 -d /app/filebrowser.db -r /data -b /files
aria2c: /app/aria2c.sh
rclone: /app/rclone.sh
newer_version_checker: /app/new-version-checker.sh
+24
View File
@@ -0,0 +1,24 @@
#! /bin/bash -u
sleep 5
set -e
APP_VERSION=$(cat APP_VERSION)
set +e
while true; do
echo "[INFO] $(date -u +'%Y-%m-%dT%H:%M:%SZ') Checking for new version against ${APP_VERSION} ..."
newer_version=$(curl -s https://badges.toozhao.com/val/aria2-ui-docker?version=${APP_VERSION})
if [ -z ${newer_version} ]; then
echo "[WARN] $(date -u +'%Y-%m-%dT%H:%M:%SZ') Failed to check new version."
sleep 86400
continue
fi
if [ ${newer_version} != ${APP_VERSION} ]; then
echo "[INFO] $(date -u +'%Y-%m-%dT%H:%M:%SZ') Found newer Docker image version wahyd4/aria2-ui:${newer_version}, please consider to upgrade by using docker pull command to have better user experience."
# check new version daily
sleep 86400
continue
fi
echo "[INFO] $(date -u +'%Y-%m-%dT%H:%M:%SZ') Good job, you are using the latest version docker image"
sleep 86400
done