particle-os-cli/install.sh
xyny 42d879a6e5
chore: use GHCR for install.sh (#11)
Trying to make the action install the binary from the container on GHCR
with `podman run --rm ghcr.io/blue-build/cli:main-installer | sudo bash`
(like in the README). Getting some error and this _might_ be related and
might not, but shouldn't hurt to merge either, since I just made the
`cli` package public.

---------

Co-authored-by: Gerald Pinder <gmpinder@gmail.com>
2024-01-24 17:27:51 -05:00

30 lines
624 B
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
function cleanup() {
echo "Cleaning up image"
podman stop -i -t 0 blue-build-installer
sleep 2
podman image rm ghcr.io/blue-build/cli:latest-installer
}
podman pull ghcr.io/blue-build/cli:latest-installer
podman run -d --rm --name blue-build-installer ghcr.io/blue-build/cli:latest-installer tail -f /dev/null
set +e
podman cp blue-build-installer:/out/bb /usr/local/bin/bb
RETVAL=$?
set -e
if [ -n $RETVAL ]; then
cleanup
echo "Failed to copy file, try:"
printf "\tpodman run --rm ghcr.io/blue-build/cli:latest-installer | sudo bash\n"
exit 1
else
cleanup
fi