mirror of https://github.com/openspug/spug
add module
parent
42ac74ff1c
commit
ae5f65579a
|
@ -45,7 +45,7 @@ class DeployRequest(models.Model, ModelMixin):
|
||||||
approve_by = models.ForeignKey(User, models.PROTECT, related_name='+', null=True)
|
approve_by = models.ForeignKey(User, models.PROTECT, related_name='+', null=True)
|
||||||
do_at = models.CharField(max_length=20, null=True)
|
do_at = models.CharField(max_length=20, null=True)
|
||||||
do_by = models.ForeignKey(User, models.PROTECT, related_name='+', null=True)
|
do_by = models.ForeignKey(User, models.PROTECT, related_name='+', null=True)
|
||||||
|
module = models.CharField(max_length=255, null=True)
|
||||||
@property
|
@property
|
||||||
def is_quick_deploy(self):
|
def is_quick_deploy(self):
|
||||||
if self.type in ('1', '3') and self.deploy.extend == '1' and self.extra:
|
if self.type in ('1', '3') and self.deploy.extend == '1' and self.extra:
|
||||||
|
|
|
@ -47,6 +47,7 @@ def dispatch(req, fail_mode=False):
|
||||||
SPUG_DEPLOY_TYPE=req.type,
|
SPUG_DEPLOY_TYPE=req.type,
|
||||||
SPUG_API_TOKEN=api_token,
|
SPUG_API_TOKEN=api_token,
|
||||||
SPUG_REPOS_DIR=REPOS_DIR,
|
SPUG_REPOS_DIR=REPOS_DIR,
|
||||||
|
SPUG_MODULE=req.module,
|
||||||
)
|
)
|
||||||
# append configs
|
# append configs
|
||||||
configs = compose_configs(req.deploy.app, req.deploy.env_id)
|
configs = compose_configs(req.deploy.app, req.deploy.env_id)
|
||||||
|
|
|
@ -211,6 +211,7 @@ def post_request_ext1(request):
|
||||||
Argument('type', default='1'),
|
Argument('type', default='1'),
|
||||||
Argument('plan', required=False),
|
Argument('plan', required=False),
|
||||||
Argument('desc', required=False),
|
Argument('desc', required=False),
|
||||||
|
Argument('module', required=False),
|
||||||
).parse(request.body)
|
).parse(request.body)
|
||||||
if error is None:
|
if error is None:
|
||||||
deploy = Deploy.objects.get(pk=form.deploy_id)
|
deploy = Deploy.objects.get(pk=form.deploy_id)
|
||||||
|
@ -293,6 +294,7 @@ def post_request_ext2(request):
|
||||||
Argument('type', default='1'),
|
Argument('type', default='1'),
|
||||||
Argument('plan', required=False),
|
Argument('plan', required=False),
|
||||||
Argument('desc', required=False),
|
Argument('desc', required=False),
|
||||||
|
Argument('module', required=False),
|
||||||
).parse(request.body)
|
).parse(request.body)
|
||||||
if error is None:
|
if error is None:
|
||||||
deploy = Deploy.objects.filter(pk=form.deploy_id).first()
|
deploy = Deploy.objects.filter(pk=form.deploy_id).first()
|
||||||
|
|
|
@ -231,7 +231,7 @@ export default observer(function () {
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
)}
|
)}
|
||||||
{module && (
|
{module && (
|
||||||
<Form.Item required name="module1" label="模块选择" tooltip="会覆盖SPUG_RELEASE的值">
|
<Form.Item required name="module1" label="模块选择" tooltip="使用SPUG_MODULE">
|
||||||
<Checkbox.Group options={module_list}></Checkbox.Group>
|
<Checkbox.Group options={module_list}></Checkbox.Group>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -96,7 +96,7 @@ export default observer(function () {
|
||||||
<Input placeholder="请输入环境变量 SPUG_RELEASE 的值"/>
|
<Input placeholder="请输入环境变量 SPUG_RELEASE 的值"/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
{module && (
|
{module && (
|
||||||
<Form.Item required name="module1" label="模块选择" tooltip="会覆盖SPUG_RELEASE的值">
|
<Form.Item required name="module1" label="模块选择" tooltip="使用SPUG_MODULE">
|
||||||
<Checkbox.Group options={module_list}></Checkbox.Group>
|
<Checkbox.Group options={module_list}></Checkbox.Group>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
)}
|
)}
|
||||||
|
|
Loading…
Reference in New Issue