diff --git a/spug_api/apps/app/models.py b/spug_api/apps/app/models.py index 938f369..4d61a1d 100644 --- a/spug_api/apps/app/models.py +++ b/spug_api/apps/app/models.py @@ -42,8 +42,8 @@ class Deploy(models.Model, ModelMixin): host_ids = models.TextField() extend = models.CharField(max_length=2, choices=EXTENDS) is_audit = models.BooleanField() + is_parallel = models.BooleanField(default=True) rst_notify = models.CharField(max_length=255, null=True) - created_at = models.CharField(max_length=20, default=human_datetime) created_by = models.ForeignKey(User, models.PROTECT, related_name='+') updated_at = models.CharField(max_length=20, null=True) diff --git a/spug_api/apps/app/views.py b/spug_api/apps/app/views.py index f813ddc..0a51643 100644 --- a/spug_api/apps/app/views.py +++ b/spug_api/apps/app/views.py @@ -7,7 +7,7 @@ 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 +from apps.app.utils import fetch_versions, remove_repo import subprocess import json import os @@ -108,6 +108,7 @@ class DeployView(View): Argument('host_ids', type=list, filter=lambda x: len(x), help='请选择要部署的主机'), Argument('rst_notify', type=dict, help='请选择发布结果通知方式'), Argument('extend', filter=lambda x: x in dict(Deploy.EXTENDS), help='请选择发布类型'), + Argument('is_parallel', type=bool, default=True), Argument('is_audit', type=bool, default=False) ).parse(request.body) if error is None: diff --git a/spug_web/src/pages/deploy/app/Ext1Setup1.js b/spug_web/src/pages/deploy/app/Ext1Setup1.js index e4bd4cb..4909ed0 100644 --- a/spug_web/src/pages/deploy/app/Ext1Setup1.js +++ b/spug_web/src/pages/deploy/app/Ext1Setup1.js @@ -6,7 +6,7 @@ import React, { useEffect, useState } from 'react'; import { observer } from 'mobx-react'; import { Link } from 'react-router-dom'; -import { Switch, Form, Input, Select, Button } from 'antd'; +import { Switch, Form, Input, Select, Button, Radio } from 'antd'; import envStore from 'pages/config/environment/store'; import Selector from 'pages/host/Selector'; import store from './store'; @@ -50,6 +50,12 @@ export default observer(function Ext1Setup1() { info['git_repo'] = e.target.value} placeholder="请输入Git仓库地址"/> + + info.is_parallel = e.target.value}> + 并行 + 串行 + + 新建环境 + + info.is_parallel = e.target.value}> + 并行 + 串行 + +