
VERSION ?= $(shell git describe)


all:


tgz:
	cd .. \
	&& ln -s vlkb-soda vlkb-soda-${VERSION} \
	&& tar --exclude='.git' --exclude='rpm' --exclude='docker' -hczf vlkb-soda-$(VERSION).tag.gz vlkb-soda-$(VERSION) \
	&& rm -f vlkb-soda-$(VERSION) \
	&& cd -

war:
	make -C data-access/servlet create-war && mv data-access/servlet/target/vlkb-soda*.war .

rpm:
	make -C data-access/engine/src clean && make -C data-access/engine/src PACK_EXT=rpm && mv data-access/engine/src/vlkb*.rpm .

deb:
	make -C data-access/engine/src clean && make -C data-access/engine/src PACK_EXT=deb && mv data-access/engine/src/vlkb*.deb .



clean:
	make -C data-access/servlet clean
	make -C data-access/engine clean

# 20250401 Owner glpat-JhqpFhEGvxuVzHqxjwqx
.PHONY: upload-war-deb
upload-war-deb:
	curl --header "PRIVATE-TOKEN: glpat-JhqpFhEGvxuVzHqxjwqx" --upload-file vlkb-soda-$(VERSION).war  https://ict.inaf.it/gitlab/api/v4/projects/1780/packages/generic/vlkb-soda/1.5/vlkb-soda-$(VERSION).war
	curl --header "PRIVATE-TOKEN: glpat-JhqpFhEGvxuVzHqxjwqx" --upload-file vlkb-$(VERSION).deb  https://ict.inaf.it/gitlab/api/v4/projects/1780/packages/generic/vlkb-soda/1.5/vlkb-$(VERSION).deb
	curl --header "PRIVATE-TOKEN: glpat-JhqpFhEGvxuVzHqxjwqx" --upload-file vlkb-obscore-$(VERSION).deb  https://ict.inaf.it/gitlab/api/v4/projects/1780/packages/generic/vlkb-soda/1.5/vlkb-obscore-$(VERSION).deb
	curl --header "PRIVATE-TOKEN: glpat-JhqpFhEGvxuVzHqxjwqx" --upload-file vlkbd-$(VERSION).deb  https://ict.inaf.it/gitlab/api/v4/projects/1780/packages/generic/vlkb-soda/1.5/vlkbd-$(VERSION).deb

