xl-project/makefile
2024-05-11 14:53:05 +02:00

42 lines
1.1 KiB
Makefile

GITHASH := $(shell git rev-parse --short HEAD)$(shell git diff-index --quiet HEAD || echo "-dirty")
TARNAME := xl-imbus_$(GITHASH).tar.gz
DIRNAME := xl
run:
./gradlew run
watch:
./gradlew run --continuous
build:
./gradlew build
ls -lh app/build/libs/*.jar
clean:
./gradlew clean
rm -f *.tar.gz *.tar.gz.minisig *.zip *.jpg
test:
./gradlew test
$(TARNAME):
git ls-files -z | xargs -0 tar -czf $(TARNAME)
$(TARNAME).minisig: $(TARNAME)
minisign -Sm $(TARNAME)
tar: $(TARNAME)
tar -tvf $(TARNAME)
sign: $(TARNAME).minisig
publish: $(TARNAME) $(TARNAME).minisig
@git diff-index --quiet HEAD || (echo "git is dirty, commit changes first"; exit 1)
ssh server mkdir -p /public/$(DIRNAME)
rsync -avz $(TARNAME).minisig server:/public/$(DIRNAME)/$(TARNAME).minisig
rsync -avz $(TARNAME) server:/public/$(DIRNAME)/$(TARNAME)
ssh server ln -sf /public/$(DIRNAME)/$(TARNAME).minisig /public/$(DIRNAME)/latest.tar.gz.minisig
ssh server ln -sf /public/$(DIRNAME)/$(TARNAME) /public/$(DIRNAME)/latest.tar.gz
.PHONY: run watch build clean test archive sign publish