diff options
author | Yehonal <yehonal.azeroth@gmail.com> | 2021-04-22 09:57:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-22 09:57:05 +0200 |
commit | 380f406248bdc1f15227a7b2f8a75b4bf922f730 (patch) | |
tree | 497bb589f7bd80073ea755f14e33505ff572353b /apps/installer | |
parent | 4a8faafaff2753349ea15aa602cc3816f4e42de6 (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 'apps/installer')
-rw-r--r-- | apps/installer/includes/functions.sh | 33 | ||||
-rw-r--r-- | apps/installer/includes/includes.sh | 17 | ||||
-rw-r--r-- | apps/installer/includes/os_configs/ubuntu.sh | 17 | ||||
-rw-r--r-- | apps/installer/main.sh | 9 |
4 files changed, 45 insertions, 31 deletions
diff --git a/apps/installer/includes/functions.sh b/apps/installer/includes/functions.sh index ff00f91e2c..1204362e7a 100644 --- a/apps/installer/includes/functions.sh +++ b/apps/installer/includes/functions.sh @@ -2,7 +2,7 @@ function inst_configureOS() { echo "Platform: $OSTYPE" case "$OSTYPE" in solaris*) echo "Solaris is not supported yet" ;; - darwin*) source "$AC_PATH_INSTALLER/includes/os_configs/osx.sh" ;; + darwin*) source "$AC_PATH_INSTALLER/includes/os_configs/osx.sh" ;; linux*) # If $OSDISTRO is set, use this value (from config.sh) if [ ! -z "$OSDISTRO" ]; then @@ -68,7 +68,6 @@ function inst_cleanCompile() { function inst_allInOne() { inst_configureOS - inst_updateRepo inst_compile dbasm_import true true true } @@ -153,7 +152,7 @@ function inst_module_install { if [[ "$b" != "none" ]]; then Joiner:add_repo "https://github.com/azerothcore/$res" "$res" "$b" && echo "Done, please re-run compiling and db assembly. Read instruction on module repository for more information" else - echo "Cannot install $res module: it doesn't exists or no version compatible with AC v$ACORE_VERSION are available" + echo "Cannot install $res module: it doesn't exists or no version compatible with AC v$ACORE_VERSION are available" fi echo ""; @@ -219,9 +218,31 @@ function inst_simple_restarter { } function inst_download_client_data { - local path="$AC_BINPATH_FULL" + # change the following version when needed + local VERSION=v10 + + echo "#######################" + echo "Client data downloader" + echo "#######################" + + # first check if it's defined in env, otherwise use the default + local path="${DATAPATH:-$AC_BINPATH_FULL}" + + dataVersionFile="$path/data-version" + + [ -f "$dataVersionFile" ] && source "$dataVersionFile" + + # create the path if doesn't exists + mkdir -p "$path" + + if [ "$VERSION" == "$INSTALLED_VERSION" ]; then + echo "Data $VERSION already installed. If you want to force the download remove the following file: $dataVersionFile" + return + fi echo "Downloading client data in: $path/data.zip ..." - curl -L https://github.com/wowgaming/client-data/releases/download/v10/data.zip > "$path/data.zip" \ - && unzip -o "$path/data.zip" -d "$path/" && rm "$path/data.zip" + curl -L https://github.com/wowgaming/client-data/releases/download/$VERSION/data.zip > "$path/data.zip" \ + && echo "unzip downloaded file..." && unzip -q -o "$path/data.zip" -d "$path/" \ + && echo "Remove downloaded file" && rm "$path/data.zip" \ + && echo "INSTALLED_VERSION=$VERSION" > "$dataVersionFile" } diff --git a/apps/installer/includes/includes.sh b/apps/installer/includes/includes.sh index 5afd4a159b..5b99c45cc5 100644 --- a/apps/installer/includes/includes.sh +++ b/apps/installer/includes/includes.sh @@ -6,24 +6,9 @@ source "$CURRENT_PATH/../../bash_shared/includes.sh" AC_PATH_INSTALLER="$AC_PATH_APPS/installer" - -J_VER_REQ="v0.8.3" -J_PATH="$AC_PATH_APPS/joiner" +J_PATH="$AC_PATH_DEPS/acore/joiner" J_PATH_MODULES="$AC_PATH_MODULES" -#install/update and include joiner -if [ ! -d "$J_PATH/.git" ]; then - git clone https://github.com/azerothcore/joiner "$J_PATH" -b master - git --git-dir="$J_PATH/.git/" --work-tree="$J_PATH/" reset --hard "$J_VER_REQ" -else - # legacy code, with new rev of joiner the update process is internally handled - _cur_branch=$(git --git-dir="$J_PATH/.git/" --work-tree="$J_PATH/" rev-parse --abbrev-ref HEAD) - _cur_ver=$(git --git-dir="$J_PATH/.git/" --work-tree="$J_PATH/" name-rev --tags --name-only $_cur_branch) - if [ "$_cur_ver" != "$J_VER_REQ" ]; then - git --git-dir="$J_PATH/.git" --work-tree="$J_PATH/" rev-parse && git --git-dir="$J_PATH/.git" --work-tree="$J_PATH/" fetch --tags origin master --quiet - git --git-dir="$J_PATH/.git/" --work-tree="$J_PATH/" reset --hard "$J_VER_REQ" - fi -fi source "$J_PATH/joiner.sh" if [ -f "$AC_PATH_INSTALLER/config.sh" ]; then diff --git a/apps/installer/includes/os_configs/ubuntu.sh b/apps/installer/includes/os_configs/ubuntu.sh index 6edaad51d6..63ef36d513 100644 --- a/apps/installer/includes/os_configs/ubuntu.sh +++ b/apps/installer/includes/os_configs/ubuntu.sh @@ -7,13 +7,16 @@ UBUNTU_VERSION=$(lsb_release -sr); sudo apt-get update -y -if [[ $CONTINUOUS_INTEGRATION ]]; then - sudo apt-get -y install build-essential libtool make cmake cmake-data clang openssl libgoogle-perftools-dev \ - libssl-dev libmysqlclient-dev libmysql++-dev libreadline6-dev zlib1g-dev libbz2-dev libace-dev mysql-client \ - libncurses5-dev ccache +# shared deps +sudo apt-get -y install make cmake clang curl unzip libmysqlclient-dev libace-dev + +if [[ $CONTINUOUS_INTEGRATION || $DOCKER ]]; then + sudo apt-get -y install build-essential libtool cmake-data openssl libgoogle-perftools-dev \ + libssl-dev libmysql++-dev libreadline6-dev zlib1g-dev libbz2-dev mysql-client \ + libncurses5-dev ccache curl unzip else - sudo apt-get install -y git cmake make gcc g++ clang libmysqlclient-dev \ + sudo apt-get install -y git gcc g++ \ libssl-dev libbz2-dev libreadline-dev libncurses-dev \ - mysql-server libace-6.* libace-dev curl unzip + mysql-server libace-6.* fi - + diff --git a/apps/installer/main.sh b/apps/installer/main.sh index 71df484244..b985b225b4 100644 --- a/apps/installer/main.sh +++ b/apps/installer/main.sh @@ -19,7 +19,8 @@ options=( "client-data: (gd): download client data from github repository (beta)" # 11 "run-worldserver (rw): execute a simple restarter for worldserver" # 12 "run-authserver (ra): execute a simple restarter for authserver" # 13 - "quit: Exit from this menu" # 14 + "docker (dr): Run docker tools" # 14 + "quit: Exit from this menu" # 15 ) function _switch() { @@ -66,7 +67,11 @@ function _switch() { ""|"ra"|"run-authserver"|"13") inst_simple_restarter authserver ;; - ""|"quit"|"14") + ""|"dr"|"docker"|"14") + DOCKER=1 denoRunFile "$AC_PATH_APPS/docker/docker-cmd.ts" "${@:2}" + exit + ;; + ""|"quit"|"15") echo "Goodbye!" exit ;; |