ported double tracking from TC

This commit is contained in:
mikx
2020-10-30 23:45:46 -04:00
commit 44b1f31c23
4914 changed files with 4961129 additions and 0 deletions

30
docker/build/Dockerfile Normal file
View File

@@ -0,0 +1,30 @@
FROM ubuntu:20.04
# install the required dependencies to compile AzerothCore
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y git cmake make gcc g++ clang libmysqlclient-dev libssl-dev libbz2-dev libreadline-dev libncurses-dev libace-6.4.5 libace-dev
# copy the sources from the host machine to the Docker container
ADD .git /azerothcore/.git
ADD deps /azerothcore/deps
ADD conf/dist /azerothcore/conf/dist
ADD src /azerothcore/src
ADD modules /azerothcore/modules
ADD CMakeLists.txt /azerothcore/CMakeLists.txt
ARG ENABLE_SCRIPTS=1
ENV ENABLE_SCRIPTS=$ENABLE_SCRIPTS
ENTRYPOINT cd azerothcore/build && \
# run cmake
cmake ../ -DCMAKE_INSTALL_PREFIX=/azeroth-server -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DTOOLS=0 -DSCRIPTS=$ENABLE_SCRIPTS -DWITH_WARNINGS=1 -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror" && \
# calculate the optimal number of threads
MTHREADS=`grep -c ^processor /proc/cpuinfo`; MTHREADS=$(($MTHREADS + 2)) && \
# run compilation
make -j $MTHREADS && \
make install -j $MTHREADS && \
# copy the binary files "authserver" and "worldserver" files back to the host
# - the directories "/binworldserver" and "/binauthserver" are meant to be bound to the host directories
# - see docker/build/README.md to view the bindings
cp /azeroth-server/bin/worldserver /binworldserver && \
cp /azeroth-server/bin/authserver /binauthserver

35
docker/build/README.md Normal file
View File

@@ -0,0 +1,35 @@
# AzerothCore Dockerized Build
The AzerothCore Build Dockerfile will create a container that will run the AC build.
When this container runs, it will compile AC and generate:
- the build cache in the `docker/build/cache` directory
- the `worldserver` executable file in `docker/worldserver/bin`
- the `authserver` executable file in `docker/authserver/bin`
The executable files will be used by the [authserver](https://github.com/azerothcore/azerothcore-wotlk/tree/master/docker/authserver) and the [worldserver](https://github.com/azerothcore/azerothcore-wotlk/tree/master/docker/worldserver) docker containers.
Note: every time you update your AzerothCore sources, you **must** run again the build container and restart your `worldserver` and `authserver` containers.
## Usage
To build the container image you have to be in the **main** folder of your local AzerothCore sources directory and run:
```
docker build -t acbuild -f docker/build/Dockerfile .
```
Then you can launch the container to rebuild AC using:
```
docker run \
-v /$(pwd)/docker/build/cache:/azerothcore/build \
-v /$(pwd)/docker/worldserver/bin:/binworldserver \
-v /$(pwd)/docker/authserver/bin:/binauthserver \
acbuild
```
### Clearing the cache
To clear the build cache, delete all files contained under the `docker/build/cache` directory.