A 新增发布全局变量SPUG_GIT_BRANCH/SPUG_GIT_TAG/SPUG_GIT_COMMIT_ID

pull/137/head
vapao 2020-06-09 11:16:32 +08:00
parent 98f3fdf57d
commit fcfc87603d
1 changed files with 3 additions and 3 deletions

View File

@ -56,10 +56,10 @@ def _ext1_deploy(req, helper, env):
extras = json.loads(req.extra) extras = json.loads(req.extra)
if extras[0] == 'branch': if extras[0] == 'branch':
tree_ish = extras[2] tree_ish = extras[2]
env.update(SPUG_BRANCH=extras[1], SPUG_COMMIT_ID=extras[2]) env.update(SPUG_GIT_BRANCH=extras[1], SPUG_GIT_COMMIT_ID=extras[2])
else: else:
tree_ish = extras[1] tree_ish = extras[1]
env.update(SPUG_TAG=extras[1]) env.update(SPUG_GIT_TAG=extras[1])
if req.type == '2': if req.type == '2':
helper.send_step('local', 6, f'完成\r\n{human_time()} 回滚发布... 跳过') helper.send_step('local', 6, f'完成\r\n{human_time()} 回滚发布... 跳过')
else: else:
@ -291,7 +291,7 @@ class Helper:
def local(self, command, env=None): def local(self, command, env=None):
if env: if env:
env = os.environ.copy().update(env) env.update(os.environ)
command = 'set -e\n' + command command = 'set -e\n' + command
task = subprocess.Popen(command, env=env, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) task = subprocess.Popen(command, env=env, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
while True: while True: