2023-02-01 00:42:25 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2023-01-31 01:49:55 +03:00
|
|
|
# this script globs a folder of files, then subsequently uploads the
|
|
|
|
# glob to bootstrap.urbit.org and replaces the hash in the docket file.
|
|
|
|
# assumes gcloud credentials are loaded and gsutil installed.
|
|
|
|
|
|
|
|
# $1: the folder of files to glob
|
|
|
|
# $2: the location of the docket file
|
|
|
|
|
|
|
|
# globber is a prebooted and docked fakezod
|
2023-02-01 02:12:22 +03:00
|
|
|
curl https://bootstrap.urbit.org/globberv2.tgz | tar xzk
|
2023-01-31 01:49:55 +03:00
|
|
|
./zod/.run -d
|
|
|
|
|
|
|
|
dojo () {
|
2023-02-01 01:41:38 +03:00
|
|
|
curl -s --data '{"source":{"dojo":"'"$1"'"},"sink":{"stdout":null}}' http://localhost:12321
|
2023-01-31 01:49:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
hood () {
|
2023-02-01 01:41:38 +03:00
|
|
|
curl -s --data '{"source":{"dojo":"+hood/'"$1"'"},"sink":{"app":"hood"}}' http://localhost:12321
|
2023-01-31 01:49:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
rsync -avL $1 zod/work/glob
|
|
|
|
hood "commit %work"
|
|
|
|
dojo "-garden!make-glob %work /glob"
|
|
|
|
|
|
|
|
gsutil cp zod/.urb/put/*.glob gs://bootstrap.urbit.org
|
2023-02-01 02:58:58 +03:00
|
|
|
hash=$(ls -1 -c zod/.urb/put | head -1 | sed "s/glob-\([a-z0-9\.]*\).glob/\1/")
|
2023-02-01 03:45:56 +03:00
|
|
|
cat $2
|
|
|
|
sed --debug -i "s/glob\-[a-z0-9\.]*glob' *[a-z0-9\.]*\]/glob-$hash.glob' $hash]/g" $2
|
|
|
|
cat $2
|
2023-01-31 01:49:55 +03:00
|
|
|
|
2023-02-01 03:08:12 +03:00
|
|
|
echo "hash=$(echo $hash)" >> $GITHUB_OUTPUT
|
|
|
|
|
2023-01-31 01:49:55 +03:00
|
|
|
hood "exit"
|
2023-02-01 03:08:12 +03:00
|
|
|
sleep 5s
|
2023-02-01 02:16:57 +03:00
|
|
|
rm -rf zod
|