diff --git a/spug_api/apps/deploy/models.py b/spug_api/apps/deploy/models.py
index e6f3a8e..2cd7ed0 100644
--- a/spug_api/apps/deploy/models.py
+++ b/spug_api/apps/deploy/models.py
@@ -47,7 +47,7 @@ class DeployRequest(models.Model, ModelMixin):
@property
def is_quick_deploy(self):
- if self.extra:
+ if self.deploy.extend == '1' and self.extra:
extra = json.loads(self.extra)
return extra[0] in ('branch', 'tag')
return False
diff --git a/spug_api/apps/deploy/utils.py b/spug_api/apps/deploy/utils.py
index 8bdf77f..3d1b9d9 100644
--- a/spug_api/apps/deploy/utils.py
+++ b/spug_api/apps/deploy/utils.py
@@ -181,7 +181,7 @@ def _deploy_ext1_host(req, helper, h_id, env):
try:
ssh.put_file(os.path.join(REPOS_DIR, 'build', tar_gz_file), os.path.join(extend.dst_repo, tar_gz_file))
except Exception as e:
- helper.send_error(host.id, f'exception: {e}')
+ helper.send_error(host.id, f'Exception: {e}')
command = f'cd {extend.dst_repo} && rm -rf {req.spug_version} && tar xf {tar_gz_file} && rm -f {req.deploy_id}_*.tar.gz'
helper.remote_raw(host.id, ssh, command)
@@ -222,7 +222,7 @@ def _deploy_ext2_host(helper, h_id, actions, env, spug_version):
try:
ssh.put_file(os.path.join(REPOS_DIR, env.SPUG_DEPLOY_ID, spug_version), action['dst'])
except Exception as e:
- helper.send_error(host.id, f'exception: {e}')
+ helper.send_error(host.id, f'Exception: {e}')
helper.send_info(host.id, 'transfer completed\r\n')
continue
else:
@@ -231,7 +231,7 @@ def _deploy_ext2_host(helper, h_id, actions, env, spug_version):
try:
ssh.put_file(os.path.join(sp_dir, tar_gz_file), f'/tmp/{tar_gz_file}')
except Exception as e:
- helper.send_error(host.id, f'exception: {e}')
+ helper.send_error(host.id, f'Exception: {e}')
command = f'mkdir -p /tmp/{spug_version} && tar xf /tmp/{tar_gz_file} -C /tmp/{spug_version}/ '
command += f'&& rm -rf {action["dst"]} && mv /tmp/{spug_version}/{sd_dst} {action["dst"]} '
diff --git a/spug_api/apps/repository/utils.py b/spug_api/apps/repository/utils.py
index aa318e6..4320911 100644
--- a/spug_api/apps/repository/utils.py
+++ b/spug_api/apps/repository/utils.py
@@ -104,6 +104,6 @@ def _build(rep: Repository, helper, env):
exclude = ' '.join(excludes)
else:
contain = ' '.join(f'{rep.spug_version}/{x}' for x in files)
- helper.local(f'cd {REPOS_DIR} && tar zcf {tar_file} {exclude} {contain}')
+ helper.local(f'mkdir -p {BUILD_DIR} && cd {REPOS_DIR} && tar zcf {tar_file} {exclude} {contain}')
helper.send_step('local', 5, f'\033[32m完成√\033[0m')
helper.send_step('local', 100, f'\r\n\r\n{human_time()} ** \033[32m构建成功\033[0m **')
diff --git a/spug_web/src/pages/deploy/repository/Console.js b/spug_web/src/pages/deploy/repository/Console.js
index bf953b1..0863c81 100644
--- a/spug_web/src/pages/deploy/repository/Console.js
+++ b/spug_web/src/pages/deploy/repository/Console.js
@@ -55,6 +55,11 @@ export default observer(function Console() {
if (status !== undefined) setStatus(status);
}
}
+ socket.onerror = () => {
+ setStatus('error')
+ term.reset()
+ term.write('\u001b[31mWebsocket connection failed!\u001b[0m')
+ }
return socket
}
diff --git a/spug_web/src/pages/deploy/repository/Table.js b/spug_web/src/pages/deploy/repository/Table.js
index 0c02603..1faa30e 100644
--- a/spug_web/src/pages/deploy/repository/Table.js
+++ b/spug_web/src/pages/deploy/repository/Table.js
@@ -51,6 +51,7 @@ function ComTable() {
handleRebuild(info)}>构建
store.showConsole(info)}>日志
diff --git a/spug_web/src/pages/deploy/request/Ext1Console.js b/spug_web/src/pages/deploy/request/Ext1Console.js
index 79ad198..4e5117b 100644
--- a/spug_web/src/pages/deploy/request/Ext1Console.js
+++ b/spug_web/src/pages/deploy/request/Ext1Console.js
@@ -63,6 +63,16 @@ function Ext1Console(props) {
if (status !== undefined) outputs[key].status = status;
}
}
+ socket.onerror = () => {
+ for (let key of Object.keys(outputs)) {
+ outputs[key]['status'] = 'error'
+ outputs[key].data = '\u001b[31mWebsocket connection failed!\u001b[0m'
+ if (terms[key]) {
+ terms[key].reset()
+ terms[key].write('\u001b[31mWebsocket connection failed!\u001b[0m')
+ }
+ }
+ }
return socket
}
diff --git a/spug_web/src/pages/deploy/request/Ext2Console.js b/spug_web/src/pages/deploy/request/Ext2Console.js
index 30cac51..f4f7b8f 100644
--- a/spug_web/src/pages/deploy/request/Ext2Console.js
+++ b/spug_web/src/pages/deploy/request/Ext2Console.js
@@ -68,6 +68,16 @@ function Ext2Console(props) {
if (status !== undefined) outputs[key].status = status;
}
}
+ socket.onerror = () => {
+ for (let key of Object.keys(outputs)) {
+ outputs[key]['status'] = 'error'
+ outputs[key].data = '\u001b[31mWebsocket connection failed!\u001b[0m'
+ if (terms[key]) {
+ terms[key].reset()
+ terms[key].write('\u001b[31mWebsocket connection failed!\u001b[0m')
+ }
+ }
+ }
return socket
}
diff --git a/spug_web/src/pages/exec/task/ExecConsole.js b/spug_web/src/pages/exec/task/ExecConsole.js
index 54cfa7f..0a87201 100644
--- a/spug_web/src/pages/exec/task/ExecConsole.js
+++ b/spug_web/src/pages/exec/task/ExecConsole.js
@@ -60,9 +60,9 @@ class ExecConsole extends React.Component {
for (let key of Object.keys(store.outputs)) {
store.outputs[key]['status'] = 'websocket error'
if (this.terms[key]) {
- this.terms[key].write('Websocket connection failed!')
+ this.terms[key].write('\u001b[31mWebsocket connection failed!\u001b[0m')
} else {
- this.outputs[key] = 'Websocket connection failed!'
+ this.outputs[key] = '\u001b[31mWebsocket connection failed!\u001b[0m'
}
}
}