mirror of https://github.com/openspug/spug
F 修复常规发布缺少环境变量SPUG_GIT_BRANCH/SPUG_GIT_COMMIT_ID/SPUG_GIT_TAG
parent
9c7e77f506
commit
f384374db7
|
@ -75,6 +75,13 @@ def _ext1_deploy(req, helper, env):
|
||||||
req.repository = rep
|
req.repository = rep
|
||||||
extend = req.deploy.extend_obj
|
extend = req.deploy.extend_obj
|
||||||
env.update(SPUG_DST_DIR=extend.dst_dir)
|
env.update(SPUG_DST_DIR=extend.dst_dir)
|
||||||
|
extras = json.loads(req.extra)
|
||||||
|
if extras[0] == 'repository':
|
||||||
|
extras = extras[1:]
|
||||||
|
if extras[0] == 'branch':
|
||||||
|
env.update(SPUG_GIT_BRANCH=extras[1], SPUG_GIT_COMMIT_ID=extras[2])
|
||||||
|
else:
|
||||||
|
env.update(SPUG_GIT_TAG=extras[1])
|
||||||
if req.deploy.is_parallel:
|
if req.deploy.is_parallel:
|
||||||
threads, latest_exception = [], None
|
threads, latest_exception = [], None
|
||||||
max_workers = max(10, os.cpu_count() * 5)
|
max_workers = max(10, os.cpu_count() * 5)
|
||||||
|
|
|
@ -245,6 +245,7 @@ def post_request_ext1(request):
|
||||||
form.repository_id = repository.id
|
form.repository_id = repository.id
|
||||||
form.version = repository.version
|
form.version = repository.version
|
||||||
form.spug_version = repository.spug_version
|
form.spug_version = repository.spug_version
|
||||||
|
form.extra = ['repository'] + json.loads(repository.extra)
|
||||||
else:
|
else:
|
||||||
return json_response(error='参数错误')
|
return json_response(error='参数错误')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue