summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorYehonal <yehonal.azeroth@gmail.com>2021-04-22 09:57:05 +0200
committerGitHub <noreply@github.com>2021-04-22 09:57:05 +0200
commit380f406248bdc1f15227a7b2f8a75b4bf922f730 (patch)
tree497bb589f7bd80073ea755f14e33505ff572353b /bin
parent4a8faafaff2753349ea15aa602cc3816f4e42de6 (diff)
Feat(Docker/bash): docker-compose system rework (#4488)
## ⚠️ATTENTION! ⚠️ Upgrading procedure: **Database:** After this PR will be merged you need to backup your DB first (you can use the db-assembler or any mysql client to generate the dump) and restore it after. The reason is that we use now docker named volumes instead of binded ones to improve performance. **Conf & client data**: if you use the default configuration, both the etc and the data folder are now available inside the **/env/docker**. Finally, you can cleanup the /docker folder previously used by our system. ## Changes Proposed: This PR will implement the [devcontainer ](https://code.visualstudio.com/docs/remote/containers) feature for VSCode. Allowing us to develop and debug directly within the container in the same way on all OSes. * Implemented support for vscode dev-container feature by remote-extension suite * Docker performance optimizations for MacOS and non-linux hosts * Bash system improvements * Implemented first command using Deno runtime environment (typescript) and [commander.js] * Implemented wait mechanism for db_assembler * Implemented db migration command * possibility to run the authserver and worldserver with GDB using the integrated simple-restarter * Implemented docker multi-stage mechanism to use one single Dockerfile for all the services * client-data downloader now creates a placeholder to avoid downloading the same version of data files multiple times * deployment of pre-compiled docker images on [docker hub](https://hub.docker.com/u/acore), you can test them [here](https://github.com/azerothcore/acore-docker)
Diffstat (limited to 'bin')
-rwxr-xr-xbin/acore-db-asm5
-rwxr-xr-xbin/acore-docker-build18
-rwxr-xr-xbin/acore-docker-build-no-scripts9
-rwxr-xr-xbin/acore-docker-generate-etc11
-rwxr-xr-xbin/acore-docker-remove-build-cache14
-rwxr-xr-xbin/acore-subrepo-update34
6 files changed, 46 insertions, 45 deletions
diff --git a/bin/acore-db-asm b/bin/acore-db-asm
deleted file mode 100755
index 962a70b233..0000000000
--- a/bin/acore-db-asm
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-
-CUR_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-
-source "$CUR_PATH/../apps/db_assembler/db_assembler.sh"
diff --git a/bin/acore-docker-build b/bin/acore-docker-build
index 5ec93feafb..1e3d050d76 100755
--- a/bin/acore-docker-build
+++ b/bin/acore-docker-build
@@ -1,9 +1,15 @@
#!/usr/bin/env bash
-docker build -t acbuild -f docker/build/Dockerfile .
+bash acore.sh compiler build && bash acore.sh db-assembler import-all
+
+CUR_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
+ENV_PATH=$(readlink -f "$CUR_PATH/../env")
+
+echo "Generating confs..."
+cp -n "$ENV_PATH/docker/etc/worldserver.conf.dockerdist" "$ENV_PATH/dist/etc/worldserver.conf"
+cp -n "$ENV_PATH/docker/etc/authserver.conf.dockerdist" "$ENV_PATH/dist/etc/authserver.conf"
+
+echo "Fixing EOL..."
+dos2unix "$ENV_PATH/dist/etc/"*
-docker run \
- -v /"$(pwd)"/docker/build/cache:/azerothcore/build \
- -v /"$(pwd)"/docker/worldserver/bin:/binworldserver \
- -v /"$(pwd)"/docker/authserver/bin:/binauthserver \
- acbuild
diff --git a/bin/acore-docker-build-no-scripts b/bin/acore-docker-build-no-scripts
deleted file mode 100755
index a0c80a5e33..0000000000
--- a/bin/acore-docker-build-no-scripts
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/usr/bin/env bash
-
-docker build --build-arg ENABLE_SCRIPTS=0 -t acbuild -f docker/build/Dockerfile .
-
-docker run \
- -v /"$(pwd)"/docker/build/cache:/azerothcore/build \
- -v /"$(pwd)"/docker/worldserver/bin:/binworldserver \
- -v /"$(pwd)"/docker/authserver/bin:/binauthserver \
- acbuild
diff --git a/bin/acore-docker-generate-etc b/bin/acore-docker-generate-etc
deleted file mode 100755
index c6062088a0..0000000000
--- a/bin/acore-docker-generate-etc
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/usr/bin/env bash
-
-cp src/server/worldserver/worldserver.conf.dist docker/worldserver/etc/worldserver.conf.dist
-cp src/server/authserver/authserver.conf.dist docker/authserver/etc/authserver.conf.dist
-
-cp docker/worldserver/etc/worldserver.conf.dockerdist docker/worldserver/etc/worldserver.conf
-cp docker/authserver/etc/authserver.conf.dockerdist docker/authserver/etc/authserver.conf
-
-if [ $OSTYPE = msys ]; then
- dos2unix docker/worldserver/etc/* docker/authserver/etc/*
-fi
diff --git a/bin/acore-docker-remove-build-cache b/bin/acore-docker-remove-build-cache
deleted file mode 100755
index d455f2a976..0000000000
--- a/bin/acore-docker-remove-build-cache
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env bash
-
-if [ "$(id -u)" != "0" ] && [ "$OSTYPE" != "msys" ] ; then
- echo "Please run the script with sudo"
-else
- rm -rf ./docker/build/cache/CMakeFiles
- rm -rf ./docker/build/cache/deps
- rm -rf ./docker/build/cache/src
- rm ./docker/build/cache/*.cmake
- rm ./docker/build/cache/*.txt
- rm ./docker/build/cache/*.h
- rm ./docker/build/cache/*.cpp
- rm ./docker/build/cache/Makefile
-fi
diff --git a/bin/acore-subrepo-update b/bin/acore-subrepo-update
new file mode 100755
index 0000000000..bc05e4a042
--- /dev/null
+++ b/bin/acore-subrepo-update
@@ -0,0 +1,34 @@
+#!/usr/bin/env bash
+
+#######################
+#
+# README
+#
+# This script is used to automatically update
+# submodules and subrepos included in this project
+# Subrepo are updated in bidirectional way (pull + push)
+# because they are intended to be developed by this organization
+#
+# NOTE: only maintainers and CI should run this script and
+# keep it updated
+#
+#######################
+
+set -e
+ROOT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/../"
+# update all submodules
+git submodule update --init --recursive
+git submodule foreach git pull origin master
+# include libraries for git subrepo
+source "$ROOT_PATH/deps/git-subrepo/.rc"
+source "$ROOT_PATH/deps/acore/bash-lib/src/git-utils/subrepo.sh"
+
+echo "> Pulling and update all subrepos"
+
+subrepoUpdate https://github.com/azerothcore/bash-lib master deps/acore/bash-lib
+
+subrepoUpdate https://github.com/azerothcore/cmake-utils master deps/acore/cmake-utils
+
+subrepoUpdate https://github.com/azerothcore/mysql-tools master deps/acore/mysql-tools
+
+subrepoUpdate https://github.com/azerothcore/joiner master deps/acore/joiner