diff --git a/.gitea/workflows/probe-8443-v2.yml b/.gitea/workflows/probe-8443-v2.yml index a1afd8fa9..5fd1b8128 100644 --- a/.gitea/workflows/probe-8443-v2.yml +++ b/.gitea/workflows/probe-8443-v2.yml @@ -1,18 +1,19 @@ -name: Fast add build-only +name: Add build-all on: push jobs: - add: + add-all: runs-on: [host, ci-check] steps: - - name: add build-only label + - name: add build-only to all run: | python3 << 'PYEOF' - import json, os, subprocess + import json, os, subprocess, time + added = [] + existed = [] for i in range(1, 7): - f = f'/opt/act-runner/runner-{i}/runner' f = f'/opt/act-runner/runner-{i}/.runner' if not os.path.exists(f): - print(f'runner-{i}: file not found') + print(f'runner-{i}: NOT FOUND') continue with open(f) as fh: data = json.load(fh) @@ -22,13 +23,17 @@ jobs: data['labels'] = labels with open(f, 'w') as fh: json.dump(data, fh, indent=2) - print(f'runner-{i}: ADDED') + added.append(i) + print(f'runner-{i}: ADDED build-only') else: - print(f'runner-{i}: already has') - subprocess.run(['systemctl', 'restart', f'act-runner-{i}.service']) - print(f'runner-{i}: restarted') - import time - time.sleep(15) + existed.append(i) + print(f'runner-{i}: already has build-only') + print(f'Added: {added}') + print(f'Already existed: {existed}') + # 重启所有改动过的和已有的,确保都用新配置 + for i in range(1, 7): + subprocess.run(['systemctl', 'restart', f'act-runner-{i}.service'], capture_output=True) + print(f'runner-{i}: restart command sent') + time.sleep(20) print('DONE') PYEOF - echo "Script exit code: $?"