Improved server packaging

This commit is contained in:
WolverinDEV 2020-01-24 19:39:43 +01:00
parent b9238f1e36
commit 158c9ea196
8 changed files with 38 additions and 35 deletions

View File

@ -1,25 +1,27 @@
#!/usr/bin/env bash
#!/bin/bash
BUILD_PATH=$1
if [ -z ${BUILD_PATH} ]; then
if [[ -z "${BUILD_PATH}" ]]; then
echo "Missing versions path!"
exit 1
fi
./generate_version.sh ${BUILD_PATH}
if [ $? -ne 0 ]; then
echo "Failed to generate version!"
./generate_version.sh "${BUILD_PATH}" || {
echo "Failed to generate version! ($?)"
exit 1
fi
}
./package_server.sh ${BUILD_PATH}
if [ $? -ne 0 ]; then
echo "Failed to package server!"
./generate_libraries.sh || {
echo "Failed to generate libraries! ($?)"
exit 1
fi
}
./deploy_build.sh ${BUILD_PATH}
if [ $? -ne 0 ]; then
echo "Failed to deploy package!"
./package_server.sh "${BUILD_PATH}" || {
echo "Failed to package server! ($?)"
exit 1
fi
}
./deploy_build.sh "${BUILD_PATH}" || {
echo "Failed to deploy package! ($?)"
exit 1
}

View File

@ -3,7 +3,7 @@
BUILD_PATH=$1
if [[ -z ${BUILD_PATH} ]]; then
echo "Missing versions path!"
#exit 1
exit 1
fi
BUILD_INFO=($(cat build_version.txt))

View File

@ -1 +0,0 @@
../../../git-teaspeak/default_files/install_libnice.sh

View File

@ -45,7 +45,8 @@ library_path=$(realpath "${library_base}/boringssl/${build_path}/crypto/libcrypt
ln -s "$library_path" . || { echo "failed to link libcrypto.so"; exit 1; }
# Setting up DataPipes
ln -s "${library_base}/DataPipes/${build_path}/lib/libDataPipes.so" . || { echo "failed to link libDataPipes.so"; exit 1; }
library_path=$(realpath "${library_base}//DataPipes/${build_path}/lib/libDataPipes.so")
ln -s "$library_path" . || { echo "failed to link libDataPipes.so"; exit 1; }
# Setting up Sqlite3
query_system_link "libsqlite3.so.0"
@ -59,6 +60,10 @@ ln -s "${library_path}" . || { echo "failed to link libjemalloc.so.2"; exit 1; }
library_path=$(realpath "../../../../MusicBot/libs/libTeaMusic.so")
ln -s "$library_path" . || { echo "failed to link libTeaMusic.so"; exit 1; }
# Setting up libnice
library_path=$(realpath "${library_base}/libnice/${build_os_type}_${build_os_arch}/lib/libnice.so.10")
ln -s "$library_path" . || { echo "failed to link libnice.so.10"; exit 1; }
# Validate setup
broken_links=$(find . -type l ! -exec test -e {} \; -print)
[[ -n ${broken_links} ]] && {

View File

@ -17,13 +17,13 @@ if [[ -z ${BUILD_PATH} ]]; then
#exit 1
fi
CURRENT_VERSION=`cat env/buildVersion.txt`
CURRENT_VERSION=$(cat env/buildVersion.txt)
CURRENT_VERSION_ESCAPED=$(echo "${CURRENT_VERSION}" | sed -e 's/[\/&\.\-]/\\&/g')
AVAILABLE_VERSIONS=`ssh -i build_private_key TeaSpeak-Jenkins@mcgalaxy.de "
AVAILABLE_VERSIONS=$(ssh -i build_private_key TeaSpeak-Jenkins@mcgalaxy.de "
if [ -d versions/${BUILD_PATH} ]; then
ls versions/${BUILD_PATH} | grep -E '^${CURRENT_VERSION_ESCAPED}(\-[0-9]+)?$'
fi
"`
")
debug "${AVAILABLE_VERSIONS}"
TARGET_VERSION=""

View File

@ -6,7 +6,7 @@ TMP_FILE="temp"
function mkdir_not_exists() {
if [[ ! -d $1 ]]; then
mkdir $1
mkdir "$1"
fi
}
@ -15,7 +15,10 @@ function create_dump() {
local BINARY_NAME=${2}
echo "Creating dump file for ${BINARY_NAME} (${BINARY_PATH}/${BINARY_NAME})"
dump_syms ${BINARY_PATH}/${BINARY_NAME} > ${TMP_FILE}
dump_syms "${BINARY_PATH}/${BINARY_NAME}" > ${TMP_FILE} || {
echo "Failed to generate dump."
exit 1
}
SYM_INFO=$(head -n1 < ${TMP_FILE})
SYM_INFO=($SYM_INFO)
DUMP_ID=${SYM_INFO[3]}
@ -26,7 +29,10 @@ function create_dump() {
mkdir_not_exists ${SYMBOL_ROOT}/${BINARY_NAME}/${DUMP_ID}
DUMP_PATH=${SYMBOL_ROOT}/${BINARY_NAME}/${DUMP_ID}/${BINARY_NAME}.sym
mv ${TMP_FILE} ${DUMP_PATH}
mv "$TMP_FILE" "$DUMP_PATH" || {
echo "Failed to move dump."
exit 1
}
}
create_dump "env" "TeaSpeakServer"

View File

@ -20,23 +20,13 @@ echo -e "# Version: ${BUILD_FULL_NAME}
# TeaSpeak version: ${BUILD_NAME}
# Build version: ${BUILD_VERSION}
{build_name: \"${BUILD_FULL_NAME}\", build_version: \"${BUILD_NAME}\", build_index: ${BUILD_VERSION}}" > buildVersion.txt
{\"build_name\": \"${BUILD_FULL_NAME}\", \"build_version\": \"${BUILD_NAME}\", \"build_index\": ${BUILD_VERSION}}" > buildVersion.txt
#Create a copy and save unstripped
cp TeaSpeakServer TeaSpeakServerTmp
rm TeaSpeakServer
mv TeaSpeakServerTmp TeaSpeakServer
#Copy libnice into place
if [[ -z ${build_os_type} || -z ${build_os_arch} ]]; then
echo "Missing build_os_type or build_os_arch."
exit 1
fi
cp "../../../../libraries/libnice/${build_os_type}_${build_os_arch}/lib/libnice.so.10" ./libs/ || {
echo "failed to copy libnice"
exit 1
}
strip -s -p -v TeaSpeakServer
tar --dereference -czvf "../${BUILD_FILENAME}" *
cd ..

View File

@ -3,8 +3,9 @@
BVERSION="$(cat env/buildVersion.txt)"
FBUILD=0
# shellcheck disable=SC2120
function buildName() {
if [ ! -z "$1" ]; then
if [ -n "$1" ]; then
L_FBUILD="$1"
else
L_FBUILD="${FBUILD}"