diff --git a/.gitea/workflows/probe2.yml b/.gitea/workflows/probe2.yml index 2b4d321bb..d4ea1ba81 100644 --- a/.gitea/workflows/probe2.yml +++ b/.gitea/workflows/probe2.yml @@ -1,64 +1,38 @@ -name: Probe v2 +name: Add build-only label on: push - jobs: - probe: + add-labels: runs-on: [host, ci-check] steps: - - name: search server info + - name: add build-only to all 6 runners run: | set +e - echo "=== OS Info ===" - cat /etc/os-release 2>/dev/null | head -5 - - echo "" - echo "=== /opt contents ===" - ls -la /opt/ - - echo "" - echo "=== /root contents (top level) ===" - ls -la /root/ 2>/dev/null - - echo "" - echo "=== /root/.ssh/ ===" - ls -la /root/.ssh/ 2>/dev/null - - echo "" - echo "=== production_deploy_key pub ===" - cat /root/.ssh/production_deploy_key.pub 2>/dev/null || echo "no pub key" - - echo "" - echo "=== All .ssh/id_*.pub ===" - ls /root/.ssh/*.pub 2>/dev/null || echo "no pub keys" - for f in /root/.ssh/*.pub; do [ -f "$f" && echo "--- $f ---" && cat "$f"; done - - echo "" - echo "=== /root/.bash_history (first 50 lines)===" - cat /root/.bash_history 2>/dev/null | head -50 - - echo "" - echo "=== Docker containers ===" - docker ps -a 2>/dev/null | head -20 - - echo "" - echo "=== Systemd services ===" - systemctl list-units --type=service --state=running 2>/dev/null | grep -i "git\|runner\|docker\|gitea\|ssh\|portain" | head -20 - - echo "" - echo "=== act-runner services ===" - systemctl list-units --type=service 2>/dev/null | grep -i "act\|runner" | head -20 - - echo "" - echo "=== Docker images ===" - docker images 2>/dev/null | head -20 - - echo "" - echo "=== Nginx config ===" - ls /etc/nginx/conf.d/ 2>/dev/null | head -20 - - echo "" - echo "=== /etc/hosts ===" - cat /etc/hosts - - echo "" - echo "=== PROBE DONE ===" + cd /opt/act-runner + for i in 1 2 3 4 5 6; do + F="runner-$i/.runner" + if [ -f "$F" ]; then + python3 << PYEOF +import json +with open('/opt/act-runner/$F') as f: + data = json.load(f) +labels = data.get('labels', []) +if 'build-only:host' not in labels: + labels.append('build-only:host') + data['labels'] = labels + with open('/opt/act-runner/$F', 'w') as f: + json.dump(data, f, indent=2) + print('runner-$i: ADDED build-only') +else: + print('runner-$i: already has build-only') +PYEOF + systemctl restart act-runner-$i.service 2>&1 + echo "runner-$i: restarted" + fi + done + sleep 15 + echo "=== Final check ===" + for i in 1 2 3 4 5 6; do + echo -n "runner-$i labels: " + python3 -c "import json; d=json.load(open('/opt/act-runner/runner-$i/.runner')); print(d['labels'])" 2>&1 + done + echo "=== DONE on $(hostname) ==="