automatic deployment

This commit is contained in:
Erik Bročko 2018-09-03 02:25:10 +02:00
parent 55b89c700f
commit 0d36a0b88d
3 changed files with 39 additions and 1 deletions

12
deploy.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
LXC_CONT="marw"
MC_USER="mc"
MC_PATH="/home/mc/factions"
lxc file push "$1" "$LXC_CONT$MC_PATH/plugins/$2.jar"
lxc exec $LXC_CONT chown $MC_USER:$MC_USER "$MC_PATH/plugins/$2.jar"
lxc exec $LXC_CONT -- sudo -u $MC_USER "$MC_PATH/cmd.sh" "plugman reload $2"
exit 0

26
pom.xml
View File

@ -16,6 +16,11 @@
</issueManagement>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
@ -24,6 +29,26 @@
<release>10</release>
</configuration>
</plugin>
<plugin>
<artifactId>exec-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<executions>
<execution>
<id>Version Calculation</id>
<phase>deploy</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>${basedir}/deploy.sh</executable>
<arguments>
<argument>${project.build.directory}/${project.build.finalName}.jar</argument>
<argument>${artifactId}</argument>
</arguments>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
@ -36,6 +61,7 @@
</dependencies>
<repositories>
<repository>
<id>spigot-repo</id>

View File

@ -1,6 +1,6 @@
name: MarwCore
main: cz.marwland.mc.core.MarwCore
version: 1.0
version: 0.0.1
api-version: 1.12
commands:
first: