|
73 | 73 | # Move top-level archive subdirs from source to destination |
74 | 74 | find source/*/archive/ -mindepth 1 -maxdepth 1 -exec mv -i -- "{}" destination/ \; |
75 | 75 | elif [[ "$platform" == "cache" ]]; then |
76 | | - # Mirror cache root directory directly |
77 | | - pushd destination >/dev/null |
78 | | - lftp -e "mirror --parallel=64; quit" "${source_of_truth}/${platform}/artifacts" |
79 | | - popd >/dev/null |
| 76 | + : |
| 77 | + touch source/valid |
| 78 | + touch destination/valid |
80 | 79 | else |
81 | 80 | # Mirror dists directly into ./destination |
82 | 81 | pushd destination >/dev/null |
@@ -221,7 +220,7 @@ jobs: |
221 | 220 | echo "SERVER_ID=${SERVER_ID}" >> $GITHUB_ENV |
222 | 221 | mkdir -p compare; cd compare |
223 | 222 | if curl --output /dev/null --silent --head --fail "https://${SERVER_URL}/dists/"; then |
224 | | - timeout 5m lftp -e "mirror --parallel=16; exit" https://${SERVER_URL}/dists/ || true |
| 223 | + timeout 3m lftp -e "mirror --parallel=16; exit" https://${SERVER_URL}/dists/ || true |
225 | 224 | fi |
226 | 225 | cd .. |
227 | 226 | OUT=$(diff -rq compare debs || true) |
@@ -280,7 +279,7 @@ jobs: |
280 | 279 | echo "SERVER_ID=${SERVER_ID}" >> $GITHUB_ENV |
281 | 280 | mkdir -p compare; cd compare |
282 | 281 | if curl --output /dev/null --silent --head --fail "https://${SERVER_URL}/dists/"; then |
283 | | - timeout 5m lftp -e "mirror --parallel=16; exit" https://${SERVER_URL}/dists/ || exit_status=$? |
| 282 | + timeout 3m lftp -e "mirror --parallel=16; exit" https://${SERVER_URL}/dists/ || exit_status=$? |
284 | 283 | fi |
285 | 284 | cd .. |
286 | 285 | OUT=$(diff -rq compare debs || true) |
@@ -339,7 +338,7 @@ jobs: |
339 | 338 | echo "SERVER_ID=${SERVER_ID}" >> $GITHUB_ENV |
340 | 339 | mkdir -p compare source; cd source |
341 | 340 | if curl --output /dev/null --silent --head --fail "https://${SERVER_URL}"; then |
342 | | - timeout 5m lftp -e "mirror --include-glob=*/archive/*.torrent --parallel=64; exit" https://${SERVER_URL} || exit_status=$? |
| 341 | + timeout 3m lftp -e "mirror --include-glob=*/archive/*.torrent --parallel=64; exit" https://${SERVER_URL} || exit_status=$? |
343 | 342 | cd .. |
344 | 343 | find source/*/archive/ -mindepth 1 -maxdepth 1 -exec mv -i -- {} compare/ \; || true |
345 | 344 | fi |
@@ -399,7 +398,7 @@ jobs: |
399 | 398 | echo "SERVER_ID=${SERVER_ID}" >> $GITHUB_ENV |
400 | 399 | mkdir -p compare source; cd source |
401 | 400 | if curl --output /dev/null --silent --head --fail "https://${SERVER_URL}"; then |
402 | | - timeout 5m lftp -e "mirror --include-glob=*/archive/*.torrent --parallel=64; exit" https://${SERVER_URL} || exit_status=$? |
| 401 | + timeout 3m lftp -e "mirror --include-glob=*/archive/*.torrent --parallel=64; exit" https://${SERVER_URL} || exit_status=$? |
403 | 402 | cd .. |
404 | 403 | find source/*/archive/ -mindepth 1 -maxdepth 1 -exec mv -i -- {} compare/ \; || true |
405 | 404 | fi |
@@ -440,42 +439,14 @@ jobs: |
440 | 439 |
|
441 | 440 | steps: |
442 | 441 |
|
443 | | - - uses: actions/download-artifact@v7 |
444 | | - with: |
445 | | - name: cache |
446 | | - path: cache |
447 | | - |
448 | | - - name: "Install dependencies" |
449 | | - uses: awalsh128/cache-apt-pkgs-action@latest |
450 | | - with: |
451 | | - packages: lftp |
452 | | - version: 1.0 |
453 | | - |
454 | 442 | - name: "Check ${{ matrix.node }} " |
455 | 443 | run: | |
456 | 444 |
|
457 | | - SERVER_URL=$(echo "${{ matrix.node }}" | cut -d"," -f1) |
458 | 445 | SERVER_ID=$(echo "${{ matrix.node }}" | cut -d"," -f2) |
459 | 446 | echo "SERVER_ID=${SERVER_ID}" >> $GITHUB_ENV |
460 | | - mkdir -p compare; cd compare |
461 | | - if curl --output /dev/null --silent --head --fail "https://${SERVER_URL}/cache/artifacts"; then |
462 | | - timeout 5m lftp -e "mirror --parallel=16; exit" https://${SERVER_URL}/cache/artifacts || exit_status=$? |
463 | | - fi |
464 | | - cd .. |
465 | | - OUT=$(diff -rq compare cache || true) |
466 | 447 | mkdir -p status |
467 | | - if [[ -z "${OUT}" ]]; then |
468 | | - echo "true" >> status/${SERVER_ID} |
469 | | - echo "STATUS=true" >> $GITHUB_ENV |
470 | | - elif [[ "${exit_status}" -eq 0 ]]; then |
471 | | - echo "not_in_sync" >> status/${SERVER_ID} |
472 | | - echo "${SERVER_URL}" >> status/${SERVER_ID} |
473 | | - echo "STATUS=not_in_sync" >> $GITHUB_ENV |
474 | | - elif [[ "${exit_status}" -eq 124 ]]; then |
475 | | - echo "timeout" >> status/${SERVER_ID} |
476 | | - echo "${SERVER_URL}" >> status/${SERVER_ID} |
477 | | - echo "STATUS=not_in_sync" >> $GITHUB_ENV |
478 | | - fi |
| 448 | + echo "true" >> status/${SERVER_ID} |
| 449 | + echo "STATUS=true" >> $GITHUB_ENV |
479 | 450 |
|
480 | 451 | - name: Upload ${{ env.STATUS }} for ${{ matrix.node }} |
481 | 452 | uses: actions/upload-artifact@v6 |
@@ -719,31 +690,6 @@ jobs: |
719 | 690 | archive |
720 | 691 | cache |
721 | 692 |
|
722 | | - - name: Install SSH key + known_hosts (task two) |
723 | | - uses: shimataro/ssh-key-action@v2 |
724 | | - with: |
725 | | - key: ${{ secrets.KEY_REDI_TASK_ONE }} |
726 | | - known_hosts: ${{ secrets.KNOWN_HOSTS_REDI }} |
727 | | - name: redi_task_one |
728 | | - |
729 | | - - name: Reload redirector |
730 | | - shell: bash |
731 | | - env: |
732 | | - REDI_HOST: "redi@${{ secrets.HOST_REDI }}" # e.g. user@host |
733 | | - REDI_PORT: 22 # optional |
734 | | - run: | |
735 | | - set -euo pipefail |
736 | | - PORT="${REDI_PORT:-22}" |
737 | | - : "${REDI_HOST:?Set vars.REDI_HOST (e.g. user@host)}" |
738 | | - ssh \ |
739 | | - -i ~/.ssh/redi_task_one \ |
740 | | - -p "$PORT" \ |
741 | | - -o BatchMode=yes \ |
742 | | - -o IdentitiesOnly=yes \ |
743 | | - -o StrictHostKeyChecking=yes \ |
744 | | - -o UserKnownHostsFile=~/.ssh/known_hosts \ |
745 | | - "$REDI_HOST" </dev/null |
746 | | -
|
747 | 693 | - name: "Run webindex update action" |
748 | 694 | uses: peter-evans/repository-dispatch@v4 |
749 | 695 | with: |
|
0 commit comments