-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_server.py
More file actions
35 lines (26 loc) · 912 Bytes
/
Copy pathstart_server.py
File metadata and controls
35 lines (26 loc) · 912 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python3
import threading
import time
from core.webhook_listener import WebhookListener
from core.executor import PipelineExecutor
from shared_queue import job_queue
def start_full_server():
print("Starting CI/CD Pipeline Server...")
# Start webhook listener in background
def webhook_worker():
listener = WebhookListener(job_queue)
listener.start()
webhook_thread = threading.Thread(target=webhook_worker, daemon=True)
webhook_thread.start()
print("Webhook listener: http://localhost:8080/webhook")
# Wait for webhook to start
time.sleep(2)
# Start executor in main thread
print("Starting job executor...")
executor = PipelineExecutor(job_queue)
try:
executor.run_worker()
except KeyboardInterrupt:
print("\nServer stopped!")
if __name__ == "__main__":
start_full_server()