diff --git a/spug_api/apps/app/views.py b/spug_api/apps/app/views.py index 0de058d..bae4b5c 100644 --- a/spug_api/apps/app/views.py +++ b/spug_api/apps/app/views.py @@ -3,11 +3,14 @@ # Released under the AGPL-3.0 License. from django.views.generic import View from django.db.models import F +from django.conf import settings from libs import JsonParser, Argument, json_response from apps.app.models import App, Deploy, DeployExtend1, DeployExtend2 from apps.config.models import Config from apps.app.utils import parse_envs, fetch_versions, remove_repo +import subprocess import json +import os class AppView(View): @@ -145,6 +148,8 @@ class DeployView(View): ).parse(request.GET) if error is None: Deploy.objects.filter(pk=form.id).delete() + repo_dir = os.path.join(settings.REPOS_DIR, str(form.id)) + subprocess.Popen(f'rm -rf {repo_dir} {repo_dir + "_*"}', shell=True) return json_response(error=error) diff --git a/spug_web/src/pages/deploy/app/Table.js b/spug_web/src/pages/deploy/app/Table.js index 10e5a66..225a6b0 100644 --- a/spug_web/src/pages/deploy/app/Table.js +++ b/spug_web/src/pages/deploy/app/Table.js @@ -67,7 +67,7 @@ class ComTable extends React.Component { handleDeployDelete = (text) => { Modal.confirm({ title: '删除确认', - content: `确定要删除【${lds.get(envStore.idMap, `${text.env_id}.name`)}】的发布配置?`, + content: `删除发布配置将会影响基于该配置所创建发布申请的发布和回滚功能,确定要删除【${lds.get(envStore.idMap, `${text.env_id}.name`)}】的发布配置?`, onOk: () => { return http.delete('/api/app/deploy/', {params: {id: text.id}}) .then(() => {