add update.sh

This commit is contained in:
Darren 2023-10-27 10:41:24 +08:00 committed by GitHub
parent 7ec0a94944
commit 78819990a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 27 additions and 28 deletions

View file

@ -5,5 +5,4 @@ keyrings.alt
requests
GitPython
PyJWT
click
schedule
click

View file

@ -1,12 +0,0 @@
import schedule
import time
import os
def job():
os.system("echo 'start to test schedule'")
schedule.every(5).seconds.do(job)
while True:
schedule.run_pending()
time.sleep(1)

View file

@ -1,4 +1,4 @@
# modify time: 202310270905, you can modify here to trigger Docker Build action
# modify time: 202310271039, you can modify here to trigger Docker Build action
FROM python:3.10-bullseye AS buildstage
LABEL maintainer="Websoft9<help@websoft9.com>"
@ -36,8 +36,9 @@ COPY --from=buildstage /w9library ./library
COPY --from=buildstage /websoft9/apphub ./apphub
COPY --from=buildstage /swagger-ui/dist ./apphub/swagger-ui
COPY --from=buildstage /websoft9/apphub/src/config ./config
COPY --from=buildstage /websoft9/docker/apphub/script ./script
RUN apt update && apt install curl git jq iproute2 supervisor -y
RUN apt update && apt install curl git jq cron iproute2 supervisor -y --no-install-recommends
RUN pip install --no-cache-dir --upgrade -r apphub/requirements.txt
RUN pip install -e ./apphub
@ -45,9 +46,13 @@ RUN pip install -e ./apphub
# supervisor
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
RUN chmod +r /etc/supervisor/conf.d/supervisord.conf
COPY config/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
COPY config/migration.sh /migration.sh
# cron
COPY config/cron /etc/cron.d/cron
RUN crontab /etc/cron.d/cron
# chmod for all .sh script
RUN find /websoft9/script -name "*.sh" -exec chmod +x {} \;
VOLUME /websoft9/apphub/logs
VOLUME /websoft9/apphub/src/config
@ -58,4 +63,4 @@ RUN rm -rf apphub/docs apphub/tests library.zip plugin-appstore && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man /usr/share/doc /usr/share/doc-base
EXPOSE 8080
ENTRYPOINT ["/entrypoint.sh"]
ENTRYPOINT ["/websoft9/script/entrypoint.sh"]

View file

@ -1,6 +1,4 @@
ARG APPHUB_VERSION
FROM websoft9dev/apphub:${APPHUB_VERSION} as buildstage
RUN mkdir -p /websoft9/apphub-dev
COPY apphub/config/developer.sh /developer.sh
RUN chmod +x /developer.sh
RUN sed -i '/supervisorctl start apphub/c\supervisorctl start apphubdev' /entrypoint.sh
RUN sed -i '/supervisorctl start apphub/c\supervisorctl start apphubdev' /websoft9/script/entrypoint.sh

View file

@ -0,0 +1 @@
* * * * * /websoft9/script/update.sh

View file

@ -17,7 +17,7 @@ stderr_logfile=/var/log/supervisord.log
stderr_logfile_maxbytes=0
[program:apphubdev]
command=/developer.sh
command=/websoft9/script/developer.sh
autostart=false
user=root
stdout_logfile=/var/log/supervisord.log
@ -25,11 +25,10 @@ stdout_logfile_maxbytes=0
stderr_logfile=/var/log/supervisord.log
stderr_logfile_maxbytes=0
[program:updatemedia]
command=/usr/local/bin/python update_media.py
[program:cron]
command=cron -f
autostart=true
user=root
directory=/websoft9/apphub/src
stdout_logfile=/var/log/supervisord.log
stdout_logfile_maxbytes=0
stderr_logfile=/var/log/supervisord.log

View file

@ -6,7 +6,7 @@ export PATH
set -e
bash /migration.sh
bash /websoft9/script/migration.sh
try_times=5
supervisord

View file

@ -0,0 +1,7 @@
#!/bin/bash
# update media and library
echo "Compare remote version and local version"
echo "Download "

View file

@ -1,3 +1,5 @@
# S6
S6 is a mulitply process management tools at Nginx Proxy Manager.
- nginx_proxy() at migration.sh: Migration initproxy.conf to Nginx, condition is compare Container created time and Named Volumes created time