29 lines
676 B
Bash
Executable File
29 lines
676 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
function fail() {
|
|
msg="$1"
|
|
echo "FAIL: $msg" >&2
|
|
exit 1
|
|
}
|
|
|
|
git add .
|
|
declare -a flake_archive_cmd=(nix flake archive --json)
|
|
declare -a prefix
|
|
if [[ ${HOST-x} != "triple-dezert" ]]; then
|
|
flake_archive_cmd+=(--to "ssh://trip")
|
|
prefix+=(ssh trip -- sudo)
|
|
fi
|
|
flake_path="$("${flake_archive_cmd[@]}" | jq .path -r)"
|
|
# if "${prefix[@]}" nix build "${flake_path}#checks.x86_64-linux.liam-sieve"; then
|
|
# echo yay
|
|
# else
|
|
# fail "liam-sieve failed with exit code $?"
|
|
# fi
|
|
if "${prefix[@]}" nix run "${flake_path}#checks.x86_64-linux.liam.driver" -- "$@"; then
|
|
echo "SUCCESS" >&2
|
|
else
|
|
fail "liam-vm failed with exit code $?"
|
|
fi
|