auto_update

This commit is contained in:
qiaofeng1227 2023-06-25 15:16:03 +08:00
parent 7fc46813b6
commit c67111bdda
6 changed files with 20 additions and 16 deletions

View file

@ -22,7 +22,7 @@ jobs:
name: Build & push Docker image name: Build & push Docker image
with: with:
image: websoft9dev/appmanage image: websoft9dev/appmanage
tags: 0.7.1 tags: 0.7.2
registry: docker.io registry: docker.io
dockerfile: appmanage/Dockerfile dockerfile: appmanage/Dockerfile
directory: appmanage directory: appmanage

View file

@ -1,3 +1,7 @@
## 0.7.2 release on 2023-06-25
appmanage 自动更新接口升级
## 0.7.1 release on 2023-06-21 ## 0.7.1 release on 2023-06-21
appmanage version 文件意外删除时 bug 修改 appmanage version 文件意外删除时 bug 修改

View file

@ -10,7 +10,7 @@ COPY static ./static
COPY requirements.txt main.py ./ COPY requirements.txt main.py ./
RUN apt update RUN apt update
# Install supervisord # Install supervisords
RUN apt install -y supervisor RUN apt install -y supervisor
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY config/cmd.sh /cmd.sh COPY config/cmd.sh /cmd.sh

View file

@ -54,18 +54,18 @@ def AppAutoUpdate(auto_update):
myLogger.info_logger(scheduler.state) myLogger.info_logger(scheduler.state)
myLogger.info_logger(scheduler.get_jobs()) myLogger.info_logger(scheduler.get_jobs())
if auto_update: if auto_update == "true" or auto_update == "True":
if scheduler.state == "1": scheduler.resume()
raise CommandException(const.ERROR_CLIENT_PARAM_REPEAT,"auto_update already in running state", "auto_update already in running state") return "true"
elif auto_update == "false" or auto_update == "False":
scheduler.pause()
return "false"
elif auto_update == None or auto_update == "" or auto_update == "undefine":
state = scheduler.state
if state == 1:
return "true"
else: else:
scheduler.resume() return "false"
return "软件商店自动更新已经开启"
else:
if scheduler.state == "2":
raise CommandException(const.ERROR_CLIENT_PARAM_REPEAT,"auto_update already in closed state", "auto_update already in closed state")
else:
scheduler.pause()
return "软件商店自动更新已经关闭"
# 更新软件商店 # 更新软件商店
def AppStoreUpdate(): def AppStoreUpdate():

View file

@ -1,4 +1,4 @@
APP_NAME=websoft9-appmanage APP_NAME=websoft9-appmanage
APP_VERSION=0.7.1 APP_VERSION=0.7.2
APP_HTTP_PORT=5000 APP_HTTP_PORT=5000
APP_NETWORK=websoft9 APP_NETWORK=websoft9

View file

@ -2,8 +2,8 @@
"SERVICES": { "SERVICES": {
"PORTAINER": "2.18.3", "PORTAINER": "2.18.3",
"NGINX": "2.10.3", "NGINX": "2.10.3",
"APPMANAGE": "0.7.1", "APPMANAGE": "0.7.2",
"REDIS": "7.0.11" "REDIS": "7.0.11"
}, },
"VERSION": "0.7.1" "VERSION": "0.7.2"
} }