1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-11-22 14:03:09 +00:00

ostree_build: tee and timestamp the rpm-ostree output

Instead of just redirecting it to a log file, let's tee it, so
simple errors can be read off a screenshot without bothering to
download the file. Also, let's timestamp it (via `ts` from
moreutils) so we can see which bits of it take a long time...

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2022-12-06 13:29:16 -08:00
parent bf2f8d7305
commit 7536b6ce10

View File

@ -33,7 +33,7 @@ sub run {
# usually a good idea for this kinda thing # usually a good idea for this kinda thing
assert_script_run "setenforce Permissive"; assert_script_run "setenforce Permissive";
# install the tools we need # install the tools we need
assert_script_run "dnf -y install git lorax flatpak ostree rpm-ostree wget dbus-daemon", 300; assert_script_run "dnf -y install git lorax flatpak ostree rpm-ostree wget dbus-daemon moreutils", 300;
# now check out workstation-ostree-config # now check out workstation-ostree-config
assert_script_run 'git clone https://pagure.io/workstation-ostree-config.git'; assert_script_run 'git clone https://pagure.io/workstation-ostree-config.git';
assert_script_run 'pushd workstation-ostree-config'; assert_script_run 'pushd workstation-ostree-config';
@ -49,6 +49,9 @@ sub run {
# now make the ostree repo # now make the ostree repo
assert_script_run "mkdir -p /var/tmp/ostree"; assert_script_run "mkdir -p /var/tmp/ostree";
assert_script_run "ostree --repo=/var/tmp/ostree/repo init --mode=archive"; assert_script_run "ostree --repo=/var/tmp/ostree/repo init --mode=archive";
# need this to make the pipeline in the next command fail when
# rpm-ostree fails. note: this is a bashism
assert_script_run "set -o pipefail";
# PULL SOME LEVERS! PULL SOME LEVERS! # PULL SOME LEVERS! PULL SOME LEVERS!
# This shadows pungi/ostree/tree.py # This shadows pungi/ostree/tree.py
# FIXME: when https://fedoraproject.org/wiki/Changes/FedoraSilverblueUnifiedCore # FIXME: when https://fedoraproject.org/wiki/Changes/FedoraSilverblueUnifiedCore
@ -57,7 +60,8 @@ sub run {
# disables updating the ref with the new commit, and we *do* want # disables updating the ref with the new commit, and we *do* want
# to do that. pungi updates the ref itself, I don't want to copy # to do that. pungi updates the ref itself, I don't want to copy
# all that work in here # all that work in here
assert_script_run "rpm-ostree compose tree --repo=/var/tmp/ostree/repo/ --add-metadata-string=version=${advortask} --force-nocache /workstation-ostree-config/fedora-$lcsubv.yaml > /tmp/ostree.log 2>&1", 4500; assert_script_run "rpm-ostree compose tree --repo=/var/tmp/ostree/repo/ --add-metadata-string=version=${advortask} --force-nocache /workstation-ostree-config/fedora-$lcsubv.yaml |& ts " . '[%Y-%m-%d %H:%M:%S]' . " | tee /tmp/ostree.log", 4500;
assert_script_run "set +o pipefail";
upload_logs "/tmp/ostree.log"; upload_logs "/tmp/ostree.log";
# check out the ostree installer lorax templates # check out the ostree installer lorax templates
assert_script_run 'cd /'; assert_script_run 'cd /';