mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2025-11-29 17:38:24 +08:00
feat(CORE/bash): implemented acore dashboard for Windows (#13476)
+ implemented acore dashboard for windows + integrated acore dashboard for windows in our pipeline + implemented dry run for windows build + fixed permissions issue for all the operating systems + code clean
This commit is contained in:
@@ -2,25 +2,12 @@
|
||||
|
||||
set -e
|
||||
|
||||
CURRENT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
# Start mysql
|
||||
sudo systemctl start mysql
|
||||
|
||||
APP_NAME=$1
|
||||
|
||||
echo "LoginDatabaseInfo = \"localhost;3306;root;root;acore_auth\"" >> ./env/dist/etc/$APP_NAME.conf
|
||||
|
||||
if [[ $APP_NAME != "authserver" ]]; then
|
||||
{
|
||||
echo "WorldDatabaseInfo = \"localhost;3306;root;root;acore_world\""
|
||||
echo "CharacterDatabaseInfo = \"localhost;3306;root;root;acore_characters\""
|
||||
} >> ./env/dist/etc/$APP_NAME.conf
|
||||
fi
|
||||
|
||||
if [[ $APP_NAME == "worldserver" ]]; then
|
||||
echo "DataDir = \"../data/\"" >> ./env/dist/etc/$APP_NAME.conf
|
||||
|
||||
git clone --depth=1 --branch=master --single-branch https://github.com/ac-data/ac-data.git ./env/dist/data
|
||||
fi
|
||||
source "$CURRENT_PATH/ci-gen-server-conf-files.sh" $1 "etc" "bin" "root"
|
||||
|
||||
(cd ./env/dist/bin/ && timeout 5m ./$APP_NAME -dry-run)
|
||||
|
||||
|
||||
21
apps/ci/ci-gen-server-conf-files.sh
Normal file
21
apps/ci/ci-gen-server-conf-files.sh
Normal file
@@ -0,0 +1,21 @@
|
||||
APP_NAME=$1
|
||||
CONFIG_FOLDER=${2:-"etc"}
|
||||
BIN_FOLDER=${3-"bin"}
|
||||
MYSQL_ROOT_PASSWORD=${4:-""}
|
||||
|
||||
|
||||
echo "LoginDatabaseInfo = \"localhost;3306;root;$MYSQL_ROOT_PASSWORD;acore_auth\"" >> ./env/dist/$CONFIG_FOLDER/$APP_NAME.conf
|
||||
|
||||
# worldserver or dbimport
|
||||
if [[ $APP_NAME != "authserver" ]]; then
|
||||
{
|
||||
echo "WorldDatabaseInfo = \"localhost;3306;root;$MYSQL_ROOT_PASSWORD;acore_world\""
|
||||
echo "CharacterDatabaseInfo = \"localhost;3306;root;$MYSQL_ROOT_PASSWORD;acore_characters\""
|
||||
} >> ./env/dist/$CONFIG_FOLDER/$APP_NAME.conf
|
||||
fi
|
||||
|
||||
if [[ $APP_NAME == "worldserver" ]]; then
|
||||
echo "DataDir = \"./data/\"" >> ./env/dist/$CONFIG_FOLDER/$APP_NAME.conf
|
||||
|
||||
git clone --depth=1 --branch=master --single-branch https://github.com/ac-data/ac-data.git ./env/dist/$BIN_FOLDER/data
|
||||
fi
|
||||
@@ -21,7 +21,7 @@ CONFIG_SH
|
||||
|
||||
time sudo apt-get update -y
|
||||
# time sudo apt-get upgrade -y
|
||||
time sudo apt-get install -y git lsb-release sudo ccache
|
||||
time sudo apt-get install -y git lsb-release sudo
|
||||
time ./acore.sh install-deps
|
||||
|
||||
case $COMPILER in
|
||||
|
||||
@@ -19,12 +19,7 @@ function comp_ccacheEnable() {
|
||||
export CCACHE_COMPRESSLEVEL=${CCACHE_COMPRESSLEVEL:-9}
|
||||
#export CCACHE_NODIRECT=true
|
||||
|
||||
unamestr=$(uname)
|
||||
if [[ "$unamestr" == 'Darwin' ]]; then
|
||||
export CCUSTOMOPTIONS="$CCUSTOMOPTIONS -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DMYSQL_ADD_INCLUDE_PATH=/usr/local/include -DMYSQL_LIBRARY=/usr/local/lib/libmysqlclient.dylib -DREADLINE_INCLUDE_DIR=/usr/local/opt/readline/include -DREADLINE_LIBRARY=/usr/local/opt/readline/lib/libreadline.dylib -DOPENSSL_INCLUDE_DIR=/usr/local/opt/openssl@1.1/include -DOPENSSL_SSL_LIBRARIES=/usr/local/opt/openssl@1.1/lib/libssl.dylib -DOPENSSL_CRYPTO_LIBRARIES=/usr/local/opt/openssl@1.1/lib/libcrypto.dylib"
|
||||
else
|
||||
export CCUSTOMOPTIONS="$CCUSTOMOPTIONS -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
|
||||
fi
|
||||
export CCUSTOMOPTIONS="$CCUSTOMOPTIONS -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
|
||||
}
|
||||
|
||||
function comp_ccacheClean() {
|
||||
@@ -70,6 +65,19 @@ function comp_configure() {
|
||||
|
||||
comp_ccacheEnable
|
||||
|
||||
OSOPTIONS=""
|
||||
|
||||
|
||||
echo "Platform: $OSTYPE"
|
||||
case "$OSTYPE" in
|
||||
darwin*)
|
||||
OSOPTIONS=" -DMYSQL_ADD_INCLUDE_PATH=/usr/local/include -DMYSQL_LIBRARY=/usr/local/lib/libmysqlclient.dylib -DREADLINE_INCLUDE_DIR=/usr/local/opt/readline/include -DREADLINE_LIBRARY=/usr/local/opt/readline/lib/libreadline.dylib -DOPENSSL_INCLUDE_DIR=/usr/local/opt/openssl@1.1/include -DOPENSSL_SSL_LIBRARIES=/usr/local/opt/openssl@1.1/lib/libssl.dylib -DOPENSSL_CRYPTO_LIBRARIES=/usr/local/opt/openssl@1.1/lib/libcrypto.dylib "
|
||||
;;
|
||||
msys*)
|
||||
OSOPTIONS=" -DMYSQL_INCLUDE_DIR=C:\tools\mysql\current\include -DMYSQL_LIBRARY=C:\tools\mysql\current\lib\mysqlclient.lib "
|
||||
;;
|
||||
esac
|
||||
|
||||
cmake $SRCPATH -DCMAKE_INSTALL_PREFIX=$BINPATH $DCONF \
|
||||
-DAPPS_BUILD=$CAPPS_BUILD \
|
||||
-DTOOLS_BUILD=$CTOOLS_BUILD \
|
||||
@@ -82,7 +90,7 @@ function comp_configure() {
|
||||
-DWITH_WARNINGS=$CWARNINGS \
|
||||
-DCMAKE_C_COMPILER=$CCOMPILERC \
|
||||
-DCMAKE_CXX_COMPILER=$CCOMPILERCXX \
|
||||
$CBUILD_APPS_LIST $CBUILD_TOOLS_LIST $CCUSTOMOPTIONS
|
||||
$CBUILD_APPS_LIST $CBUILD_TOOLS_LIST $OSOPTIONS $CCUSTOMOPTIONS
|
||||
|
||||
cd $CWD
|
||||
|
||||
@@ -100,25 +108,50 @@ function comp_compile() {
|
||||
|
||||
comp_ccacheResetStats
|
||||
|
||||
time make -j $MTHREADS
|
||||
make -j $MTHREADS install
|
||||
time cmake --build . --config $CTYPE -j $MTHREADS
|
||||
|
||||
comp_ccacheShowStats
|
||||
|
||||
cd $CWD
|
||||
echo "Platform: $OSTYPE"
|
||||
case "$OSTYPE" in
|
||||
msys*)
|
||||
cmake --install . --config $CTYPE
|
||||
|
||||
if [[ $DOCKER = 1 ]]; then
|
||||
echo "Generating confs..."
|
||||
cp -n "env/dist/etc/worldserver.conf.dockerdist" "env/dist/etc/worldserver.conf"
|
||||
cp -n "env/dist/etc/authserver.conf.dockerdist" "env/dist/etc/authserver.conf"
|
||||
cp -n "env/dist/etc/dbimport.conf.dockerdist" "env/dist/etc/dbimport.conf"
|
||||
fi
|
||||
cd $CWD
|
||||
|
||||
echo "Done"
|
||||
;;
|
||||
linux*|darwin*)
|
||||
local confDir=${CONFDIR:-"$AC_BINPATH_FULL/../etc"}
|
||||
|
||||
# create the folders before installing to
|
||||
# set the current user and permissions
|
||||
echo "Creating $AC_BINPATH_FULL..."
|
||||
mkdir -p "$AC_BINPATH_FULL"
|
||||
echo "Creating $confDir..."
|
||||
mkdir -p "$confDir"
|
||||
|
||||
echo "Cmake install..."
|
||||
sudo cmake --install . --config $CTYPE
|
||||
|
||||
cd $CWD
|
||||
|
||||
if [[ $DOCKER = 1 ]]; then
|
||||
echo "Generating confs..."
|
||||
cp -n "env/dist/etc/worldserver.conf.dockerdist" "env/dist/${confDir}/worldserver.conf"
|
||||
cp -n "env/dist/etc/authserver.conf.dockerdist" "env/dist/${confDir}/authserver.conf"
|
||||
cp -n "env/dist/etc/dbimport.conf.dockerdist" "env/dist/${confDir}/dbimport.conf"
|
||||
fi
|
||||
# set all aplications SUID bit
|
||||
echo "Setting permissions on binary files"
|
||||
find "$AC_BINPATH_FULL" -type f -exec sudo chown root:root -- {} +
|
||||
find "$AC_BINPATH_FULL" -type f -exec sudo chmod u+s -- {} +
|
||||
|
||||
echo "Done"
|
||||
;;
|
||||
esac
|
||||
|
||||
runHooks "ON_AFTER_BUILD"
|
||||
|
||||
# set all aplications SUID bit
|
||||
sudo chown -R root:root "$AC_BINPATH_FULL"
|
||||
sudo chmod -R u+s "$AC_BINPATH_FULL"
|
||||
}
|
||||
|
||||
function comp_build() {
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
echo "WARNING: Installer Script for Windows is not fully supported yet. Work in progress.."
|
||||
echo "!!README!!: Please install openssl and mysql libraries manually following our wiki"
|
||||
|
||||
# install chocolatey before
|
||||
|
||||
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
|
||||
@@ -9,9 +6,24 @@ echo "!!README!!: Please install openssl and mysql libraries manually following
|
||||
# cmake
|
||||
# git
|
||||
# microsoft-build-tools
|
||||
# mysql 5.6
|
||||
# mysql
|
||||
|
||||
choco install -y --skip-checksums cmake git git.install microsoft-build-tools ccache
|
||||
choco install -y --skip-checksums mysql --version 5.6.12
|
||||
INSTALL_ARGS=""
|
||||
|
||||
if [[ $CONTINUOUS_INTEGRATION ]]; then
|
||||
INSTALL_ARGS=" --no-progress "
|
||||
else
|
||||
{ # try
|
||||
choco uninstall -y -n cmake.install cmake # needed to make sure that following install set the env properly
|
||||
} || { # catch
|
||||
echo "nothing to do"
|
||||
}
|
||||
|
||||
choco install -y --skip-checksums $INSTALL_ARGS git visualstudio2022community
|
||||
fi
|
||||
|
||||
choco install -y --skip-checksums $INSTALL_ARGS cmake.install -y --installargs 'ADD_CMAKE_TO_PATH=System'
|
||||
choco install -y --skip-checksums $INSTALL_ARGS visualstudio2022-workload-nativedesktop openssl
|
||||
choco install -y --skip-checksums $INSTALL_ARGS boost-msvc-14.3 --version=1.79.0
|
||||
choco install -y --skip-checksums $INSTALL_ARGS mysql --version 8.0.31
|
||||
|
||||
echo "!!README!!: Please remember to install openssl and mysql libraries manually following our wiki"
|
||||
|
||||
Reference in New Issue
Block a user