clone

a personal forge on plain git: static pages, stacked-diff reviews, signed local ci, repo sites and releases

main
forge / test / scenarios / mirror-excluded.sh
mirror-excluded.sh 1.6K
1# The offline copy leaves out the pages there is one of per file: file2# pages, directory pages below a branch's top level, and images no page in3# the copy shows. They aren't uploaded, and those a sync from before put in4# the bucket are deleted by the next one, once. Release downloads in the5# bucket are their own pass's, and stay.6. "$(dirname "$0")/../lib.sh"7user dami8repo dami/greet9clone dami dami/greet "$T/w/d"10mkdir -p "$T/w/d/lib" "$T/w/d/img"11printf 'PNG1' >"$T/w/d/img/pic.png"12printf 'PNG2' >"$T/w/d/img/other.png"13printf '# greet\n\n![a picture](img/pic.png)\n' >"$T/w/d/README.md"14printf 'x\n' >"$T/w/d/lib/x.txt"15at "$T/w/d" git add -A16at "$T/w/d" git commit -qm first17ok push_as dami "$T/w/d" origin main18build19fake_rclone20# What an older sync left there.21g=$T/bucket/dami/greet22mkdir -p "$g/blob/main/lib/x.txt" "$g/tree/main/lib" "$g/raw/main/img" "$g/releases/download/v1"23echo old >"$g/blob/main/lib/x.txt/index.html"24echo old >"$g/tree/main/lib/index.html"25echo old >"$g/raw/main/img/other.png"26echo old >"$g/releases/download/v1/greet"27ok forge mirror28lacks "$T/rclone.put" '/blob/|/tree/main/(lib|img)/|other\.png'29missing "$g/blob"30missing "$g/tree/main/lib"31missing "$g/raw/main/img/other.png"32eq "$(LC_ALL=C sort "$T/rclone.deleted" | tr '\n' ' ')" "dami/greet/blob/main/lib/x.txt/index.html dami/greet/raw/main/img/other.png dami/greet/tree/main/lib/index.html "33exists "$g/releases/download/v1/greet"34# The next sync has nothing to delete.35: >"$T/rclone.log"36ok forge mirror37lacks "$T/rclone.log" '^delete '38eq "$(wc -l <"$T/rclone.deleted" | tr -d ' ')" 3