Build with docker now (first try)

This commit is contained in:
Marc Baloup 2022-12-02 16:20:49 +01:00
parent f6d3d2d0de
commit d0331b7cd9
Signed by: marcbal
GPG Key ID: BBC0FE3ABC30B893

View File

@ -24,7 +24,6 @@ fi
PAPER_BUILD=`cat build_number.txt` PAPER_BUILD=`cat build_number.txt`
URL_BUILD=$URL_VERSION'/builds/'$PAPER_BUILD URL_BUILD=$URL_VERSION'/builds/'$PAPER_BUILD
echo "Downloadling Paperclip for Paper-"$MC_VERSION"-"$PAPER_BUILD"..."
DOWNLOAD_REOBF=$URL_BUILD'/downloads/paper-'$MC_VERSION'-'$PAPER_BUILD'.jar' DOWNLOAD_REOBF=$URL_BUILD'/downloads/paper-'$MC_VERSION'-'$PAPER_BUILD'.jar'
@ -32,27 +31,33 @@ DOWNLOAD_REOBF=$URL_BUILD'/downloads/paper-'$MC_VERSION'-'$PAPER_BUILD'.jar'
RUNNABLE_SERVER_JAR='Paper-'$MC_VERSION'-'$PAPER_BUILD'.jar' RUNNABLE_SERVER_JAR='Paper-'$MC_VERSION'-'$PAPER_BUILD'.jar'
#UBER_SERVER_JAR='Paper-uberjar-'$MC_VERSION'-'$PAPER_BUILD'.jar' #UBER_SERVER_JAR='Paper-uberjar-'$MC_VERSION'-'$PAPER_BUILD'.jar'
echo "Downloadling Paperclip for Paper-"$MC_VERSION"-"$PAPER_BUILD"..."
echo "From "$DOWNLOAD_REOBF
echo "To "$RUNNABLE_SERVER_JAR
curl -o $RUNNABLE_SERVER_JAR $DOWNLOAD_REOBF curl -o $RUNNABLE_SERVER_JAR $DOWNLOAD_REOBF
java -version #java -version
# run it to generate final jar, but not launching the actual server (-v option) # run it to generate final jar, but not launching the actual server (-v option)
echo "Running Paperclip..." #echo "Running Paperclip..."
mkdir bundle #mkdir bundle
(java -DbundlerRepoDir=bundle -jar ../$RUNNABLE_SERVER_JAR -v) #java -DbundlerRepoDir=bundle -Dpaperclip.patchonly=true -jar $RUNNABLE_SERVER_JAR
# important that versions/ comes first. It will be extracted first, # important that versions/ comes first. It will be extracted first,
# and following extraction will not override any file # and following extraction will not override any file
find bundle/versions/ bundle/libraries/ -type f -name '*.jar' > jars.txt #find bundle/versions/ bundle/libraries/ -type f -name '*.jar' > jars.txt
DOCKER_TAG="PandacubeFr/paper:"$MC_VERSION"-"$PAPER_BUILD DOCKER_TAG="PandacubeFr/paper:"$MC_VERSION"-"$PAPER_BUILD
echo "Building docker image with pre-downloaded and pre-patched files, with tag "$DOCKER_TAG
docker build --build-arg RUNNABLE_SERVER_JAR=$RUNNABLE_SERVER_JAR -t $DOCKER_TAG .
#docker build --build-arg RUNNABLE_SERVER_JAR=$RUNNABLE_SERVER_JAR -t $DOCKER_TAG . DOCKER_IMAGE_FILE="Paper-docker-image-"$MC_VERSION"-"$PAPER_BUILD".tar.gz"
echo "Saving docker image to "$DOCKER_IMAGE_FILE
docker save -o $DOCKER_IMAGE_FILE $DOCKER_TAG
#mkdir uberjar #mkdir uberjar
#for jar in `cat jars.txt`; do #for jar in `cat jars.txt`; do