Skip to content

Commit

Permalink
update: add pipefail
Browse files Browse the repository at this point in the history
  • Loading branch information
gerblesh committed Nov 24, 2024
1 parent a118ebb commit 52bd952
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ build-rpm:
rpkg local --outdir "$PWD/output"

builddep:
dnf builddep -y output/ublue-update.spec
dnf builddep -y output/ublue-update.spec

container-install-deps:
#!/usr/bin/env bash
dnf install \
set -eou pipefail
dnf install \
--disablerepo='*' \
--enablerepo='fedora,updates' \
--setopt install_weak_deps=0 \
Expand All @@ -44,7 +45,8 @@ container-install-deps:
# Used internally by build containers
container-rpm-build: container-install-deps spec builddep build-rpm
#!/usr/bin/env bash
set -eou pipefail
# clean up files
for RPM in ${UBLUE_ROOT}/noarch/*.rpm; do
NAME="$(rpm -q $RPM --queryformat='%{NAME}')"
Expand All @@ -68,12 +70,14 @@ container-build:

container-test:
#!/usr/bin/env bash
podman run -d --replace --name ublue_update_test --security-opt label=disable --device /dev/fuse:rw --privileged test-container
while [[ "$(podman exec ublue_update_test systemctl is-system-running)" != "running" && "$(podman exec ublue_update_test systemctl is-system-running)" != "degraded" ]]; do
set -eou pipefail
podman run -d --replace --name ublue-update-test --security-opt label=disable --device /dev/fuse:rw --privileged test-container
while [[ "$(podman exec ublue-update-test systemctl is-system-running)" != "running" && "$(podman exec ublue-update-test systemctl is-system-running)" != "degraded" ]]; do
echo "Waiting for systemd to finish booting..."
sleep 1
done
podman exec -it ublue_update_test systemd-run --user --machine podman@ --pipe --quiet sudo /usr/bin/ublue-update --dry-run
podman rm -f ublue_update_test
podman exec -it ublue-update-test systemd-run --user --machine podman@ --pipe --quiet sudo /usr/bin/ublue-update --dry-run
podman rm -f ublue-update-test
clean:
rm -rf "$UBLUE_ROOT"

0 comments on commit 52bd952

Please sign in to comment.