From 77b7be70382c863dd40f16a220990b3456dc8637 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E7=94=B7?= Date: Thu, 17 Oct 2024 22:05:04 +0800 Subject: [PATCH] add postgresql setup script --- deployment/setup-server-postgresql.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 deployment/setup-server-postgresql.sh diff --git a/deployment/setup-server-postgresql.sh b/deployment/setup-server-postgresql.sh new file mode 100755 index 0000000..17367ba --- /dev/null +++ b/deployment/setup-server-postgresql.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -x + +# Run it after running `mvn install` to provision the WildFly server. +JBOSS_HOME=target/wildfly + +# Add a basic admin user for testing. +$JBOSS_HOME/bin/add-user.sh -u admin -p admin +# Configure to use PostgreSQL based job repo in WildFly server. +$JBOSS_HOME/bin/jboss-cli.sh -c --commands='xa-data-source add --name=batch_db --enabled=true --use-java-context=true --use-ccm=true --jndi-name=java:jboss/jsr352/batch_db --xa-datasource-properties={"URL"=>"jdbc:postgresql://localhost:5432/batch_db"} --driver-name=postgresql --password=123 --user-name=batch_user --same-rm-override=false --no-recovery=true, /subsystem=batch-jberet/jdbc-job-repository=batch_db:add(data-source=batch_db), /subsystem=batch-jberet/:write-attribute(name=default-job-repository,value=batch_db),reload' \ No newline at end of file