Initial commit

This commit is contained in:
2025-11-15 18:53:58 -05:00
commit 28a4f289da
4 changed files with 201 additions and 0 deletions

10
scripts/initialize.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/usr/bin/env bash
if [ ! -e "${HOME}/.m2" ]; then
echo "Linking m2 from ${HOME}/.m2 to $M2_PATH"
ln -s "$M2_PATH" ${HOME}/.m2
fi
cd /workspace
"$@"

36
scripts/install-spigot.sh Executable file
View File

@@ -0,0 +1,36 @@
#!/usr/bin/env bash
echo "Building versions $REV"
if [ ! -e "${HOME}/.m2" ]; then
echo "Linking m2 from ${HOME}/.m2 to $M2_PATH"
ln -s "$M2_PATH" ${HOME}/.m2
fi
IFS=',' read -r -a versions <<< "$REV"
for ver in "${versions[@]}"; do
echo "Attempting to locate $ver..."
mvn -q org.apache.maven.plugins:maven-dependency-plugin:3.9.0:get -Dartifact=org.spigotmc:spigot:${ver}-R0.1-SNAPSHOT
if [ "$?" -eq 0 ]; then
echo "Located spigot $ver successfully"
mvn -q org.apache.maven.plugins:maven-dependency-plugin:3.9.0:copy -Dartifact=org.spigotmc:spigot:${ver}-R0.1-SNAPSHOT -DoutputDirectory=/build
else
echo "Spigot $ver not located, building..."
if [ ! -d "${HOME}/buildtools" ]; then
mkdir -p ${HOME}/buildtools
fi
cd ${HOME}/buildtools
[ ! -f "BuildTools.jar" ] && wget -O BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
java -jar BuildTools.jar --rev "$ver"
ARTIFACT="spigot-${ver}-R0.1-SNAPSHOT.jar"
mv "spigot-${ver}.jar" "$ARTIFACT"
mv "$ARTIFACT" /build
fi
done