feature: Changes build script to only rebuild upon changes.
This commit is contained in:
parent
abb2f82682
commit
befbab002a
3 changed files with 14 additions and 3 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
||||||
out
|
out
|
||||||
build.log
|
build.log
|
||||||
secrets.nix
|
secrets.nix
|
||||||
|
meta
|
2
build.sh
2
build.sh
|
@ -10,6 +10,6 @@ echo "Copying file to the output directory..."
|
||||||
# Hack!
|
# Hack!
|
||||||
# TODO: Fix this mess later
|
# TODO: Fix this mess later
|
||||||
mkdir -p out/$1
|
mkdir -p out/$1
|
||||||
rm -rf out/$1
|
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
|
12
buildall.sh
12
buildall.sh
|
@ -1,12 +1,22 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
mkdir meta > /dev/null 2> /dev/null
|
||||||
|
|
||||||
for FILE in kitteh-node-*/*; do
|
for FILE in kitteh-node-*/*; do
|
||||||
FILE_NO_EXTENSION="${FILE/".nix"/""}"
|
FILE_NO_EXTENSION="${FILE/".nix"/""}"
|
||||||
|
|
||||||
if [ ! -f "out/$FILE_NO_EXTENSION.vma.zst" ] || git diff --exit-code $FILE; then
|
# Hacky!
|
||||||
|
mkdir -p meta/$FILE
|
||||||
|
rm -rf meta/$FILE
|
||||||
|
|
||||||
|
sha512sum $FILE > /tmp/kt-clusterbuild_sha512sum
|
||||||
|
|
||||||
|
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
|
||||||
else
|
else
|
||||||
echo "Not building '$FILE_NO_EXTENSION'."
|
echo "Not building '$FILE_NO_EXTENSION'."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
mv "/tmp/kt-clusterbuild_sha512sum" "meta/$FILE.sha"
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Done building."
|
echo "Done building."
|
Reference in a new issue