feat: automated deployment script

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
pull/437/head
Xinwei Xiong(cubxxw-openim) 2 years ago
parent 04264ae2e1
commit cbb4d7f5ea

@ -1,4 +1,4 @@
USER=root
PASSWORD=openIM123
MINIO_ENDPOINT=http://127.0.0.1:10005
MINIO_ENDPOINT=http://113.90.81.237:10005
DATA_DIR=./

@ -1,19 +1,19 @@
etcd:
userName:
password:
secret: openIM123 # etcd 配置密钥
secret:
mysql:
dbMysqlUserName: root #mysql用户名
dbMysqlPassword: openIM123 # mysql密码
dbMysqlUserName: root
dbMysqlPassword:
mongo:
dbUserName: root #mongo用户名
dbPassword: openIM123 #mongo密码
dbUserName: root
dbPassword:
redis:
dbUserName:
dbPassWord: openIM123 #redis密码
dbPassWord:
kafka:
SASLUserName:
@ -21,11 +21,11 @@ kafka:
credential:
minio:
endpoint: http://127.0.0.1:10005 #发图片视频文件需要填写
endpoint:
accessKeyID: root
secretAccessKey: openIM123
secretAccessKey:
secret: tuoyun #建议修改
secret:
tokenpolicy:
accessSecret: "open_im_server" #token生成相关 建议修改

@ -4,7 +4,7 @@ etcd:
etcdAddr: [ 127.0.0.1:2379 ] #单机部署时,默认即可
userName:
password:
secret: openIM123
secret:
mysql:
dbMysqlDatabaseName: admin_chat # 数据库名字 默认即可

@ -1,19 +1,43 @@
#!/usr/bin/env bash
internet_ip=`curl ifconfig.me -s`
echo $internet_ip
# Get the external IP address
internet_ip=$(curl -s ifconfig.me)
# Print the IP address
echo "Internet IP address: ${internet_ip}"
# Read environment variables
source .env
echo $MINIO_ENDPOINT
if [ $MINIO_ENDPOINT == "http://127.0.0.1:10005" ]; then
sed -i "s/127.0.0.1/${internet_ip}/" .env
# Check if MINIO_ENDPOINT variable is set correctly
if [[ -z "${MINIO_ENDPOINT}" || "${MINIO_ENDPOINT}" != "http://127.0.0.1:10005" ]]; then
echo "Error: MINIO_ENDPOINT is not set or is not equal to http://127.0.0.1:10005."
exit 1
fi
cd script ;
chmod +x *.sh ;
# Replace the IP address in the .env file
sed -i "s/127.0.0.1/${internet_ip}/" .env
# Enter the script directory
cd script || exit 1
# Add execute permission to scripts
chmod +x *.sh
# Initialize password
./init_pwd.sh
./env_check.sh;
cd .. ;
docker-compose up -d;
cd script ;
# Check environment variables
./env_check.sh
# Return to the parent directory
cd ..
# Start docker containers
docker-compose up -d
# Enter the script directory
cd script || exit 1
# Check if docker services are running properly
./docker_check_service.sh

Loading…
Cancel
Save