|
| 1 | +#!/bin/bash |
| 2 | +PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin |
| 3 | +FROMMAIL= "Compose Tracker <[email protected]>" |
| 4 | +export RLVER=9 |
| 5 | +source "/root/toolkit/sync/common" |
| 6 | +rm -rf /etc/pungi-prod-9 |
| 7 | +git clone https://git.rockylinux.org/rocky/pungi-rocky.git -b "r${REVISION}" /etc/pungi-prod-9 |
| 8 | +rm -rf /mnt/compose/9_metadata |
| 9 | +git clone https://git.rockylinux.org/rocky/rocky-module-metadata.git -b r9 /mnt/compose/9_metadata |
| 10 | +ret_val=$? |
| 11 | +if [ "$ret_val" -ne 0 ]; then |
| 12 | + echo "Git pull failed for prod pungi config" | mutt -e "set from=\"$FROMMAIL\"" \ |
| 13 | + -e 'set envelope_from=yes' \ |
| 14 | + -s "Git pull on /etc/pungi-prod failed" \ |
| 15 | + |
| 16 | + exit 1 |
| 17 | +fi |
| 18 | +pushd /etc/pungi-prod-9/scripts || { echo "Cron: Failed to change directory"; exit 1; } |
| 19 | +bash updates-9-full.sh |
| 20 | +ret_val=$? |
| 21 | +popd || { echo "Cron: Could not change back to original directory"; exit 1; } |
| 22 | + |
| 23 | +if [ "$ret_val" -eq 0 ]; then |
| 24 | + pushd /root/toolkit/sync || { echo "Cron: Failed to change directory"; exit 1; } |
| 25 | + RLVER=9 bash sync-to-staging.sh Rocky-devel |
| 26 | + RLVER=9 bash sync-to-staging.sh Extras |
| 27 | + RLVER=9 bash sync-to-staging.sh Rocky |
| 28 | + popd || { echo "Cron: Could not change back to original directory"; exit 1; } |
| 29 | + |
| 30 | + pushd /mnt/repos-staging/mirror/pub/rocky/${REVISION} || { echo "Cron: Directory doesn't exist"; exit 1; } |
| 31 | + python3 /usr/local/bin/apollo_tree -p $(pwd) \ |
| 32 | + -n "Rocky Linux ${REVISION} \$arch" \ |
| 33 | + -i extras \ |
| 34 | + -i images \ |
| 35 | + -i isos \ |
| 36 | + -i live \ |
| 37 | + -i metadata \ |
| 38 | + -i plus \ |
| 39 | + -i devel \ |
| 40 | + -i SAP \ |
| 41 | + -i SAPHANA |
| 42 | + popd || { echo "Cron: Could not change back to original directory"; exit 1; } |
| 43 | + |
| 44 | + pushd /root/toolkit/sync || { echo "Cron: Failed to change directory"; exit 1; } |
| 45 | + RLVER=9 bash sign-repos-only.sh |
| 46 | + popd || { echo "Cron: Could not change back to original directory"; exit 1; } |
| 47 | +fi |
0 commit comments