fix: Install script not working as intended (#15)
Related to https://github.com/blue-build/github-action/issues/5
This commit is contained in:
parent
922dd5efb2
commit
d7a9b8115f
2 changed files with 19 additions and 9 deletions
|
|
@ -35,7 +35,7 @@ cargo install --locked blue-build
|
||||||
This will install the binary on your system in `/usr/local/bin`. This is only a `linux-gnu` version.
|
This will install the binary on your system in `/usr/local/bin`. This is only a `linux-gnu` version.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
podman run --rm ghcr.io/blue-build/cli:latest-installer | sudo bash
|
podman run --rm ghcr.io/blue-build/cli:latest-installer | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
## How to use
|
## How to use
|
||||||
|
|
|
||||||
26
install.sh
26
install.sh
|
|
@ -2,29 +2,39 @@
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
# We use sudo for podman so that we can copy directly into /usr/local/bin
|
||||||
|
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
echo "Cleaning up image"
|
echo "Cleaning up image"
|
||||||
podman stop -i -t 0 blue-build-installer
|
sudo podman stop -i -t 0 blue-build-installer
|
||||||
sleep 2
|
sleep 2
|
||||||
podman image rm ghcr.io/blue-build/cli:latest-installer
|
sudo podman image rm ghcr.io/blue-build/cli:latest-installer
|
||||||
}
|
}
|
||||||
|
|
||||||
podman pull ghcr.io/blue-build/cli:latest-installer
|
trap cleanup SIGINT
|
||||||
|
|
||||||
podman run -d --rm --name blue-build-installer ghcr.io/blue-build/cli:latest-installer tail -f /dev/null
|
sudo podman run \
|
||||||
|
--pull always \
|
||||||
|
--replace \
|
||||||
|
--detach \
|
||||||
|
--rm \
|
||||||
|
--name blue-build-installer \
|
||||||
|
ghcr.io/blue-build/cli:latest-installer \
|
||||||
|
tail -f /dev/null
|
||||||
|
|
||||||
set +e
|
set +e
|
||||||
podman cp blue-build-installer:/out/bb /usr/local/bin/bb
|
sudo podman cp blue-build-installer:/out/bb /usr/local/bin/bb
|
||||||
|
|
||||||
RETVAL=$?
|
RETVAL=$?
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [ -n $RETVAL ]; then
|
if [ $RETVAL != 0 ]; then
|
||||||
cleanup
|
cleanup
|
||||||
echo "Failed to copy file, try:"
|
echo "Failed to copy file"
|
||||||
printf "\tpodman run --rm ghcr.io/blue-build/cli:latest-installer | sudo bash\n"
|
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
|
# sudo mv bb /usr/local/bin/
|
||||||
|
echo "Finished! BlueBuild has been installed at /usr/local/bin/bb"
|
||||||
cleanup
|
cleanup
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue