summaryrefslogtreecommitdiffstats
path: root/jenkinsbuild.sh
diff options
context:
space:
mode:
authorAlexander Harkness <me@bearbin.net>2020-02-24 12:28:24 +0100
committerGitHub <noreply@github.com>2020-02-24 12:28:24 +0100
commitcfedb03a09fe9a43bf0daf2c24b94ca98ab66f31 (patch)
tree99a6b9e0277905ddf6bc407d4856796317b71109 /jenkinsbuild.sh
parentBlockTypePalette: Improved loading speed in MSVC Debug builds. (diff)
downloadcuberite-cfedb03a09fe9a43bf0daf2c24b94ca98ab66f31.tar
cuberite-cfedb03a09fe9a43bf0daf2c24b94ca98ab66f31.tar.gz
cuberite-cfedb03a09fe9a43bf0daf2c24b94ca98ab66f31.tar.bz2
cuberite-cfedb03a09fe9a43bf0daf2c24b94ca98ab66f31.tar.lz
cuberite-cfedb03a09fe9a43bf0daf2c24b94ca98ab66f31.tar.xz
cuberite-cfedb03a09fe9a43bf0daf2c24b94ca98ab66f31.tar.zst
cuberite-cfedb03a09fe9a43bf0daf2c24b94ca98ab66f31.zip
Diffstat (limited to 'jenkinsbuild.sh')
-rwxr-xr-xjenkinsbuild.sh84
1 files changed, 84 insertions, 0 deletions
diff --git a/jenkinsbuild.sh b/jenkinsbuild.sh
new file mode 100755
index 000000000..731ccfa03
--- /dev/null
+++ b/jenkinsbuild.sh
@@ -0,0 +1,84 @@
+#!/usr/bin/env bash
+
+set -ex
+
+# Parse arguments.
+while [[ $# -gt 1 ]]
+do
+key="$1"
+case $key in
+ -s|--server-name)
+ SERVERNAME="$2"
+ shift
+ ;;
+ -t|--target)
+ TARGET="$2"
+ shift
+ ;;
+ -c|--compiler)
+ CCOMP="$2"
+ shift
+ ;;
+ -cxx|--cxx-compiler)
+ CXXCOMP="$2"
+ shift
+ ;;
+ -m|--compile-mode)
+ COMPILEMODE="-DCMAKE_BUILD_TYPE=$2"
+ shift
+ ;;
+ -n|--build-number)
+ BUILDID="$2"
+ shift
+ ;;
+ -p|--toolchain-file)
+ TOOLCHAINFILE="-DCMAKE_TOOLCHAIN_FILE=$2"
+ shift
+ ;;
+ -b|--branch)
+ BRANCH="$2"
+ shift
+ ;;
+ -32|--force-32)
+ FORCE32="-DFORCE_32=$2"
+ shift
+ ;;
+ *)
+ ;;
+esac
+shift
+done
+
+git submodule update --init
+
+# Set up build information.
+export CUBERITE_BUILD_SERIES_NAME="$SERVERNAME $TARGET $COMPILEMODE ($BRANCH)"
+export CUBERITE_BUILD_ID="$BUILDID"
+export CUBERITE_BUILD_DATETIME="`date`"
+
+export CCACHE_CPP2=true
+CACHE_ARGS="-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
+
+# Build
+CXX=$CXXCOMP CC=$CCOMP cmake . -DNO_NATIVE_OPTIMIZATION=1 -DBUILD_TOOLS=1 ${TOOLCHAINFILE} ${COMPILEMODE^^} ${FORCE32^^}
+make -j 2
+
+
+# Package Server
+echo Cuberite "$CUBERITE_BUILD_SERIES_NAME-$CUBERITE_BUILD_ID\n$BUILD_URL" > Server/buildinfo.txt
+
+# h: dereference (archive file/folder instead of symlink)
+# z: gzip (compress)
+# c: create
+# v: verbose
+# T: files-from (list of server files accepted for release archives)
+# f: file (output file location)
+pushd Server
+tar -hzcv -T Install/UnixExecutables.list -f ../Cuberite.tar.gz
+popd
+sha1sum Cuberite.tar.gz > Cuberite.tar.gz.sha1
+
+# Package ProtoProxy
+pushd Tools/ProtoProxy
+sha1sum ProtoProxy > ProtoProxy.sha1
+popd