mirror of
https://github.com/Websoft9/websoft9.git
synced 2024-11-25 00:50:30 +00:00
install error
This commit is contained in:
parent
d0ac1598c2
commit
cecade4a4a
2 changed files with 25 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -133,6 +133,30 @@ def delete_app_failedjob(job_id):
|
|||
failed = FailedJobRegistry(queue=q)
|
||||
failed.remove(job_id, delete_job=True)
|
||||
|
||||
def delete_app(job_id):
|
||||
|
||||
try:
|
||||
app_name = app_id.split('_')[0]
|
||||
customer_name = app_id.split('_')[1]
|
||||
app_path = ""
|
||||
info, code_exist = app_exits_in_docker(app_id)
|
||||
if code_exist:
|
||||
app_path = info.split()[-1].rsplit('/', 1)[0]
|
||||
cmd = "docker compose -f " + app_path + "/docker-compose.yml down -v"
|
||||
lib_path = '/data/library/apps/' + app_name
|
||||
if app_path != lib_path:
|
||||
cmd = cmd + " && sudo rm -rf " + app_path
|
||||
shell_execute.execute_command_output_all(cmd)
|
||||
else:
|
||||
if check_app_rq(app_id):
|
||||
delete_app_failedjob(app_id)
|
||||
else:
|
||||
raise CommandException(const.ERROR_CLIENT_PARAM_NOTEXIST, "AppID is not exist", "")
|
||||
cmd = " sudo rm -rf /data/apps/" + customer_name
|
||||
shell_execute.execute_command_output_all(cmd)
|
||||
except CommandException as ce:
|
||||
myLogger.info_logger("Delete app compose exception")
|
||||
|
||||
def uninstall_app(app_id):
|
||||
|
||||
app_name = app_id.split('_')[0]
|
||||
|
|
Loading…
Reference in a new issue