1
0
mirror of https://github.com/chatopera/cosin.git synced 2025-08-01 16:38:02 +08:00
Signed-off-by: Hai Liang Wang <hai@chatopera.com>
This commit is contained in:
Hai Liang Wang 2022-12-26 15:32:28 +08:00
parent 8f49a8023d
commit c8ea030b5e
12 changed files with 134 additions and 8 deletions

35
compose/bin/flush.sh Normal file
View File

@ -0,0 +1,35 @@
#! /bin/bash
###########################################
#
###########################################
# constants
baseDir=$(cd `dirname "$0"`;pwd)
cwdDir=$PWD
export PYTHONUNBUFFERED=1
export PATH=/opt/miniconda3/envs/venv-py3/bin:$PATH
export TS=$(date +%Y%m%d%H%M%S)
export DATE=`date "+%Y%m%d"`
export DATE_WITH_TIME=`date "+%Y%m%d-%H%M%S"` #add %3N as we want millisecond too
# functions
# main
[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return
cd $baseDir/..
echo "Remove docker containers and drop data in 5 seconds ..."
sleep 5
docker-compose down
echo "Clean up db ..."
rm -rf databases/redis/data
rm -rf databases/mysql/data
rm -rf databases/mongodb/data
echo "Pull docker images ..."
docker-compose pull
echo "Start services ..."
docker-compose up -d

2
compose/databases/mongodb/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

2
compose/databases/mysql/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

2
compose/databases/rabbitmq/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

2
compose/databases/redis/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

View File

@ -0,0 +1,49 @@
version: "3"
services:
contact-center:
image: ${CC_IMAGE:-cskefu/contact-center:v8}
restart: always
ports:
- "${SERVING_API_PORT:-6500}:6500"
volumes:
- ./contact-center/plugins:/opt/cskefu/plugins
environment:
- "JAVA_OPTS=-Xmx${CC_JAVA_XMX:-4096m} -Xms${CC_JAVA_XMS:-2048m} -XX:PermSize=256m -XX:MaxPermSize=1024m -Djava.net.preferIPv4Stack=true"
depends_on:
- mongodb
- redis
- mysql
mongodb:
image: "tutum/mongodb:3.2"
restart: always
volumes:
- ./databases/mongodb/data:/data/db
ports:
- "${MONGODB_PORT:-6303}:27017"
- "${MONGODB_PORT2:-6305}:27018"
environment:
- AUTH=no
redis:
image: cskefu/redis:5.0.5
environment:
- REDIS_PASSWORD=${DB_PASSWD:-123456}
restart: always
volumes:
- ./databases/redis/data:/data
ports:
- "${REDIS_PORT:-6301}:6379"
mysql:
image: cskefu/mysql:5.7
restart: always
environment:
- MYSQL_ROOT_PASSWORD=${DB_PASSWD:-123456}
- MYSQL_USER=admin
- MYSQL_PASSWORD=${DB_PASSWD:-123456}
ports:
- "${MYSQL_PORT:-6300}:3306"
volumes:
- ./databases/mysql/data:/var/lib/mysql
command: --max_allowed_packet=32505856

View File

@ -5,3 +5,6 @@
# is ignored with .gitignore # is ignored with .gitignore
COMPOSE_FILE=docker-compose.yml COMPOSE_FILE=docker-compose.yml
COMPOSE_PROJECT_NAME=cskefu_v8 COMPOSE_PROJECT_NAME=cskefu_v8
SERVING_API_PORT=6500
DB_PASSWD=123456

29
plugins/bin/buildAll.sh Normal file
View File

@ -0,0 +1,29 @@
#! /bin/bash
###########################################
# Install All public plugins
# Copyright (2019-2023) 北京华夏春松科技有限公司
###########################################
# constants
baseDir=$(cd `dirname "$0"`;pwd)
# functions
# main
[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return
echo "Remove old plugins ..."
set -x
rm -rf $baseDir/../../compose/contact-center/plugins/*.jar
set +x
cd $baseDir/..
echo "Inspect plugins -->" `pwd`
for x in `ls .`; do
cd $baseDir/..
if [ -d ./$x ] && [ $x != "bin" ] && [ -f $x/pom.xml ]; then
cd $x
echo "Install Plugin" `pwd`
mvn -DskipTests clean package
fi
done

View File

@ -92,7 +92,7 @@
<Export-Service>com.cskefu.plugins.sample.Sample</Export-Service> <Export-Service>com.cskefu.plugins.sample.Sample</Export-Service>
<Embed-Transitive>true</Embed-Transitive> <Embed-Transitive>true</Embed-Transitive>
</instructions> </instructions>
<buildDirectory>../../compose/server/plugins</buildDirectory> <buildDirectory>../../compose/contact-center/plugins</buildDirectory>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>

View File

@ -15,7 +15,10 @@ ENV SPRING_PROFILES_ACTIVE=docker
LABEL org.label-schema.vcs-ref=$VCS_REF \ LABEL org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/cskefu/cskefu" org.label-schema.vcs-url="https://github.com/cskefu/cskefu"
RUN rm -rf /opt/cskefu && mkdir /opt/cskefu && mkdir /opt/cskefu/felix-cache RUN rm -rf /opt/cskefu && mkdir /opt/cskefu && \
mkdir /opt/cskefu/felix-cache && \
mkdir /opt/cskefu/plugins
COPY ./target/serving-api.jar /opt/cskefu/serving-api.jar COPY ./target/serving-api.jar /opt/cskefu/serving-api.jar
COPY ./target/internal-bundles /opt/cskefu/internal-bundles COPY ./target/internal-bundles /opt/cskefu/internal-bundles
COPY ./assets/*.sh /opt/cskefu COPY ./assets/*.sh /opt/cskefu

View File

@ -30,12 +30,11 @@ if [ ! $? -eq 0 ]; then
exit 1 exit 1
fi fi
$baseDir/package.sh # $baseDir/package.sh # package happens with deploy.sh
# if [ ! $? -eq 0 ]; then
if [ ! $? -eq 0 ]; then # echo "Error happens on package."
echo "Error happens on package." # exit 1
exit 1 # fi
fi
set -x set -x
docker build --build-arg VCS_REF=$PACKAGE_VERSION \ docker build --build-arg VCS_REF=$PACKAGE_VERSION \