mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-21 22:46:11 +00:00
adding update database to add domain name, remove old script
This commit is contained in:
parent
a7ae2fb306
commit
40940439c6
8 changed files with 58 additions and 582 deletions
48
dist/docker/builder/debian-8-amd64/Dockerfile
vendored
48
dist/docker/builder/debian-8-amd64/Dockerfile
vendored
|
@ -1,48 +0,0 @@
|
|||
# Dockerfile - Build new package server
|
||||
# Build for server debian-8 (amd64)
|
||||
#
|
||||
# Copyright : GNU/AGPLv3
|
||||
#
|
||||
# Created : 1 AUG 2017
|
||||
# Created by : AleaJactaEst
|
||||
|
||||
# to build :
|
||||
# $ docker build . -t builder_debian_8_adm64 --file dist/docker/builder/debian-8-amd64/Dockerfile
|
||||
|
||||
# to use this image :
|
||||
# (on root)
|
||||
# $ docker run -it --hostname=builder -v $PWD/dist:/opt/dist -v $PWD/code:/opt/code builder_debian_8_adm64 /bin/bash
|
||||
# (with your account)
|
||||
# $ docker run -it --hostname=builder -u "$(id -u $USERNAME):$(id -g $USERNAME)" -v $PWD/dist:/opt/dist -v $PWD/code:/opt/code builder_debian_8_adm64 /bin/bash
|
||||
|
||||
FROM amd64/debian:8
|
||||
MAINTAINER AleaJactaEst
|
||||
|
||||
ENV HOSTNAME builder
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get dist-upgrade
|
||||
|
||||
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y mysql-server
|
||||
RUN apt-get install -y apache2 php5 libapache2-mod-php5 php5-mysql apache2-utils php5-gd php5-imagick
|
||||
RUN apt-get install -y git libcurl4-openssl-dev libluabind-dev libfreetype6-dev libx11-dev libgl1-mesa-dev libxxf86vm-dev libxrandr-dev libxrender-dev libopenal-dev libogg-dev libvorbis-dev libxml2-dev cmake build-essential libpng12-dev libjpeg62-turbo-dev rrdtool bison libxmu-dev autoconf automake libmysqlclient-dev libgif-dev cpputest libssl-dev liblzma-dev unzip
|
||||
|
||||
RUN apt-get install -y wget
|
||||
|
||||
## Build & Install cpptest
|
||||
# Impossible to build release 1.1.0, 1.1.1, 1.1.2
|
||||
#RUN apt-get install -y wget autogen autoconf automake libtool libtool-bin
|
||||
#RUN mkdir -p /opt/src
|
||||
#RUN wget -q https://github.com/cpptest/cpptest/archive/1.0.5.tar.gz -O /opt/src/cpptest.tar.gz
|
||||
#RUN rm -rf /opt/src/cpptest
|
||||
#RUN tar xvf /opt/src/cpptest.tar.gz -C /opt/src --strip 1
|
||||
#RUN cd /opt/src/cpptest && ./autogen.sh && ./configure && make && make install
|
||||
|
||||
## Build & Install Build squish
|
||||
RUN mkdir -p /opt/src
|
||||
RUN cd /opt/src; wget -c https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/libsquish/squish-1.11.zip
|
||||
RUN cd /opt/src; unzip squish-1.11.zip
|
||||
COPY dist/docker/builder/squish-limit.patch /opt/squish-limit.patch
|
||||
RUN cd /opt/src/squish-1.11; patch -i /opt/squish-limit.patch
|
||||
RUN cd /opt/src/squish-1.11; make
|
||||
RUN cd /opt/src/squish-1.11; make install
|
|
@ -1,41 +0,0 @@
|
|||
#!/bin/bash
|
||||
# Script to build Khaganat
|
||||
# Copyright : GNU/AGPLv3
|
||||
#
|
||||
# Created : 1 AUG 2017
|
||||
# Created by : AleaJactaEst
|
||||
|
||||
declare DIRBUILD="/opt/code/build/"
|
||||
if [[ -n "$1" ]]
|
||||
then
|
||||
DIRBUILD="$1"
|
||||
fi
|
||||
declare LOGFILE="${DIRBUILD}/build.log"
|
||||
|
||||
function chrashed()
|
||||
{
|
||||
echo "$(date "+%Y/%m/%d %H:%M:%S") BUILD FAILED (code:$?)" >> $LOGFILE
|
||||
exit 2
|
||||
}
|
||||
|
||||
trap chrashed EXIT
|
||||
|
||||
mkdir -p ${DIRBUILD}/ || exit 2
|
||||
|
||||
if [[ -f ${DIRBUILD}/envi.sh ]]
|
||||
then
|
||||
echo "$(date "+%Y/%m/%d %H:%M:%S") LOAD ENVI" >> $LOGFILE
|
||||
source ${DIRBUILD}/envi.sh
|
||||
fi
|
||||
|
||||
echo "$(date "+%Y/%m/%d %H:%M:%S") BUILD START" >> $LOGFILE
|
||||
|
||||
cd ${DIRBUILD}; cmake -DWITH_NEL_TESTS=OFF -DWITH_RYZOM_CLIENT=OFF -DWITH_NEL=ON -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON -DWITH_DRIVER_OPENGL=OFF -DWITH_DRIVER_OPENAL=OFF -DWITH_NEL_SAMPLES=OFF -DWITH_SOUND=OFF ${CMAKEOPTS} .. 1>>$LOGFILE 2>&1 || exit 2
|
||||
|
||||
cd ${DIRBUILD}; make $MAKEOPTS 1>>$LOGFILE 2>&1 || exit 2
|
||||
|
||||
echo "$(date "+%Y/%m/%d %H:%M:%S") PACKAGE" > $LOGFILE
|
||||
cd ${DIRBUILD}; make package 1>>$LOGFILE 2>&1 || exit 2
|
||||
|
||||
trap '' EXIT
|
||||
echo "$(date "+%Y/%m/%d %H:%M:%S") BUILD END" >> $LOGFILE
|
200
dist/docker/builder/debian-8-amd64/build.sh
vendored
200
dist/docker/builder/debian-8-amd64/build.sh
vendored
|
@ -1,200 +0,0 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Script to build under docker
|
||||
#
|
||||
# Copyright : GNU/AGPLv3
|
||||
#
|
||||
# Created : 1 AUG 2017
|
||||
# Created by : AleaJactaEst
|
||||
|
||||
declare -i REMOVE=0
|
||||
declare -i IMAGE=1
|
||||
declare -i BUILD=1
|
||||
declare -i DEBUG=0
|
||||
declare JOBS=""
|
||||
declare CMAKEOPTS=""
|
||||
declare DIRBUILD=""
|
||||
declare CLEANDOCKER=0
|
||||
|
||||
declare IMAGEDOCKER="builder_debian_8_amd64"
|
||||
declare LOCALBUILDDIR="build_linux64"
|
||||
declare LOCALSRC="debian-8-amd64"
|
||||
|
||||
|
||||
usage()
|
||||
{
|
||||
cat << EOF
|
||||
usage:$0 [options]
|
||||
script to build under docker
|
||||
|
||||
Step:
|
||||
1) clean old build directory
|
||||
2) create image builder
|
||||
3) launch build under docker (launch script build-under-docker.sh)
|
||||
4) remove docker container with state exited
|
||||
|
||||
options:
|
||||
-h, --help : Show this help
|
||||
-d, --debug : Show debug message
|
||||
-r, --remove : Remove old build repository
|
||||
-i, --image-only : Just create image (no build)
|
||||
-b, --build-only : Just build (no create new image)
|
||||
-j [N], --jobs[=N] Allow N jobs at once; infinite jobs with no arg.
|
||||
-a OPTS, --add-opts-cmake=OPTS : Adding options on cmake command (before build)
|
||||
-c, --clean-container : remove all container in state Exited
|
||||
|
||||
Example :
|
||||
cd [root Khanat directory]
|
||||
dist/docker/builder/${LOCALSRC}/build.sh -c -r
|
||||
dist/docker/builder/${LOCALSRC}/build.sh -c -r -j 4 -a '-DWITH_SYMBOLS=ON' -a '-DWITH_RYZOM_TOOLS=OFF' -a '-DWITH_NEL_TOOLS=OFF'
|
||||
EOF
|
||||
}
|
||||
|
||||
while test $# -gt 0
|
||||
do
|
||||
case "$1" in
|
||||
-h|--help)
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
-d|--debug)
|
||||
DEBUG=1
|
||||
shift
|
||||
;;
|
||||
-c|--clean-container)
|
||||
CLEANDOCKER=1
|
||||
shift
|
||||
;;
|
||||
-r|--remove)
|
||||
REMOVE=1
|
||||
shift
|
||||
;;
|
||||
-i|--image-only)
|
||||
BUILD=0
|
||||
IMAGE=1
|
||||
shift
|
||||
;;
|
||||
-b|--build-only)
|
||||
BUILD=1
|
||||
IMAGE=0
|
||||
shift
|
||||
;;
|
||||
-j)
|
||||
shift
|
||||
# search next argument is value or new argument
|
||||
if [[ ${1:0:1} == "-" ]]
|
||||
then
|
||||
JOBS="-j"
|
||||
else
|
||||
JOBS="-j $1"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
--jobs*)
|
||||
if [[ ${1#*=} == "" ]]
|
||||
then
|
||||
JOBS="-j"
|
||||
else
|
||||
JOBS="-j ${1#*=}"
|
||||
fi
|
||||
shift
|
||||
;;
|
||||
-a)
|
||||
shift
|
||||
CMAKEOPTS="$CMAKEOPTS $1"
|
||||
shift
|
||||
;;
|
||||
--add-opts-cmake=*)
|
||||
CMAKEOPTS="$CMAKEOPTS ${1#*=}"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
echo "*** ERROR : options '$1' not recoginze"
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
function chrashed()
|
||||
{
|
||||
echo "$(date "+%Y/%m/%d %H:%M:%S") BUILD FAILED (code:$?)"
|
||||
exit 2
|
||||
}
|
||||
|
||||
trap chrashed EXIT
|
||||
|
||||
if [[ $DEBUG -ne 0 ]]
|
||||
then
|
||||
echo "prg: $0"
|
||||
fi
|
||||
|
||||
calldir="$(dirname $0)"
|
||||
if [[ ${calldir:0:1} == "/" ]]
|
||||
then
|
||||
basedir="${calldir}"
|
||||
else
|
||||
basedir="$(pwd)/${calldir}"
|
||||
fi
|
||||
|
||||
rootdir="$(dirname $(dirname $(dirname $(dirname ${basedir}))))"
|
||||
|
||||
docker -v 1>/dev/null
|
||||
if [[ $? -ne 0 ]]
|
||||
then
|
||||
echo "*** ERROR docker not installed"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
DIRBUILD="${rootdir}/code/${LOCALBUILDDIR}"
|
||||
|
||||
if [[ $DEBUG -ne 0 ]]
|
||||
then
|
||||
echo "calldir: $calldir"
|
||||
echo "basedir: $basedir"
|
||||
echo "rootdir: $rootdir"
|
||||
echo "JOBS: '$JOBS'"
|
||||
echo "CMAKEOPTS: '$CMAKEOPTS'"
|
||||
fi
|
||||
|
||||
mkdir -p "${DIRBUILD}"
|
||||
if [[ $REMOVE -ne 0 ]]
|
||||
then
|
||||
echo "$(date "+%Y/%m/%d %H:%M:%S") REMOVE OLD BUILD"
|
||||
rm -rf ${DIRBUILD}/* || exit 2
|
||||
fi
|
||||
|
||||
touch ${DIRBUILD}/build.log
|
||||
|
||||
cat << EOF > ${DIRBUILD}/envi.sh
|
||||
#!/bin/bash
|
||||
export MAKEOPTS="$JOBS"
|
||||
export CMAKEOPTS="$CMAKEOPTS"
|
||||
EOF
|
||||
|
||||
if [[ $IMAGE -ne 0 ]]
|
||||
then
|
||||
echo "$(date "+%Y/%m/%d %H:%M:%S") GENERATE DOCKER IMAGE"
|
||||
cd $rootdir; docker build . -t ${IMAGEDOCKER} \
|
||||
--file "${basedir}/Dockerfile" || exit 2
|
||||
fi
|
||||
|
||||
if [[ $BUILD -ne 0 ]]
|
||||
then
|
||||
echo "$(date "+%Y/%m/%d %H:%M:%S") BUILD"
|
||||
cd $rootdir; docker run -it \
|
||||
--hostname=builder \
|
||||
-u "$(id -u $USERNAME):$(id -g $USERNAME)" \
|
||||
-v $rootdir/dist:/opt/dist \
|
||||
-v $rootdir/code:/opt/code \
|
||||
${IMAGEDOCKER} \
|
||||
/opt/dist/docker/builder/${LOCALSRC}/build-under-docker.sh "/opt/code/${LOCALBUILDDIR}/" || exit 2
|
||||
fi
|
||||
|
||||
if [[ $CLEANDOCKER -ne 0 ]]
|
||||
then
|
||||
docker rm --force `docker ps -qf 'status=exited' -f "ancestor=${IMAGEDOCKER}"` || exit 2
|
||||
fi
|
||||
|
||||
trap '' EXIT
|
||||
echo "$(date "+%Y/%m/%d %H:%M:%S") END"
|
48
dist/docker/builder/debian-8-i686/Dockerfile
vendored
48
dist/docker/builder/debian-8-i686/Dockerfile
vendored
|
@ -1,48 +0,0 @@
|
|||
# Dockerfile - Build new package server
|
||||
# Build for server debian-8 (amd64)
|
||||
#
|
||||
# Copyright : GNU/AGPLv3
|
||||
#
|
||||
# Created : 1 AUG 2017
|
||||
# Created by : AleaJactaEst
|
||||
|
||||
# to build :
|
||||
# $ docker build . -t builder_debian_8_i686 --file dist/docker/builder/debian-8-i686/Dockerfile
|
||||
|
||||
# to use this image :
|
||||
# (on root)
|
||||
# $ docker run -it --hostname=builder -v $PWD/dist:/opt/dist -v $PWD/code:/opt/code builder_debian_8_i686 /bin/bash
|
||||
# (with your account)
|
||||
# $ docker run -it --hostname=builder -u "$(id -u $USERNAME):$(id -g $USERNAME)" -v $PWD/dist:/opt/dist -v $PWD/code:/opt/code builder_debian_8_i686 /bin/bash
|
||||
|
||||
FROM debian:8
|
||||
MAINTAINER AleaJactaEst
|
||||
|
||||
ENV HOSTNAME builder
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get dist-upgrade -y
|
||||
|
||||
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y mysql-server
|
||||
RUN apt-get install -y apache2 php5 libapache2-mod-php5 php5-mysql apache2-utils php5-gd php5-imagick
|
||||
RUN apt-get install -y git libcurl4-openssl-dev libluabind-dev libfreetype6-dev libx11-dev libgl1-mesa-dev libxxf86vm-dev libxrandr-dev libxrender-dev libopenal-dev libogg-dev libvorbis-dev libxml2-dev cmake build-essential libpng12-dev libjpeg62-turbo-dev rrdtool bison libxmu-dev autoconf automake libmysqlclient-dev libgif-dev cpputest libssl-dev liblzma-dev unzip
|
||||
|
||||
RUN apt-get install -y wget
|
||||
|
||||
## Build & Install cpptest
|
||||
# Impossible to build release 1.1.0, 1.1.1, 1.1.2
|
||||
#RUN apt-get install -y wget autogen autoconf automake libtool libtool-bin
|
||||
#RUN mkdir -p /opt/src
|
||||
#RUN wget -q https://github.com/cpptest/cpptest/archive/1.0.5.tar.gz -O /opt/src/cpptest.tar.gz
|
||||
#RUN rm -rf /opt/src/cpptest
|
||||
#RUN tar xvf /opt/src/cpptest.tar.gz -C /opt/src --strip 1
|
||||
#RUN cd /opt/src/cpptest && ./autogen.sh && ./configure && make && make install
|
||||
|
||||
## Build & Install Build squish
|
||||
RUN mkdir -p /opt/src
|
||||
RUN cd /opt/src; wget -c https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/libsquish/squish-1.11.zip
|
||||
RUN cd /opt/src; unzip squish-1.11.zip
|
||||
COPY dist/docker/builder/squish-limit.patch /opt/squish-limit.patch
|
||||
RUN cd /opt/src/squish-1.11; patch -i /opt/squish-limit.patch
|
||||
RUN cd /opt/src/squish-1.11; make
|
||||
RUN cd /opt/src/squish-1.11; make install
|
|
@ -1,41 +0,0 @@
|
|||
#!/bin/bash
|
||||
# Script to build Khaganat
|
||||
# Copyright : GNU/AGPLv3
|
||||
#
|
||||
# Created : 1 AUG 2017
|
||||
# Created by : AleaJactaEst
|
||||
|
||||
declare DIRBUILD="/opt/code/build/"
|
||||
if [[ -n "$1" ]]
|
||||
then
|
||||
DIRBUILD="$1"
|
||||
fi
|
||||
declare LOGFILE="${DIRBUILD}/build.log"
|
||||
|
||||
function chrashed()
|
||||
{
|
||||
echo "$(date "+%Y/%m/%d %H:%M:%S") BUILD FAILED (code:$?)" >> $LOGFILE
|
||||
exit 2
|
||||
}
|
||||
|
||||
trap chrashed EXIT
|
||||
|
||||
mkdir -p ${DIRBUILD}/ || exit 2
|
||||
|
||||
if [[ -f ${DIRBUILD}/envi.sh ]]
|
||||
then
|
||||
echo "$(date "+%Y/%m/%d %H:%M:%S") LOAD ENVI" >> $LOGFILE
|
||||
source ${DIRBUILD}/envi.sh
|
||||
fi
|
||||
|
||||
echo "$(date "+%Y/%m/%d %H:%M:%S") BUILD START" >> $LOGFILE
|
||||
|
||||
cd ${DIRBUILD}; cmake -DWITH_NEL_TESTS=OFF -DWITH_RYZOM_CLIENT=OFF -DWITH_NEL=ON -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON -DWITH_DRIVER_OPENGL=OFF -DWITH_DRIVER_OPENAL=OFF -DWITH_NEL_SAMPLES=OFF -DWITH_SOUND=OFF ${CMAKEOPTS} .. 1>>$LOGFILE 2>&1 || exit 2
|
||||
|
||||
cd ${DIRBUILD}; make $MAKEOPTS 1>>$LOGFILE 2>&1 || exit 2
|
||||
|
||||
echo "$(date "+%Y/%m/%d %H:%M:%S") PACKAGE" > $LOGFILE
|
||||
cd ${DIRBUILD}; make package 1>>$LOGFILE 2>&1 || exit 2
|
||||
|
||||
trap '' EXIT
|
||||
echo "$(date "+%Y/%m/%d %H:%M:%S") BUILD END" >> $LOGFILE
|
200
dist/docker/builder/debian-8-i686/build.sh
vendored
200
dist/docker/builder/debian-8-i686/build.sh
vendored
|
@ -1,200 +0,0 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Script to build under docker
|
||||
#
|
||||
# Copyright : GNU/AGPLv3
|
||||
#
|
||||
# Created : 1 AUG 2017
|
||||
# Created by : AleaJactaEst
|
||||
|
||||
declare -i REMOVE=0
|
||||
declare -i IMAGE=1
|
||||
declare -i BUILD=1
|
||||
declare -i DEBUG=0
|
||||
declare JOBS=""
|
||||
declare CMAKEOPTS=""
|
||||
declare DIRBUILD=""
|
||||
declare CLEANDOCKER=0
|
||||
|
||||
declare IMAGEDOCKER="builder_debian_8_i686"
|
||||
declare LOCALBUILDDIR="build_linux32"
|
||||
declare LOCALSRC="debian-8-i686"
|
||||
|
||||
|
||||
usage()
|
||||
{
|
||||
cat << EOF
|
||||
usage:$0 [options]
|
||||
script to build under docker
|
||||
|
||||
Step:
|
||||
1) clean old build directory
|
||||
2) create image builder
|
||||
3) launch build under docker (launch script build-under-docker.sh)
|
||||
4) remove docker container with state exited
|
||||
|
||||
options:
|
||||
-h, --help : Show this help
|
||||
-d, --debug : Show debug message
|
||||
-r, --remove : Remove old build repository
|
||||
-i, --image-only : Just create image (no build)
|
||||
-b, --build-only : Just build (no create new image)
|
||||
-j [N], --jobs[=N] Allow N jobs at once; infinite jobs with no arg.
|
||||
-a OPTS, --add-opts-cmake=OPTS : Adding options on cmake command (before build)
|
||||
-c, --clean-container : remove all container in state Exited
|
||||
|
||||
Example :
|
||||
cd [root Khanat directory]
|
||||
dist/docker/builder/${LOCALSRC}/build.sh -c -r
|
||||
dist/docker/builder/${LOCALSRC}/build.sh -c -r -j 4 -a '-DWITH_SYMBOLS=ON' -a '-DWITH_RYZOM_TOOLS=OFF' -a '-DWITH_NEL_TOOLS=OFF'
|
||||
EOF
|
||||
}
|
||||
|
||||
while test $# -gt 0
|
||||
do
|
||||
case "$1" in
|
||||
-h|--help)
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
-d|--debug)
|
||||
DEBUG=1
|
||||
shift
|
||||
;;
|
||||
-c|--clean-container)
|
||||
CLEANDOCKER=1
|
||||
shift
|
||||
;;
|
||||
-r|--remove)
|
||||
REMOVE=1
|
||||
shift
|
||||
;;
|
||||
-i|--image-only)
|
||||
BUILD=0
|
||||
IMAGE=1
|
||||
shift
|
||||
;;
|
||||
-b|--build-only)
|
||||
BUILD=1
|
||||
IMAGE=0
|
||||
shift
|
||||
;;
|
||||
-j)
|
||||
shift
|
||||
# search next argument is value or new argument
|
||||
if [[ ${1:0:1} == "-" ]]
|
||||
then
|
||||
JOBS="-j"
|
||||
else
|
||||
JOBS="-j $1"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
--jobs*)
|
||||
if [[ ${1#*=} == "" ]]
|
||||
then
|
||||
JOBS="-j"
|
||||
else
|
||||
JOBS="-j ${1#*=}"
|
||||
fi
|
||||
shift
|
||||
;;
|
||||
-a)
|
||||
shift
|
||||
CMAKEOPTS="$CMAKEOPTS $1"
|
||||
shift
|
||||
;;
|
||||
--add-opts-cmake=*)
|
||||
CMAKEOPTS="$CMAKEOPTS ${1#*=}"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
echo "*** ERROR : options '$1' not recoginze"
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
function chrashed()
|
||||
{
|
||||
echo "$(date "+%Y/%m/%d %H:%M:%S") BUILD FAILED (code:$?)"
|
||||
exit 2
|
||||
}
|
||||
|
||||
trap chrashed EXIT
|
||||
|
||||
if [[ $DEBUG -ne 0 ]]
|
||||
then
|
||||
echo "prg: $0"
|
||||
fi
|
||||
|
||||
calldir="$(dirname $0)"
|
||||
if [[ ${calldir:0:1} == "/" ]]
|
||||
then
|
||||
basedir="${calldir}"
|
||||
else
|
||||
basedir="$(pwd)/${calldir}"
|
||||
fi
|
||||
|
||||
rootdir="$(dirname $(dirname $(dirname $(dirname ${basedir}))))"
|
||||
|
||||
docker -v 1>/dev/null
|
||||
if [[ $? -ne 0 ]]
|
||||
then
|
||||
echo "*** ERROR docker not installed"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
DIRBUILD="${rootdir}/code/${LOCALBUILDDIR}"
|
||||
|
||||
if [[ $DEBUG -ne 0 ]]
|
||||
then
|
||||
echo "calldir: $calldir"
|
||||
echo "basedir: $basedir"
|
||||
echo "rootdir: $rootdir"
|
||||
echo "JOBS: '$JOBS'"
|
||||
echo "CMAKEOPTS: '$CMAKEOPTS'"
|
||||
fi
|
||||
|
||||
mkdir -p "${DIRBUILD}"
|
||||
if [[ $REMOVE -ne 0 ]]
|
||||
then
|
||||
echo "$(date "+%Y/%m/%d %H:%M:%S") REMOVE OLD BUILD"
|
||||
rm -rf ${DIRBUILD}/* || exit 2
|
||||
fi
|
||||
|
||||
touch ${DIRBUILD}/build.log
|
||||
|
||||
cat << EOF > ${DIRBUILD}/envi.sh
|
||||
#!/bin/bash
|
||||
export MAKEOPTS="$JOBS"
|
||||
export CMAKEOPTS="$CMAKEOPTS"
|
||||
EOF
|
||||
|
||||
if [[ $IMAGE -ne 0 ]]
|
||||
then
|
||||
echo "$(date "+%Y/%m/%d %H:%M:%S") GENERATE DOCKER IMAGE"
|
||||
cd $rootdir; docker build . -t ${IMAGEDOCKER} \
|
||||
--file "${basedir}/Dockerfile" || exit 2
|
||||
fi
|
||||
|
||||
if [[ $BUILD -ne 0 ]]
|
||||
then
|
||||
echo "$(date "+%Y/%m/%d %H:%M:%S") BUILD"
|
||||
cd $rootdir; docker run -it \
|
||||
--hostname=builder \
|
||||
-u "$(id -u $USERNAME):$(id -g $USERNAME)" \
|
||||
-v $rootdir/dist:/opt/dist \
|
||||
-v $rootdir/code:/opt/code \
|
||||
${IMAGEDOCKER} \
|
||||
/opt/dist/docker/builder/${LOCALSRC}/build-under-docker.sh "/opt/code/${LOCALBUILDDIR}/" || exit 2
|
||||
fi
|
||||
|
||||
if [[ $CLEANDOCKER -ne 0 ]]
|
||||
then
|
||||
docker rm --force `docker ps -qf 'status=exited' -f "ancestor=${IMAGEDOCKER}"` || exit 2
|
||||
fi
|
||||
|
||||
trap '' EXIT
|
||||
echo "$(date "+%Y/%m/%d %H:%M:%S") END"
|
49
dist/docker/server/debian/init-khanat.sh
vendored
49
dist/docker/server/debian/init-khanat.sh
vendored
|
@ -113,6 +113,8 @@ service apache2 restart || exit 2
|
|||
mysql -u root -e "CREATE USER 'shard'@'localhost' IDENTIFIED BY '';" || exit 2
|
||||
mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'shard'@'localhost' WITH GRANT OPTION;" || exit 2
|
||||
|
||||
## DATABASE
|
||||
|
||||
# launch web configuration for ryzom
|
||||
# -H 'Accept-Encoding: gzip, deflate'
|
||||
curl 'http://localhost:40916/setup/install.php' \
|
||||
|
@ -145,13 +147,58 @@ curl 'http://localhost:40916/setup/install.php' \
|
|||
'&amsLibDatabase=nel_ams_lib'\
|
||||
'&amsAdminUsername=admin'\
|
||||
'&amsAdminPassword=admin'\
|
||||
'&nelDomainName=mini01'\
|
||||
'&nelDomainName=Lirria'\
|
||||
'&domainDatabase=ring_mini01'\
|
||||
'&submit=Configure' \
|
||||
-o /opt/setup.log || exit 2
|
||||
|
||||
grep "Domain role successfully installed" /opt/setup.log >/dev/null || exit 2
|
||||
|
||||
# configure domain
|
||||
addressip=$(hostname -I)
|
||||
mysql -u root -e "use nel;
|
||||
INSERT INTO nel.domain (domain_id, domain_name, status, patch_version, backup_patch_url, patch_urls, login_address, session_manager_address, ring_db_name, web_host, web_host_php, description) VALUES ('12', 'Lirria', 'ds_open', '0', '$addressip:23001', '$addressip/patch', '$addressip:49998', '$addressip:49999', 'ring_mini01', '$addressip:30000', '$addressip:40916', NULL);" || exit 2
|
||||
|
||||
mysql -u root -e "use nel;
|
||||
INSERT INTO nel.shard (ShardId, domain_id, WsAddr, NbPlayers, Name, Online, Version, FixedSessionId, State, MOTD) VALUES ('302', '12', '$addressip:', '0', 'Lirria shard', '0', '', '0', 'ds_open', '');" || exit 2
|
||||
|
||||
mysql -u root -e "use nel;
|
||||
INSERT INTO nel_tool.neltool_domains (domain_id, domain_name, domain_as_host, domain_as_port, domain_rrd_path, domain_las_admin_path, domain_las_local_path, domain_application, domain_sql_string, domain_hd_check, domain_mfs_web, domain_cs_sql_string) VALUES ('12', 'Lirria', '$addressip', '46700', '/home/compil/ryzom/server/save_shard/rrd_graphs', '', '', 'ryzom_open', '', '0', NULL, NULL);" || exit 2
|
||||
|
||||
mysql -u root -e "use nel;
|
||||
INSERT INTO nel_tool.neltool_shards (shard_id, shard_name, shard_as_id, shard_domain_id, shard_lang, shard_restart) VALUES ('302', 'open', 'open', '12', 'fr', '0');" || exit 2
|
||||
|
||||
mysql -u root -e "use nel;
|
||||
INSERT INTO nel_tool.neltool_user_domains (user_domain_id, user_domain_user_id, user_domain_domain_id) VALUES ('1', '1', '12');" || exit 2
|
||||
|
||||
mysql -u root -e "use nel;
|
||||
INSERT INTO nel_tool.neltool_user_shards (user_shard_id, user_shard_user_id, user_shard_shard_id, user_shard_domain_id) VALUES ('1', '1', '302', '12');" || exit 2
|
||||
|
||||
mysql -u root -e "use ring_mini01;
|
||||
INSERT INTO ring_mini01.sessions (session_id, session_type, title, owner, plan_date, start_date, description, orientation, level, rule_type, access_type, state, host_shard_id, subscription_slots, reserved_slots, free_slots, estimated_duration, final_duration, folder_id, lang, icone, anim_mode, race_filter, religion_filter, guild_filter, shard_filter, level_filter, subscription_closed, newcomer) VALUES ('302', 'st_mainland', '', '0', '2005-09-21 12:41:33.000000', '2005-08-31 00:00:00.000000', '', 'so_other', 'sl_a', 'rt_strict', 'at_private', 'ss_planned', '0', '0', '0', '0', 'et_short', '0', '0', '', '', 'am_dm', '', '', 'gf_only_my_guild', 'sf_shard00,sf_shard01,sf_shard02,sf_shard03,sf_shard04,sf_shard05,sf_shard06,sf_shard07,sf_shard08,sf_shard09,sf_shard10,sf_shard11,sf_shard12,sf_shard13,sf_shard14,sf_shard15,sf_shard16,sf_shard17,sf_shard18,sf_shard19,sf_shard20,sf_shard21,sf_shard22,sf_shard23,sf_shard24,sf_shard25,sf_shard26,sf_shard27,sf_shard28,sf_shard29,sf_shard30', 'lf_a,lf_b,lf_c,lf_d,lf_e,lf_f', '0', '0');" || exit 2
|
||||
|
||||
## Create an user
|
||||
# tester / tester
|
||||
curl 'http://localhost:40916/ams/index.php' \
|
||||
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' \
|
||||
-H 'Accept-Language: en-US' \
|
||||
-H 'Connection: keep-alive' \
|
||||
-H 'Cookie: PHPSESSID=lsoumn9f0ljgm3vo3hgjdead03' \
|
||||
-H 'DNT: 1' \
|
||||
-H 'Host: localhost:40916' \
|
||||
-H 'Referer: http://localhost:40916/ams/index.php?page=register' \
|
||||
-H 'Upgrade-Insecure-Requests: 1' \
|
||||
-H 'User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:6.0) Gecko/20100101 Firefox/6.0' \
|
||||
-H 'Content-Type: application/x-www-form-urlencoded' \
|
||||
--data 'Username=tester&Password=tester&ConfirmPass=tester&Email=tester%40get2mail.fr&TaC=on&function=add_user' \
|
||||
-o /opt/account_tester.log || exit 2
|
||||
|
||||
mysql -u root -e "use nel;
|
||||
UPDATE nel.permission SET AccessPrivilege = 'OPEN,DEV,RESTRICTED';
|
||||
" || exit 2
|
||||
|
||||
###
|
||||
|
||||
# create link resource
|
||||
# Les dossiers :
|
||||
ln -s $RYDATA/collisions $RYZOM_PATH/server/
|
||||
|
|
|
@ -196,9 +196,17 @@ then
|
|||
then
|
||||
KHANATSERVER=1
|
||||
fi
|
||||
fi
|
||||
|
||||
(cd $rootdir; cp ${rootdir}/code/${LOCALBUILDDIR}/ryzomcore-0.12.0..tar.gz ${rootdir}/ryzomcore.tar.gz) || exit 2
|
||||
sumsrc=$(md5sum ${rootdir}/code/${LOCALBUILDDIR}/ryzomcore-0.12.0..tar.gz | awk '{print $1}')
|
||||
sumdst=$(md5sum ${rootdir}/ryzomcore.tar.gz | awk '{print $1}')
|
||||
msg_debug "ryzomcore checksum src:$sumsrc dst:$sumdst"
|
||||
if [[ "$sumsrc" != "$sumdst" ]]
|
||||
then
|
||||
msg_debug "copy ryzomcore"
|
||||
cp ${rootdir}/code/${LOCALBUILDDIR}/ryzomcore-0.12.0..tar.gz ${rootdir}/ryzomcore.tar.gz || exit 2
|
||||
KHANATSERVER=1
|
||||
fi
|
||||
fi
|
||||
|
||||
DIRBUILD="${rootdir}/code/${LOCALBUILDDIR}"
|
||||
|
||||
|
@ -273,7 +281,6 @@ fi
|
|||
if [[ $KHANATSERVER -ne 0 ]]
|
||||
then
|
||||
msg_info "GENERATE DOCKER IMAGE KHANAT SERVER"
|
||||
ls ${rootdir}/code/${LOCALBUILDDIR}/ryzomcore.tar.gz
|
||||
cd $rootdir; docker build . -t ${IMAGEKHANATSERVER} \
|
||||
--file "${basedir}/Dockerfile.khanat" || exit 2
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue