From c4b392a179048f936c062f5ffccc2bc25627e500 Mon Sep 17 00:00:00 2001 From: polwex Date: Mon, 6 Oct 2025 01:01:41 +0700 Subject: working --- vere/boot-fake-ship.sh | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100755 vere/boot-fake-ship.sh (limited to 'vere/boot-fake-ship.sh') diff --git a/vere/boot-fake-ship.sh b/vere/boot-fake-ship.sh new file mode 100755 index 0000000..785f3ce --- /dev/null +++ b/vere/boot-fake-ship.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +set -xeuo pipefail + +urbit_binary=$GITHUB_WORKSPACE/$URBIT_BINARY +solid_pill=$GITHUB_WORKSPACE/solid.pill + +curl -LJ -o $solid_pill https://github.com/urbit/urbit/raw/84ebb321314b3fbc08253de5213f19450ffbfb3e/bin/solid.pill +curl -LJ -o urbit.tar.gz https://github.com/urbit/urbit/archive/84ebb321314b3fbc08253de5213f19450ffbfb3e.tar.gz + +mkdir ./urbit +tar xfz urbit.tar.gz -C ./urbit --strip-components=1 +cp -RL ./urbit/tests ./urbit/pkg/arvo/tests + +$urbit_binary --lite-boot --daemon --fake bus \ + --bootstrap $solid_pill \ + --arvo ./urbit/pkg/arvo \ + --pier ./pier + +cleanup() { + if [ -f ./pier/.vere.lock ]; then + kill $(< ./pier/.vere.lock) || true + fi + set +x +} + +trap cleanup EXIT +port=$(grep loopback ./pier/.http.ports | awk -F ' ' '{print $1}') + +lensd() { + curl -s \ + --data "{\"source\":{\"dojo\":\"$1\"},\"sink\":{\"stdout\":null}}" \ + "http://localhost:$port" | xargs printf %s | sed 's/\\n/\n/g' +} + +lensa() { + curl -s \ + --data "{\"source\":{\"dojo\":\"$2\"},\"sink\":{\"app\":\"$1\"}}" \ + "http://localhost:$port" | xargs printf %s | sed 's/\\n/\n/g' +} + +check() { + [ 3 -eq $(lensd 3) ] +} + +lensd '+vat %base' + +if check && sleep 10 && check; then + echo "boot success" + lensa hood '+hood/exit' + while [ -f ./pier/.vere.lock ]; do + echo "waiting for pier to shut down" + sleep 5 + done +else + echo "boot failure" + kill $(< ./pier/.vere.lock) || true + set +x + exit 1 +fi -- cgit v1.2.3