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
|
||||
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!
|
||||
# TODO: Fix this mess later
|
||||
mkdir -p out/$1
|
||||
rm -rf out/$1
|
||||
rm -rf out/$1 out/$1.vma.zst
|
||||
OUT_FILE="$(sed -n '$p' build.log)"
|
||||
cp -r $OUT_FILE out/$1.vma.zst
|
12
buildall.sh
12
buildall.sh
|
@ -1,12 +1,22 @@
|
|||
#!/usr/bin/env bash
|
||||
mkdir meta > /dev/null 2> /dev/null
|
||||
|
||||
for FILE in kitteh-node-*/*; do
|
||||
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
|
||||
else
|
||||
echo "Not building '$FILE_NO_EXTENSION'."
|
||||
fi
|
||||
|
||||
mv "/tmp/kt-clusterbuild_sha512sum" "meta/$FILE.sha"
|
||||
done
|
||||
|
||||
echo "Done building."
|
Reference in a new issue