Makefile hinzufügen für oft auszuführende Operationen

This commit is contained in:
Timotheus Pokorra 2023-12-11 23:52:26 +01:00
parent e57a3d7c84
commit 9032f0d81c

39
Makefile Normal file
View File

@ -0,0 +1,39 @@
SHELL := /bin/bash
info:
@echo "Achtung: nur auf Entwicklungs- und Testservern einsetzen!"
@echo "make build: build the jar files"
@echo "make psql: start psql shell on the database"
@echo "make resetdata: reset the data in the database"
@echo "make run: run catalina and watch the output"
@echo "make test: run all continuous integration tests"
@echo "make testdomain: run one specific test for domains"
build:
source ~/.profile
cd ~/hsadmin/util && mvn clean install
cd ~/hsadmin/qserv && mvn clean install
cd ~/hsadmin/hsarback && mvn package -DskipTests
cp ~/hsadmin/qserv/target/hsadmin-*.jar ~/tomcatmq/webapps/hsar/WEB-INF/lib/
cp ~/hsadmin/util/target/hsadmin-*.jar ~/tomcatmq/webapps/hsar/WEB-INF/lib/
resetdata:
psql -U tim03_hsatest < ~/hsadmin/hsarback/database/dropschema.sql
psql -U tim03_hsatest < ~/hsadmin/hsarback/database/schema.sql
psql -U tim03_hsatest < ~/hsadmin/hsarback/database/data.sql
test: resetdata
source ~/.profile
cd ~/hsadmin/hsarback && mvn test -Dtest=ContinuousIntegrationTest
testdomain: resetdata
source ~/.profile
cd ~/hsadmin/hsarback && mvn test -Dtest=InitDataTest && mvn test -Dtest=DomainTest
run:
source ~/.profile
cd ~/tomcatmq && ./bin/catalina.sh run
psql:
WHOAMI=`whoami` && psql -U $${WHOAMI//\-/_}