mirror of https://github.com/openspug/spug
F 修复自动发布常规发布异常问题
parent
9b174532f1
commit
69d5bf74e5
|
@ -70,25 +70,15 @@ def _deploy_extend_1(deploy, ref, commit_id=None):
|
||||||
else:
|
else:
|
||||||
extra = ['tag', ref, None]
|
extra = ['tag', ref, None]
|
||||||
version = ref
|
version = ref
|
||||||
rep = Repository.objects.create(
|
|
||||||
deploy=deploy,
|
|
||||||
app_id=deploy.app_id,
|
|
||||||
env_id=deploy.env_id,
|
|
||||||
version=version,
|
|
||||||
status='1',
|
|
||||||
extra=json.dumps(extra),
|
|
||||||
spug_version=Repository.make_spug_version(deploy.id),
|
|
||||||
created_by=deploy.created_by)
|
|
||||||
rep = build_dispatch(rep)
|
|
||||||
if rep.status == '5':
|
|
||||||
req = DeployRequest.objects.create(
|
req = DeployRequest.objects.create(
|
||||||
type='3',
|
type='3',
|
||||||
status='0' if deploy.is_audit else '2',
|
status='0' if deploy.is_audit else '2',
|
||||||
deploy=deploy,
|
deploy=deploy,
|
||||||
repository=rep,
|
name=version,
|
||||||
name=rep.version,
|
extra=json.dumps(extra),
|
||||||
version=rep.version,
|
version=version,
|
||||||
spug_version=rep.spug_version,
|
spug_version=Repository.make_spug_version(deploy.id),
|
||||||
host_ids=deploy.host_ids,
|
host_ids=deploy.host_ids,
|
||||||
created_by=deploy.created_by
|
created_by=deploy.created_by
|
||||||
)
|
)
|
||||||
|
|
|
@ -47,7 +47,7 @@ class DeployRequest(models.Model, ModelMixin):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_quick_deploy(self):
|
def is_quick_deploy(self):
|
||||||
if self.type == '1' and self.deploy.extend == '1' and self.extra:
|
if self.type in ('1', '3') and self.deploy.extend == '1' and self.extra:
|
||||||
extra = json.loads(self.extra)
|
extra = json.loads(self.extra)
|
||||||
return extra[0] in ('branch', 'tag')
|
return extra[0] in ('branch', 'tag')
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Reference in New Issue