Some improvements

Main pre
This commit is contained in:
2025-08-22 11:52:56 +02:00
committed by GitHub
5 changed files with 10 additions and 13 deletions
+5 -3
View File
@@ -112,7 +112,7 @@ class EnvironmentNamespace(Namespace):
for e, _ in environments:
if e.id == data.get('id'):
e.branches = data.get('branches', e.branches)
logger.info(f"Updated environment {e.id} state to {e.state} and branches to {e.branches}")
logger.info(f"Updated environment {e.id} branches to {e.branches}")
environment_update_event.set()
emit('environments', get_envs_to_emit(), namespace='/ws/environment')
@@ -175,8 +175,9 @@ if __name__ == '__main__':
if not branch_name.startswith('auto/'): # Skip auto branches
new_branches.append(branch_name)
branches [env.id]= new_branches
branches[env.id]= new_branches
logger.info(f"Fetched {env.id}: {len (new_branches)} branches")
environment_update_event.set()
except BaseException as e:
socketio.emit('error', {'message': e}, namespace='/ws/errors')
while True:
@@ -198,6 +199,7 @@ if __name__ == '__main__':
except Exception as e:
logger.error(f"Error emitting environments: {str(e)}")
with state_lock:
logger.error(f"Processing")
processing.process_all_jobs(environments, lambda: emit_envs())
environment_update_event.wait(timeout=1*60)
environment_update_event.clear()
@@ -211,4 +213,4 @@ if __name__ == '__main__':
processing.join()
refresh_thread.join()
else:
socketio.run(app, host='0.0.0.0', port=5002, debug=False, allow_unsafe_werkzeug=True)
socketio.run(app, host='0.0.0.0', port=5001, debug=False, allow_unsafe_werkzeug=True)
+1 -1
View File
@@ -7,7 +7,7 @@ from steps.step import AbstractStep
env = Environment(
id="brencher",
branches=["main"],
branches=["main", "main_pre"],
dry=False,
repo="https://github.com/rudolf1/brencher.git",
)
+2
View File
@@ -12,7 +12,9 @@ def process_all_jobs(
for env, pipe in environemnts:
for step in pipe:
try:
step._result = None
step.result
except BaseException as e:
error_msg = f"Error processing release {env.id}, job {step.name}: {str(e)}"
logger.error(error_msg)
+1 -1
View File
@@ -107,7 +107,7 @@ class DockerSwarmCheck(AbstractStep[Dict[str, DockerSwarmCheckResult]]):
attrs = client.services.get(svc.id).attrs
name = attrs["Spec"]["Name"].replace(self.stack_name + "_", "")
if attrs["Spec"]["Labels"].get("com.docker.stack.namespace", "") == self.stack_name:
logger.info(f"Service {svc.name} is running with image {attrs}")
# logger.info(f"Service {svc.name} is running with image {attrs}")
current_services[name] = DockerSwarmCheckResult(
name = name,
image = attrs["Spec"]["Labels"].get("com.docker.stack.image", ""),
+1 -8
View File
@@ -36,14 +36,7 @@
<button id="create-release" class="primary-button">Create Release</button>
</div>
</div>
<div class="releases-section">
<h2>Releases</h2>
<div id="releases-list" class="releases-list">
<p class="loading">Loading releases...</p>
</div>
</div>
<div class="jobs-section">
<h2>Jobs</h2>
<div id="jobs-list" class="jobs-list">