From ac6ba075b4e4c7558eb4d26d3820e7c068b28986 Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Thu, 27 Jul 2023 10:09:15 +0800 Subject: [PATCH] latest --- .github/workflows/build_appmanage.yml | 1 + appmanage/api/service/manage.py | 2 +- appmanage/api/utils/shell_execute.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_appmanage.yml b/.github/workflows/build_appmanage.yml index 975bb412..aa05f16d 100644 --- a/.github/workflows/build_appmanage.yml +++ b/.github/workflows/build_appmanage.yml @@ -30,6 +30,7 @@ jobs: with: image: websoft9dev/appmanage tags: ${{ env.VERSION }} + addLatest: True registry: docker.io dockerfile: appmanage/Dockerfile directory: appmanage diff --git a/appmanage/api/service/manage.py b/appmanage/api/service/manage.py index e455f2f2..f02d2915 100644 --- a/appmanage/api/service/manage.py +++ b/appmanage/api/service/manage.py @@ -112,7 +112,7 @@ def get_update_list(): local_version = json.loads(op)['VERSION'] except: local_version = "0.0.0" - version_cmd = "curl" + const.ARTIFACT_URL + "/version.json" + version_cmd = "curl " + const.ARTIFACT_URL + "/version.json" latest = shell_execute.execute_command_output_all(version_cmd)['result'] version = json.loads(latest)['VERSION'] ret = {} diff --git a/appmanage/api/utils/shell_execute.py b/appmanage/api/utils/shell_execute.py index 181d5090..7f40996f 100644 --- a/appmanage/api/utils/shell_execute.py +++ b/appmanage/api/utils/shell_execute.py @@ -15,7 +15,7 @@ def execute_command_output_all(cmd_str): myLogger.info_logger("Start to execute cmd: " + cmd_str) - process = subprocess.run(f'nsenter -m -u -i -n -p -t 1 sh -c "{cmd_str}"', capture_output=True, check=False, text=True, shell=True) + process = subprocess.run(f'nsenter -m -u -i -n -p -t 1 sh -c "{cmd_str}"', capture_output=True, bufsize=65536, check=False, text=True, shell=True) if process.returncode == 0 and 'Fail' not in process.stdout and 'fail' not in process.stdout and 'Error' not in process.stdout and 'error' not in process.stdout: