Setting up standalone/client/server run scripts

This commit is contained in:
Claude Brisson
2023-06-12 08:12:58 +02:00
parent 7a5502a29f
commit 2ae8657b83
10 changed files with 31 additions and 17 deletions

View File

@@ -78,11 +78,15 @@
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.version}</version>
<configuration>
<scan>0</scan>
<httpConnector>
<port>8085</port>
</httpConnector>
<webApp>
<contextPath>/api/</contextPath>
</webApp>
</configuration>
</plugin>
</plugin>
</plugins>
</build>
<dependencyManagement>

5
client.sh Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/bash
export MAVEN_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=*:5006"
#mvn --projects view-webapp -Dpairgoth.api.url=http://localhost:8085/api/ package jetty:run-war
mvn --projects view-webapp package jetty:run-war

View File

@@ -1,3 +0,0 @@
#!/bin/sh
mvn package && java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5006 -jar application/target/pairgoth-engine.jar

3
run.sh
View File

@@ -1,3 +0,0 @@
#!/bin/sh
mvn package && java -jar application/target/pairgoth-engine.jar

4
server.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
export MAVEN_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=*:5005"
mvn --projects api-webapp package jetty:run-war

6
standalone.sh Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/sh
# debug version
# mvn package && java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5006 -jar application/target/pairgoth-engine.jar
mvn package && java -jar application/target/pairgoth-engine.jar

3
view-webapp/csswatch.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
mvn com.gitlab.haynes:libsass-maven-plugin:0.2.29:watch

View File

@@ -101,11 +101,11 @@
<version>${jetty.version}</version>
<configuration>
<scan>0</scan>
<httpConnector>
<port>8080</port>
</httpConnector>
<systemProperties>
<systemProperty>
<name>pairgoth.webapp.url</name>
<value>http://localhost:8080</value>
</systemProperty>
<pairgoth.api.url>http://localhost:8085/api/</pairgoth.api.url>
</systemProperties>
</configuration>
</plugin>

View File

@@ -1,7 +1,7 @@
# webapp
env = dev
webapp.url = https://localhost:8080
api.url = https://localhost:8085
api.url = https://localhost:8085/api
# store
store = file

View File

@@ -11,11 +11,9 @@ class ApiTool {
companion object {
const val JSON = "application/json"
val apiRoot =
(System.getProperty("pairgoth.api.url") ?: System.getProperty("pairgoth.webapp.url"))
.let { base ->
if (base.endsWith('/')) "${base}api/"
else "${base}/api/"
}
System.getProperty("pairgoth.api.url")?.let { "${it.removeSuffix("/")}/" }
?: System.getProperty("pairgoth.webapp.url")?.let { "${it.removeSuffix("/")}/api/" }
?: throw Error("no configured API url")
}
private val client = OkHttpClient()
private fun prepare(url: String) = Request.Builder().url("$apiRoot$url").header("Accept", JSON)