fix: Add failure checking.
This commit is contained in:
parent
77c5c90a46
commit
8f9e59a758
2 changed files with 8 additions and 3 deletions
|
@ -1,4 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
echo "Building '$1'..."
|
echo "Building '$1'..."
|
||||||
nix --extra-experimental-features nix-command run github:nix-community/nixos-generators -- --format proxmox --configuration "$1.nix" | tee build.log
|
nix --extra-experimental-features nix-command run github:nix-community/nixos-generators -- --format proxmox --configuration "$1.nix" | tee build.log
|
||||||
|
|
||||||
|
@ -8,10 +10,8 @@ fi
|
||||||
|
|
||||||
echo "Copying file to the output directory..."
|
echo "Copying file to the output directory..."
|
||||||
|
|
||||||
# Hack!
|
# Hacky!
|
||||||
# TODO: Fix this mess later
|
|
||||||
mkdir -p out/$1
|
mkdir -p out/$1
|
||||||
rm -rf out/$1 out/$1.vma.zst
|
rm -rf out/$1 out/$1.vma.zst
|
||||||
OUT_FILE="$(sed -n '$p' build.log)"
|
OUT_FILE="$(sed -n '$p' build.log)"
|
||||||
|
|
||||||
cp -r $OUT_FILE out/$1.vma.zst
|
cp -r $OUT_FILE out/$1.vma.zst
|
|
@ -14,6 +14,11 @@ for FILE in kitteh-node-*/*; do
|
||||||
if [ ! -f "meta/$FILE.sha" ] || ! diff -q "/tmp/kt-clusterbuild_sha512sum" "meta/$FILE.sha" > /dev/null; then
|
if [ ! -f "meta/$FILE.sha" ] || ! diff -q "/tmp/kt-clusterbuild_sha512sum" "meta/$FILE.sha" > /dev/null; then
|
||||||
./build.sh $FILE_NO_EXTENSION
|
./build.sh $FILE_NO_EXTENSION
|
||||||
|
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Failed to build, skipping..."
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
if ! grep -q "out/$FILE_NO_EXTENSION.vma.zst" meta/tagged_for_upload; then
|
if ! grep -q "out/$FILE_NO_EXTENSION.vma.zst" meta/tagged_for_upload; then
|
||||||
echo "out/$FILE_NO_EXTENSION.vma.zst" >> meta/tagged_for_upload
|
echo "out/$FILE_NO_EXTENSION.vma.zst" >> meta/tagged_for_upload
|
||||||
fi
|
fi
|
||||||
|
|
Reference in a new issue