version file bug

This commit is contained in:
qiaofeng1227 2023-06-21 09:07:40 +08:00
parent 3f4c1c56ab
commit 45fffbd167
7 changed files with 29 additions and 16 deletions

View file

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

View file

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

View file

@ -37,12 +37,8 @@ def auto_update():
myLogger.info_logger("auto update")
shell_execute.execute_command_output_all("wget https://websoft9.github.io/StackHub/install/update_appstore.sh && bash update_appstore.sh 1>/dev/null 2>&1")
def test():
shell_execute.execute_command_output_all("echo 1111 >> /tmp/test1")
scheduler = BackgroundScheduler()
scheduler.add_job(auto_update, 'cron', second=1)
scheduler.add_job(test, 'cron', second=1)
scheduler.add_job(auto_update, 'cron', hour=1)
scheduler.start()
# 获取github文件内容
@ -79,7 +75,7 @@ def AppStoreUpdate():
op = shell_execute.execute_command_output_all("cat " + local_path)['result']
local_version = json.loads(op)['VERSION']
except:
local_version = "0.1.0"
local_version = "0.0.1"
repo = 'docker-library'
version_contents = get_github_content(repo, 'install/version.json')
@ -102,8 +98,12 @@ def AppStoreUpdate():
def get_update_list():
local_path = '/data/apps/stackhub/install/version.json'
repo = 'StackHub'
op = shell_execute.execute_command_output_all("cat " + local_path)['result']
local_version = json.loads(op)['VERSION']
local_version = "0"
try:
op = shell_execute.execute_command_output_all("cat " + local_path)['result']
local_version = json.loads(op)['VERSION']
except:
local_version = "0.0.1"
version_contents = get_github_content(repo, 'install/version.json')
version = json.loads(version_contents)['VERSION']
ret = {}

View file

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

View file

@ -94,7 +94,11 @@ function fastest_url() {
LibraryUpdate(){
echo "Update appstore library..."
old_library_version=$(cat /data/library/install/version.json | jq .VERSION | tr -d '"')
if [ ! -f /data/library/install/version.json ]; then
old_library_version="0.0.1"
else
old_library_version=$(cat /data/library/install/version.json | jq .VERSION | tr -d '"')
fi
latest_library_version=$(curl https://websoft9.github.io/docker-library/install/version.json | jq .VERSION | tr -d '"')
if [ "$old_library_version" \< "$latest_library_version" ]; then
echo "start to update Library..."
@ -122,7 +126,12 @@ fi
StackhubUpdate(){
echo "Update stackhub ..."
cd /tmp && rm -rf version.json && wget https://websoft9.github.io/StackHub/install/version.json
old_version=$(cat /data/apps/stackhub/install/version.json | jq .VERSION | tr -d '"')
if [ ! -f /data/apps/stackhub/install/version.json ]; then
old_version="0.0.1"
else
old_version=$(cat /data/apps/stackhub/install/version.json | jq .VERSION | tr -d '"')
fi
release_version=$(cat /tmp/version.json | jq .VERSION | tr -d '"')
if [ "$old_version" \< "$release_version" ]; then

View file

@ -37,7 +37,11 @@ function fastest_url() {
LibraryUpdate(){
echo "auto_update start..." >> /tmp/auto_update.txt
old_library_version=$(cat /data/library/install/version.json | jq .VERSION | tr -d '"')
if [ ! -f /data/library/install/version.json ]; then
old_library_version="0.0.1"
else
old_library_version=$(cat /data/library/install/version.json | jq .VERSION | tr -d '"')
fi
latest_library_version=$(curl https://websoft9.github.io/docker-library/install/version.json | jq .VERSION | tr -d '"')
release_version=$(curl https://websoft9.github.io/StackHub/install/version.json | jq .VERSION | tr -d '"')
if [ "$old_library_version" \< "$latest_library_version" ]; then

View file

@ -2,7 +2,7 @@
"SERVICES": {
"PORTAINER": "2.18.3",
"NGINX": "2.10.3",
"APPMANAGE": "0.6.0",
"APPMANAGE": "0.7.1",
"REDIS": "7.0.11"
},
"PLUGINS": {
@ -15,5 +15,5 @@
"LIBRARY": {
"VERSION": "0.2.2"
},
"VERSION": "0.7.0"
"VERSION": "0.7.1"
}