raz / commit a6364e30

commit
a6364e30d811eeb59a82cd1cf7ce2d3446a8ef94
author
Luis <42945842+ldiaz94@users.noreply.github.com>
date
parent
fe3051dc
boot.sh: BOOT's tarball from site/public/download/ first, the website last, so a deploy that builds raz needs no access to GitHub

patch · log

1 file changed, +12 -5

src/boot.sh (history) modified +12 -5

@@ -7,11 +7,14 @@
77 # raz can always be built again from source alone.
88 #
99 # The tarball is taken from build/boot/ if it is there; else from the
10-# GitHub release, by curl, or by gh's REST API where the repository is
11-# private and gh has a token; a machine with no network has it put
12-# there by hand. Its raz goes to build/boot/raz, with this repository's
13-# lib/ beside it, since src/ is built against today's library. Run from
14-# the repository root, by make.
10+# website's downloads in this checkout, site/public/download/, where
11+# every release is kept; else from the GitHub release, by curl, or by
12+# gh's REST API where the repository is private and gh has a token; else
13+# from the website, which serves the same bytes. A machine with no
14+# network and no site/public has it put there by hand. The sum is
15+# checked whichever it came from. Its raz goes to build/boot/raz, with
16+# this repository's lib/ beside it, since src/ is built against today's
17+# library. Run from the repository root, by make.
1518 set -e
1619 read tag sum < BOOT
1720 v=${tag#v}
@@ -19,11 +22,15 @@
1922 d=build/boot
2023 repo=ldiaz94/raz
2124 mkdir -p $d
25+if [ ! -f $d/$t ] && [ -f site/public/download/$t ]; then
26+ cp site/public/download/$t $d/$t
27+fi
2228 if [ ! -f $d/$t ]; then
2329 if ! curl -fsSL -o $d/$t https://github.com/$repo/releases/download/$tag/$t 2>/dev/null; then
2430 id=$(gh api repos/$repo/releases/tags/$tag --jq ".assets[] | select(.name == \"$t\") | .id" 2>/dev/null) &&
2531 [ -n "$id" ] &&
2632 gh api -H 'Accept: application/octet-stream' repos/$repo/releases/assets/$id >$d/$t 2>/dev/null ||
33+ curl -fsSL -o $d/$t https://raz.lucelad.workers.dev/download/$t 2>/dev/null ||
2734 { rm -f $d/$t; echo "boot: can't fetch $t; put it in $d" >&2; exit 1; }
2835 fi
2936 fi