From c552aa5fd704a4ed0aa601f79256561a61352a35 Mon Sep 17 00:00:00 2001 From: AleaJactaEst Date: Thu, 28 Jun 2018 10:45:45 +0200 Subject: [PATCH] adding default web page to show some information, adding option to disable copy binary, change image docker --- .gitlab-ci.yml | 2 + .../stretch/x86_64/build-under-docker.sh | 48 +++++-- builder/debian/stretch/x86_64/build.sh | 29 ++-- server/common/rootweb/index.php | 133 ++++++++++++++++++ .../prepare_environment_container_64.sh | 33 +++++ .../servercontainer_configure_apache.sh | 1 - .../common/servercontainer_configure_patch.sh | 5 + .../common/servercontainer_init_apache.sh | 33 +++-- .../servercontainer_init_configure_envi.sh | 6 +- .../servercontainer_init_create_account.sh | 1 + .../common/servercontainer_launch_service.sh | 4 +- .../common/servercontainer_update_auto.sh | 43 +++++- server/debian/stretch/x86_64/Dockerfile | 2 +- .../x86_64/Dockerfile.khanat.container | 1 + .../debian/stretch/x86_64/server-container.sh | 22 +-- 15 files changed, 302 insertions(+), 61 deletions(-) create mode 100644 server/common/rootweb/index.php create mode 100644 server/common/rootweb/prepare_environment_container_64.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 26c62fc..5c500b6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -48,6 +48,8 @@ Linux server build: - cp $WORKDIR/server/debian/common/servercontainer_function.sh /opt/ - cp $WORKDIR/server/debian/common/* /opt/ext - cp $WORKDIR/server/debian/common/khaganat.cfg /opt/ext + - mkdir -p /opt/rootweb + - cp $WORKDIR/server/common/rootweb/* /opt/rootweb/ - echo -e 'export KHANAT_CLIENT_VERSION="1"\nexport UIDGAMESERVER=1000\nexport GIDGAMESERVER=1000\nexport DIRCLIENT="/opt/opennel_data"\nexport PACKAGECLIENT="smokey_linux64"' > /opt/khanat_config.sh - /opt/servercontainer_init_create_account.sh - mkdir -p /var/run/mysqld diff --git a/builder/debian/stretch/x86_64/build-under-docker.sh b/builder/debian/stretch/x86_64/build-under-docker.sh index e6f4e81..db8d1e8 100755 --- a/builder/debian/stretch/x86_64/build-under-docker.sh +++ b/builder/debian/stretch/x86_64/build-under-docker.sh @@ -18,8 +18,10 @@ # declare DIRBUILD="/opt/build/" +declare DIRCODEUSE="/opt/build/opennel-code" declare DIRCODE="/opt/ref/opennel-code" declare CXXFLAGS="" +declare -i DONTCOPYSOURCE=0 function usage() { @@ -35,15 +37,17 @@ options: --add-opts-cmake="string" : add option use on command cmake (generate Makefile) --add-opts-make="string" : add option use on command make --cxxflags=[String] : adding cxx flags when generate Makefile (and build) + --dont-copy-source : disable copy source, work directly on source (apply patch) EOF } function chrashed() { - echo "$(date "+%Y/%m/%d %H:%M:%S") ERROR - BUILD FAILED (code:$?)" + local code=$? + echo "$(date "+%Y/%m/%d %H:%M:%S") ERROR - BUILD (under docker) FAILED (code:$code)" if [ -n "$LOGFILE" ] then - echo "$(date "+%Y/%m/%d %H:%M:%S") ERROR - BUILD FAILED (code:$?)" >> $LOGFILE + echo "$(date "+%Y/%m/%d %H:%M:%S") ERROR - BUILD (under docker) FAILED (code:$code)" >> $LOGFILE fi exit 2 } @@ -78,6 +82,17 @@ function msg_debug() fi } +function patch_onlyifnotapply() +{ + # Check path is apply or not (if not apply patch) + msg_debug "check patch $1" + if ! patch -Z -t -R -s -f --dry-run -p 1 -i $1 1>/dev/null + then + msg_debug "patch $1" + patch -f -Z -t -p 1 -i $1 || exit 2 + fi +} + # # MAIN # @@ -115,6 +130,11 @@ do CXXFLAGS="$CXXFLAGS ${1#*=}" shift ;; + --dont-copy-source) + DONTCOPYSOURCE=1 + DIRCODEUSE="$DIRCODE" + shift + ;; *) msg_error "options '$1' not recognize" usage @@ -131,19 +151,24 @@ msg_debug "CMAKEOPTS:$CMAKEOPTS" msg_debug "MAKEOPTS:$MAKEOPTS" msg_debug "LOGFILE:$LOGFILE" msg_debug "CXXFLAGS:$CXXFLAGS" +msg_debug "DONTCOPYSOURCE:$DONTCOPYSOURCE" msg_info "CREATE BUILD DIRECTORY" mkdir -p ${DIRBUILD}/ || exit 2 -msg_info "COPY CODE" -mkdir -p ${DIRBUILD}/opennel-code -cp -pr $DIRCODE/* ${DIRBUILD}/opennel-code +if [[ $DONTCOPYSOURCE -eq 0 ]] +then + msg_info "COPY CODE" + mkdir -p ${DIRBUILD}/opennel-code + cp -pr $DIRCODE/* ${DIRBUILD}/opennel-code +fi msg_info "PATCH CODE" -cd ${DIRBUILD}/opennel-code/code -patch -Z -t -i ${DIRBUILD}/opennel-code/patch/libcrypto.patch || exit 2 -patch -Z -t -i ${DIRBUILD}/opennel-code/patch/libicuuc.patch || exit 2 -patch -Z -t -i ${DIRBUILD}/opennel-code/patch/01_ryzom_debug_callNativeCallBack.patch -p 1 || exit 2 +for patchfile in $(cat ${DIRCODEUSE}/patch/series) +do + cd ${DIRCODEUSE} + patch_onlyifnotapply ${DIRCODEUSE}/patch/$patchfile +done msg_info "PREPARE BUILD" msg_debug "cmake option : -DWITH_NEL=ON -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON -DWITH_STATIC_EXTERNAL=ON -DWITH_SYMBOLS=ON -DWITH_LUA52=ON -DWITH_RYZOM_PATCH=ON -DWITH_RYZOM_CUSTOM_PATCH_SERVER=ON ${CMAKEOPTS}" @@ -156,14 +181,11 @@ cd ${DIRBUILD}; CXXFLAGS="$CXXFLAGS" cmake -DWITH_NEL=ON \ -DWITH_RYZOM_PATCH=ON \ -DWITH_RYZOM_CUSTOM_PATCH_SERVER=ON \ ${CMAKEOPTS} \ - ${DIRBUILD}/opennel-code/code 1>>$LOGFILE 2>&1 || exit 2 + ${DIRCODEUSE}/code 1>>$LOGFILE 2>&1 || exit 2 msg_info "BUILD START" msg_debug "make option : $MAKEOPTS" cd ${DIRBUILD}; VERBOSE=1 make $MAKEOPTS 1>>$LOGFILE 2>&1 || exit 2 -msg_info "GENERATE PACKAGE" -cd ${DIRBUILD}; make package 1>>$LOGFILE 2>&1 || exit 2 - trap '' EXIT msg_info "BUILD END" diff --git a/builder/debian/stretch/x86_64/build.sh b/builder/debian/stretch/x86_64/build.sh index 08aa084..f6cbc0f 100755 --- a/builder/debian/stretch/x86_64/build.sh +++ b/builder/debian/stretch/x86_64/build.sh @@ -31,8 +31,9 @@ declare -i CLEANIMAGENONE=0 declare -i AUTODETEC=1 declare DOCKERBUILDOPT="" declare OPTION="" +declare -i DONTCOPYSOURCE=0 -declare IMAGEDOCKER="builder_khanat_debian_stretch_x86_64" +declare IMAGEDOCKER="opennel/builder_debian_stretch_x86_64" declare LOCALBUILDDIR="build/$IMAGEDOCKER" declare LOCALSRC="debian/stretch/x86_64" declare DIRPACKAGE="output/opennel_debian_stretch_x86_64/package" @@ -66,11 +67,13 @@ options: -m OPTS, --add-opts-docker=OPTS : Adding options on docker command (when build) --only-build-server : adding option to build only server --opennel-code-dir= : localization code khanat (khanat-opennel-code) + --dont-copy-source : disable copy source, work directly on source (apply patch) Example : cd [root Khanat directory] - ./build.sh -c -r -m '-m 20g' - ./build.sh -c -r -j 4 -a '-DWITH_SYMBOLS=ON' -a '-DWITH_RYZOM_TOOLS=OFF' -a '-DWITH_NEL_TOOLS=OFF' -m '-m 20g' -d + $0 -c -r -m '-m 20g' + $0 -c -r -j 4 -a '-DWITH_SYMBOLS=ON' -a '-DWITH_RYZOM_TOOLS=OFF' -a '-DWITH_NEL_TOOLS=OFF' -m '-m 20g' -d + $0 -a '-DCMAKE_BUILD_TYPE=Debug -DWITH_SYMBOLS=ON -DFINAL_VERSION=OFF' -f EOF } @@ -190,6 +193,11 @@ do CLEANIMAGENONE=1 shift ;; + --dont-copy-source) + DONTCOPYSOURCE=1 + OPTION="$OPTION --dont-copy-source" + shift + ;; *) msg_error "options '$1' not recognize" usage @@ -288,7 +296,7 @@ then --hostname=builder \ -u "$(id -u $USERNAME):$(id -g $USERNAME)" \ -v $rootdir/builder:/opt/ref/builder:ro \ - -v $codedir:/opt/ref/opennel-code:ro \ + -v $codedir:/opt/ref/opennel-code:rw \ -v $rootdir/build:/opt/build \ -v /etc/localtime:/etc/localtime:ro \ ${DOCKEROPTS} \ @@ -296,19 +304,6 @@ then /opt/ref/builder/${LOCALSRC}/build-under-docker.sh --add-opts-make="$MAKEOPTS" --add-opts-cmake="$CMAKEOPTS" --build-dir="/opt/${LOCALBUILDDIR}" --code-dir="/opt/ref/opennel-code" $OPTION || exit 2 fi -if [[ $BUILD -ne 0 ]] -then - msg_info "COPY PACKAGES" - mkdir -p "$rootdir/$DIRPACKAGE" - cd ${rootdir}; tar czf ${PACKAGEREF} \ - $codedir/code/ryzom/server/shard.screen.rc \ - $codedir/code/ryzom/common/* \ - $codedir/code/ryzom/client/* \ - $codedir/code/ryzom/server/* \ - $codedir/code/web/* || exit 2 - cp ${rootdir}/${LOCALBUILDDIR}/ryzomcore-*.tar.gz ${PACKAGEBIN} || exit 2 -fi - if [[ $CLEANDOCKER -ne 0 ]] then msg_info "CLEAN CONTAINER" diff --git a/server/common/rootweb/index.php b/server/common/rootweb/index.php new file mode 100644 index 0000000..2292038 --- /dev/null +++ b/server/common/rootweb/index.php @@ -0,0 +1,133 @@ + + + + DOCKER KHANAT + + + + + + + + +

+

KHANAT DOCKER ENVIRONMENT (TEST)
+
+ +
+ Administration +
+ phpmyadmin +
+ patch +
+
+ +
+ script to download and convert launcher on our instance: + prepare_environment_container_64.sh +
+
+ Account / Password + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AccountPasswordWhereComment
gameserverkhanatsshserver access
rootphpmyadmin(no password)
adminadminkhanataccount (administration)
testertesterkhanataccount (player)
+
+
+ Command to connect on khanat 'server' : +
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no gameserver@
+ Use sudo to switch on root account +
sudo bash
+
+

PHP :

+ + diff --git a/server/common/rootweb/prepare_environment_container_64.sh b/server/common/rootweb/prepare_environment_container_64.sh new file mode 100644 index 0000000..8e5b1a7 --- /dev/null +++ b/server/common/rootweb/prepare_environment_container_64.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +declare IMAGEKHANATSERVER="opennel/servercontainer_debian_stretch_x86_64" + +mkdir -p $HOME/Public + +echo "$(date "+%Y/%m/%d %H:%M:%S") Get ip address server khanat" +listcontainer="$(docker ps -qf 'status=running' -f 'ancestor='"${IMAGEKHANATSERVER}"'')" +if [[ ${#listcontainer[@]} -eq 1 ]] +then + ipaddress=$(docker inspect --format="{{ .NetworkSettings.IPAddress }}" ${listcontainer[@]}) +fi + +echo "$(date "+%Y/%m/%d %H:%M:%S") get client package" +wget http://$ipaddress/client/smokey_linux64.tar.gz -O smokey_linux64.tar.gz + +echo "$(date "+%Y/%m/%d %H:%M:%S") clean old client" +if [[ -d Khanat_Linux64 ]] +then + rm -rf Khanat_Linux64 || exit 2 +fi + +echo "$(date "+%Y/%m/%d %H:%M:%S") install new client" +#7z x -y $SRCKHANATCLIENT || exit 2 +#7z x -y -oKhanat_Linux64 $SRCKHANATCLIENTDEBUG || exit 2 +tar xvzf smokey_linux64.tar.gz || exit 2 + +echo "$(date "+%Y/%m/%d %H:%M:%S") configure client" +sed -i 's/lirria.khaganat.net/'$ipaddress'/g' Khanat_Linux64/client_default.cfg +echo -en "Client khanat installed & configured\nGo to Khanat_Linux64 directory and launch client\n" +echo -en "(cd Khanat_Linux64;./khanat_client)\n" + + diff --git a/server/debian/common/servercontainer_configure_apache.sh b/server/debian/common/servercontainer_configure_apache.sh index 2920128..8a0b998 100755 --- a/server/debian/common/servercontainer_configure_apache.sh +++ b/server/debian/common/servercontainer_configure_apache.sh @@ -97,7 +97,6 @@ chown_gameserver '/home/gameserver/log/apache2/error.log' || exit 2 touch /home/gameserver/log/apache2/other_vhosts_access.log || exit 2 chown_gameserver '/home/gameserver/log/apache2/other_vhosts_access.log' || exit 2 - ##################### # Start & Stop apache2 ##################### diff --git a/server/debian/common/servercontainer_configure_patch.sh b/server/debian/common/servercontainer_configure_patch.sh index 487c3f1..9ba74a1 100755 --- a/server/debian/common/servercontainer_configure_patch.sh +++ b/server/debian/common/servercontainer_configure_patch.sh @@ -237,6 +237,11 @@ wait_all_job || exit 2 #################################### msg_info "[$(basename $0):$LINENO] Prepare Patch" +# TODO - if ryzom.xml exist what's command to update (replace patch_gen createNewProduct) +if [ -f $PATCH_CLIENT_SYSTEM/patch_game/ryzom.xml ] +then + mv $PATCH_CLIENT_SYSTEM/patch_game/ryzom.xml $PATCH_CLIENT_SYSTEM/patch_game/ryzom.xml.old || exit 2 +fi cd $PATCH_CLIENT_SYSTEM;patch_gen createNewProduct patch_game/ryzom.xml 2>$KHANAT_HOME/log/configure/patch_createNewProduct.err 1>$KHANAT_HOME/log/configure/patch_createNewProduct.out || exit 2 cd $PATCH_CLIENT_SYSTEM;touch patch_game/Lirria.version || exit 2 sed -i -r 's/value="main"/value="khanat_lirria"/g' $PATCH_CLIENT_SYSTEM/patch_game/ryzom.xml || exit 2 diff --git a/server/debian/common/servercontainer_init_apache.sh b/server/debian/common/servercontainer_init_apache.sh index e9e7f91..b858c9c 100755 --- a/server/debian/common/servercontainer_init_apache.sh +++ b/server/debian/common/servercontainer_init_apache.sh @@ -86,6 +86,13 @@ cp /etc/phpmyadmin/config.inc.php /etc/phpmyadmin/config.inc.php.ref || exit 2 awk '{if($0 ~ /AllowNoPassword/){$1="";}; print $0;}' /etc/phpmyadmin/config.inc.php.ref > /etc/phpmyadmin/config.inc.php || exit 2 +#################################### +# Configure 1st page +#################################### +msg_debug "Configure 1st page" +create_dir_gameserver '/home/gameserver/rootweb' +cp /opt/rootweb/* /home/gameserver/rootweb/ || exit 2 + #################################### # configure phpmyadmin #################################### @@ -94,7 +101,7 @@ msg_debug "configure apache" cat << EOF > /etc/apache2/sites-available/000-default.conf # Default - + Options Indexes FollowSymLinks AllowOverride None Require all granted @@ -103,13 +110,13 @@ cat << EOF > /etc/apache2/sites-available/000-default.conf AddHandler application/x-httpd-php .php AddHandler application/x-httpd-php-source .phps - ServerName lirria.khaganat.net + ServerName lirria.khaganat.net - ServerAdmin webmaster@localhost - DocumentRoot /home/gameserver/khanat/khanatweb/public_php/ + ServerAdmin webmaster@localhost + DocumentRoot /home/gameserver/rootweb/ - ErrorLog \${APACHE_LOG_DIR}/error.log - CustomLog \${APACHE_LOG_DIR}/access.log combined + ErrorLog \${APACHE_LOG_DIR}/error.log + CustomLog \${APACHE_LOG_DIR}/access.log combined # Khanat Server Web @@ -119,13 +126,13 @@ cat << EOF > /etc/apache2/sites-available/000-default.conf AllowOverride None Require all granted
- ServerName lirria.khaganat.net + ServerName lirria.khaganat.net - ServerAdmin admin@localhost - DocumentRoot /home/gameserver/khanat/khanatweb/public_php + ServerAdmin admin@localhost + DocumentRoot /home/gameserver/khanat/khanatweb/public_php - ErrorLog \${APACHE_LOG_DIR}/error.log - CustomLog \${APACHE_LOG_DIR}/access.log combined + ErrorLog \${APACHE_LOG_DIR}/error.log + CustomLog \${APACHE_LOG_DIR}/access.log combined # Patch Server @@ -133,11 +140,11 @@ cat << EOF > /etc/apache2/sites-available/000-default.conf ServerName lirria.khaganat.net DocumentRoot /home/gameserver/khanat/patch_service/patch_game/patch/ - + Options -Indexes AllowOverride All Require all granted - + EOF diff --git a/server/debian/common/servercontainer_init_configure_envi.sh b/server/debian/common/servercontainer_init_configure_envi.sh index 4db1ff9..a19589e 100755 --- a/server/debian/common/servercontainer_init_configure_envi.sh +++ b/server/debian/common/servercontainer_init_configure_envi.sh @@ -124,9 +124,9 @@ alias l='ls \$LS_OPTIONS -lA' # alias mv='mv -i' # Autocompletion -if [ -f /etc/bash_completion ]; then - . /etc/bash_completion -fi +#if [ -f /etc/bash_completion ]; then +# . /etc/bash_completion +#fi export KHANAT_HOME=/home/gameserver export KHANAT_PATH=/home/gameserver/khanat diff --git a/server/debian/common/servercontainer_init_create_account.sh b/server/debian/common/servercontainer_init_create_account.sh index 60a9bdb..41512f4 100755 --- a/server/debian/common/servercontainer_init_create_account.sh +++ b/server/debian/common/servercontainer_init_create_account.sh @@ -75,6 +75,7 @@ msg_debug "group : $(id -g -n gameserver)" create_dir_gameserver '/home/gameserver/ext' create_dir_gameserver '/home/gameserver/khanat' +create_dir_gameserver '/home/gameserver/khanat/rootweb' #################################### # End diff --git a/server/debian/common/servercontainer_launch_service.sh b/server/debian/common/servercontainer_launch_service.sh index 751ed3c..d0c8d5f 100755 --- a/server/debian/common/servercontainer_launch_service.sh +++ b/server/debian/common/servercontainer_launch_service.sh @@ -34,7 +34,7 @@ function start_stop() nameservice=$1 printf RUNNING > /home/gameserver/khanat/server/${nameservice}/${nameservice}.state chown_gameserver /home/gameserver/khanat/server/${nameservice}/${nameservice}.state - nohup $2 + (cd $3; nohup $2) printf STOPPED > /home/gameserver/khanat/server/${nameservice}/${nameservice}.state } @@ -47,7 +47,7 @@ function launch_service() create_file_gameserver "/home/gameserver/log/khanat/$nameservice.out" create_file_gameserver "/home/gameserver/log/khanat/$nameservice.err" - start_stop "$1" "$2" 1>/home/gameserver/log/khanat/$nameservice.out 2>/home/gameserver/log/khanat/$nameservice.err & + start_stop "$1" "$2" "/home/gameserver/khanat/server/$1" 1>/home/gameserver/log/khanat/$nameservice.out 2>/home/gameserver/log/khanat/$nameservice.err & echo "$!" > /home/gameserver/khanat/server/$1/$1.pid #nohup $2 1>/dev/null 2>&1 & #echo "$!" > /home/gameserver/khanat/server/$1.pid diff --git a/server/debian/common/servercontainer_update_auto.sh b/server/debian/common/servercontainer_update_auto.sh index e872388..cce83fc 100755 --- a/server/debian/common/servercontainer_update_auto.sh +++ b/server/debian/common/servercontainer_update_auto.sh @@ -16,12 +16,49 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -/opt/ext/servercontainer_configure_link.sh || exit 2 +declare DIRFUNCTION="$(dirname $0)/servercontainer_function.sh" + +usage() +{ +cat << EOF +usage:$0 [options] + Launch update + +options: + -h, --help : Show this help + -d, --debug : Show debug message +EOF +} + +source $DIRFUNCTION +msg_info "[$(basename $0):$LINENO] => START" + +while test $# -gt 0 +do + case "$1" in + -h|--help) + usage + exit 1 + ;; + -d|--debug) + set_debug 1 + shift + ;; + *) + msg_error "[$(basename $0):$LINENO] options '$1' not recognize" + usage + exit 1 + ;; + esac +done + +/opt/ext/servercontainer_configure_link.sh $OPTION || msg_critical "[$(basename $0):$LINENO] Issue when create link" #/opt/ext/servercontainer_configure_mysql.sh || exit 2 #/opt/ext/servercontainer_configure_apache.sh || exit 2 #/opt/ext/servercontainer_configure_world.sh || exit 2 -su -c '/opt/ext/servercontainer_configure_khanat.sh' gameserver || exit 2 -su -c '/opt/ext/servercontainer_configure_patch.sh -d' gameserver || exit 2 +su -c "/opt/ext/servercontainer_configure_khanat.sh $OPTION" gameserver || msg_critical "[$(basename $0):$LINENO] Issue when configure khanat" +su -c "/opt/ext/servercontainer_configure_patch.sh $OPTION" gameserver || msg_critical "[$(basename $0):$LINENO] Issue when configure patch" +msg_info "[$(basename $0):$LINENO] => END" exit 0 diff --git a/server/debian/stretch/x86_64/Dockerfile b/server/debian/stretch/x86_64/Dockerfile index eed300a..3de778e 100644 --- a/server/debian/stretch/x86_64/Dockerfile +++ b/server/debian/stretch/x86_64/Dockerfile @@ -23,7 +23,7 @@ ENV HOSTNAME basic_server RUN apt-get update ; \ apt-get dist-upgrade -y ; \ - DEBIAN_FRONTEND=noninteractive apt-get install -y curl nano vim less bash-completion cron logrotate bsd-mailx openssh-server sudo net-tools lzma xdelta p7zip p7zip-full mysql-server apache2 php libapache2-mod-php php-mysql apache2-utils php-gd php-imagick rrdtool screen mcrypt php-mcrypt python3 phpmyadmin gdb + DEBIAN_FRONTEND=noninteractive apt-get install -y curl nano vim less bash-completion cron logrotate bsd-mailx openssh-server sudo net-tools lzma xdelta p7zip p7zip-full mysql-server apache2 php libapache2-mod-php php-mysql apache2-utils php-gd php-imagick rrdtool screen mcrypt php-mcrypt python3 phpmyadmin gdb valgrind electric-fence diff --git a/server/debian/stretch/x86_64/Dockerfile.khanat.container b/server/debian/stretch/x86_64/Dockerfile.khanat.container index 2fbc985..4a0a7bc 100644 --- a/server/debian/stretch/x86_64/Dockerfile.khanat.container +++ b/server/debian/stretch/x86_64/Dockerfile.khanat.container @@ -27,6 +27,7 @@ COPY server/debian/common/servercontainer_function.sh /opt/ COPY server/debian/common/servercontainer_init_* /opt/ COPY output/opennel_debian_stretch_x86_64/khanat_config.sh /opt/khanat_config.sh +COPY server/common/rootweb/* /opt/rootweb/ RUN /opt/servercontainer_init_create_account.sh RUN /opt/servercontainer_init_mysql.sh diff --git a/server/debian/stretch/x86_64/server-container.sh b/server/debian/stretch/x86_64/server-container.sh index 507601a..114a872 100755 --- a/server/debian/stretch/x86_64/server-container.sh +++ b/server/debian/stretch/x86_64/server-container.sh @@ -36,10 +36,12 @@ declare -i SHOWIPKHANATSERVER=0 declare METHODSTARTSERVER="--start-khanat-with-screen" declare -i CLEANIMAGENONE=0 declare DOCKERBUILDOPT="" +declare CONFIGUREAUTO="" +declare UPDATEAUTO="" declare IMAGEGENERICSERVER="opennel/server_generic_debian_stretch_x86_64" declare IMAGEKHANATSERVER="opennel/servercontainer_debian_stretch_x86_64" -declare LOCALBUILDDIR="build/builder_khanat_debian_stretch_x86_64" +declare LOCALBUILDDIR="build/opennel/builder_debian_stretch_x86_64" declare DIROUTPUT="output/opennel_debian_stretch_x86_64" declare ROOTDATAKHANAT="$DIROUTPUT/gameserver" declare DIRLOG="$ROOTDATAKHANAT/log" @@ -139,6 +141,8 @@ do ;; -d|--debug) DEBUG=1 + CONFIGUREAUTO="$CONFIGUREAUTO -d" + UPDATEAUTO="$UPDATEAUTO -d" shift ;; --ssh) @@ -230,7 +234,7 @@ do UPDATEDATA=1 shift ;; - --option-docker-build) + --option-docker-build=*) DOCKERBUILDOPT="$DOCKERBUILDOPT ${1#*=}" shift ;; @@ -483,7 +487,7 @@ then -v ${rootdir}/$DIRDATABASE:/home/gameserver/database:rw \ -v ${rootdir}/$DIRKHANAT:/home/gameserver/khanat:rw \ -v ${rootdir}/server/debian/common/:/opt/ext:ro \ - ${IMAGEKHANATSERVER} /opt/ext/servercontainer_configure_auto.sh || exit 2 + ${IMAGEKHANATSERVER} /opt/ext/servercontainer_configure_auto.sh $CONFIGUREAUTO || exit 2 fi if [[ $UPDATEDATA -ne 0 ]] @@ -500,7 +504,7 @@ then -v ${rootdir}/$DIRDATABASE:/home/gameserver/database:rw \ -v ${rootdir}/$DIRKHANAT:/home/gameserver/khanat:rw \ -v ${rootdir}/server/debian/common/:/opt/ext:ro \ - ${IMAGEKHANATSERVER} /opt/ext/servercontainer_update_auto.sh" + ${IMAGEKHANATSERVER} /opt/ext/servercontainer_update_auto.sh $UPDATEAUTO" cd $rootdir; docker run -it --hostname=khanat \ -v /etc/localtime:/etc/localtime:ro \ -v ${rootdir}/${LOCALBUILDDIR}/bin:/usr/local/bin:ro \ @@ -512,7 +516,7 @@ then -v ${rootdir}/$DIRDATABASE:/home/gameserver/database:rw \ -v ${rootdir}/$DIRKHANAT:/home/gameserver/khanat:rw \ -v ${rootdir}/server/debian/common/:/opt/ext:ro \ - ${IMAGEKHANATSERVER} /opt/ext/servercontainer_update_auto.sh + ${IMAGEKHANATSERVER} /opt/ext/servercontainer_update_auto.sh $UPDATEAUTO || exit 2 fi if [[ $LAUNCHKHANAT -ne 0 ]] @@ -530,12 +534,14 @@ then -v ${rootdir}/$DIRDATABASE:/home/gameserver/database:rw \ -v ${rootdir}/$DIRKHANAT:/home/gameserver/khanat:rw \ -v ${rootdir}/server/debian/common/:/opt/ext:ro \ + -v $rootdir/build:/opt/build:ro \ + -v ${OPENNEL_CODE_DIR}:/opt/ref/opennel-code:ro \ ${IMAGEKHANATSERVER} /opt/ext/servercontainer_launch_auto.sh $METHODSTARTSERVER -d + msg_info "[$(basename $0):$LINENO] CLEAR TERMINAL" + clear + tput clear fi trap '' EXIT -msg_info "[$(basename $0):$LINENO] CLEAR TERMINAL" -clear -tput clear msg_info "[$(basename $0):$LINENO] END"