diff --git a/docker/apphub/Dockerfile b/docker/apphub/Dockerfile index 6fe92021..7bc65a92 100644 --- a/docker/apphub/Dockerfile +++ b/docker/apphub/Dockerfile @@ -1,11 +1,11 @@ # This file can running at actions # MEDIA_VERSION and LIBRARY_VERSION will trigger its release -# modify time: 202412211221, you can modify here to trigger Docker Build action +# modify time: 202412231521, you can modify here to trigger Docker Build action FROM python:3.10-slim-bullseye LABEL maintainer="Websoft9" -LABEL version="0.1.7" +LABEL version="0.1.8" WORKDIR /websoft9 @@ -39,6 +39,7 @@ RUN apt update && apt install -y --no-install-recommends curl git jq cron iprout cp -r ./w9source/apphub/src/config ./config && \ cp -r ./w9source/docker/apphub/script ./script && \ curl -o ./script/update_zip.sh $SOURCE_GITHUB_PAGES/scripts/update_zip.sh && \ + curl -o /websoft9/version.json $SOURCE_GITHUB_PAGES/version.json && \ pip install --no-cache-dir --upgrade -r apphub/requirements.txt && \ pip install -e ./apphub && \ # Clean cache and install files diff --git a/docker/apphub/script/update.sh b/docker/apphub/script/update.sh index 7ef46d23..e3040705 100644 --- a/docker/apphub/script/update.sh +++ b/docker/apphub/script/update.sh @@ -1,9 +1,20 @@ #!/bin/bash -echo "$(date '+%Y-%m-%d %H:%M:%S') - INFO - Compare remote version and local version." | tee -a /var/log/supervisord.log +channel=release +if [ -f /websoft9/version.json ]; then + version=$(cat /websoft9/version.json | jq -r .version) + if [[ $version == *rc* ]]; then + channel=dev + fi +fi + +echo "channel is $channel" + +echo "$(date '+%Y-%m-%d %H:%M:%S') - INFO - Compare remote version and local version." | tee -a /var/log/supervisord.log echo "$(date '+%Y-%m-%d %H:%M:%S') - INFO - Download remote packages and replace local data." | tee -a /var/log/supervisord.log -bash /websoft9/script/update_zip.sh --package_name "media-latest.zip" --sync_to "/websoft9/media" -bash /websoft9/script/update_zip.sh --package_name "library-latest.zip" --sync_to "/websoft9/library" + +bash /websoft9/script/update_zip.sh --channel $channel --package_name "media-latest.zip" --sync_to "/websoft9/media" +bash /websoft9/script/update_zip.sh --channel $channel --package_name "library-latest.zip" --sync_to "/websoft9/library" echo "$(date '+%Y-%m-%d %H:%M:%S') - INFO - Success to update library and media." \ No newline at end of file