Compare commits
10 Commits
31d60777f0
...
test
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ed5e9330b9 | ||
![]() |
1fd05ee452 | ||
![]() |
80e14644d8 | ||
![]() |
2928113441 | ||
![]() |
4bd9a8e690 | ||
![]() |
5792660d88 | ||
![]() |
24323f2992 | ||
![]() |
28b1e67f48 | ||
![]() |
9b1a76d72f | ||
![]() |
6ebdc7dd9f |
@@ -21,12 +21,19 @@ jobs:
|
|||||||
git clone --depth 1 "http://test:89085111dd6939710a992d6404bd61a50e420685@8.138.239.222:20300/${GITHUB_REPOSITORY}.git" .
|
git clone --depth 1 "http://test:89085111dd6939710a992d6404bd61a50e420685@8.138.239.222:20300/${GITHUB_REPOSITORY}.git" .
|
||||||
git checkout "${GITHUB_SHA}"
|
git checkout "${GITHUB_SHA}"
|
||||||
|
|
||||||
|
# - uses: https://gitea.com/actions/setup-python@v5
|
||||||
|
# with:
|
||||||
|
# python-version: '3.7'
|
||||||
|
# cache: 'pip'
|
||||||
|
# # 如果有多个 requirements 文件:
|
||||||
|
# # cache-dependency-path: '**/requirements*.txt'
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
mkdir dist
|
mkdir dist
|
||||||
PYTHONUSERBASE=$CI_PROJECT_DIR/home pip install --upgrade pip -i https://mirror.aliyun.com/pypi/simple --user
|
PYTHONUSERBASE=./home pip install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple --user
|
||||||
PYTHONUSERBASE=$CI_PROJECT_DIR/home pip install -r ./requirements.txt -i https://mirror.aliyun.com/pypi/simple --user
|
PYTHONUSERBASE=./home pip install -r ./requirements.txt -i https://mirrors.aliyun.com/pypi/simple --user
|
||||||
rsync -ha ./ ./dist --exclude=dist --exclude=.git --delete
|
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
run: |
|
run: |
|
||||||
@@ -37,12 +44,19 @@ jobs:
|
|||||||
chmod 600 ~/.ssh/id_rsa
|
chmod 600 ~/.ssh/id_rsa
|
||||||
ssh -o StrictHostKeyChecking=no root@$DEPLOY_TEST_HOST_IP "mkdir -p $DEPLOY_PATH"
|
ssh -o StrictHostKeyChecking=no root@$DEPLOY_TEST_HOST_IP "mkdir -p $DEPLOY_PATH"
|
||||||
|
|
||||||
rsync -r ./dist/ ${DEPLOY_DEV_HOST_IP}:${DEPLOY_PATH} --delete
|
ssh root@$DEPLOY_TEST_HOST_IP "rm -rf $DEPLOY_PATH/**"
|
||||||
ssh ${SSH_OPTS} ${DEPLOY_DEV_HOST_IP} "cd ${DEPLOY_PATH} && source /etc/profile && docker-compose up -d --force-recreate"
|
scp -r ./** root@$DEPLOY_TEST_HOST_IP:$DEPLOY_PATH/
|
||||||
|
|
||||||
ssh root@$DEPLOY_TEST_HOST_IP "rm -f $DEPLOY_PATH/*.jar"
|
|
||||||
scp ruoyi-admin/target/ruoyi-admin.jar root@$DEPLOY_TEST_HOST_IP:$DEPLOY_PATH/
|
|
||||||
ssh root@$DEPLOY_TEST_HOST_IP "mv $DEPLOY_PATH/ruoyi-admin.jar $DEPLOY_PATH/app.jar"
|
|
||||||
scp docker-compose.test.yml root@$DEPLOY_TEST_HOST_IP:$DEPLOY_PATH/
|
|
||||||
ssh root@$DEPLOY_TEST_HOST_IP "mv $DEPLOY_PATH/docker-compose.test.yml $DEPLOY_PATH/docker-compose.yml"
|
|
||||||
ssh root@$DEPLOY_TEST_HOST_IP "cd $DEPLOY_PATH && docker compose up -d --force-recreate"
|
ssh root@$DEPLOY_TEST_HOST_IP "cd $DEPLOY_PATH && docker compose up -d --force-recreate"
|
||||||
|
|
||||||
|
# ssh ${SSH_OPTS} ${DEPLOY_DEV_HOST_IP} "cd ${DEPLOY_PATH} && source /etc/profile && docker-compose up -d --force-recreate"
|
||||||
|
#
|
||||||
|
# rsync -ha ./ ./dist --exclude=dist --exclude=.git --delete
|
||||||
|
# rsync -r ./dist/ ${DEPLOY_DEV_HOST_IP}:${DEPLOY_PATH} --delete
|
||||||
|
# ssh ${SSH_OPTS} ${DEPLOY_DEV_HOST_IP} "cd ${DEPLOY_PATH} && source /etc/profile && docker-compose up -d --force-recreate"
|
||||||
|
#
|
||||||
|
# ssh root@$DEPLOY_TEST_HOST_IP "rm -f $DEPLOY_PATH/*.jar"
|
||||||
|
# scp ruoyi-admin/target/ruoyi-admin.jar root@$DEPLOY_TEST_HOST_IP:$DEPLOY_PATH/
|
||||||
|
# ssh root@$DEPLOY_TEST_HOST_IP "mv $DEPLOY_PATH/ruoyi-admin.jar $DEPLOY_PATH/app.jar"
|
||||||
|
# scp docker-compose.test.yml root@$DEPLOY_TEST_HOST_IP:$DEPLOY_PATH/
|
||||||
|
# ssh root@$DEPLOY_TEST_HOST_IP "mv $DEPLOY_PATH/docker-compose.test.yml $DEPLOY_PATH/docker-compose.yml"
|
||||||
|
# ssh root@$DEPLOY_TEST_HOST_IP "cd $DEPLOY_PATH && docker compose up -d --force-recreate"
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
version: '2.1'
|
version: '2.1'
|
||||||
services:
|
services:
|
||||||
www:
|
www:
|
||||||
image: python:3.7.16-material-api
|
container_name: material-api
|
||||||
build: ./docker
|
image: python:3.7.16
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
- SERVICE_NAME=material-api
|
- SERVICE_NAME=material-api
|
||||||
@@ -16,7 +16,13 @@ services:
|
|||||||
- ./web:/usr/src/app
|
- ./web:/usr/src/app
|
||||||
- ./home:/root/.local
|
- ./home:/root/.local
|
||||||
- ./logs:/logs
|
- ./logs:/logs
|
||||||
- /opt/files/material_api:/usr/src/app/files
|
- ./files:/usr/src/app/files
|
||||||
working_dir: /usr/src/app/
|
working_dir: /usr/src/app/
|
||||||
ports:
|
ports:
|
||||||
- 7072:7072
|
- 7072:7072
|
||||||
|
networks:
|
||||||
|
- server
|
||||||
|
|
||||||
|
networks:
|
||||||
|
server:
|
||||||
|
external: true
|
@@ -3,6 +3,7 @@
|
|||||||
#git+http://oauth2:4VGjs7rFL9fz8EwR1x6g@192.168.1.3:8929/jgy_xxs/nc_http.git
|
#git+http://oauth2:4VGjs7rFL9fz8EwR1x6g@192.168.1.3:8929/jgy_xxs/nc_http.git
|
||||||
#git+http://oauth2:4VGjs7rFL9fz8EwR1x6g@gitlab:8929/jgy_xxs/nc_http.git
|
#git+http://oauth2:4VGjs7rFL9fz8EwR1x6g@gitlab:8929/jgy_xxs/nc_http.git
|
||||||
#nc_http>=0.0.1.dev54
|
#nc_http>=0.0.1.dev54
|
||||||
|
git+http://test:89085111dd6939710a992d6404bd61a50e420685@8.138.239.222:20300/root/nc_http.git
|
||||||
|
|
||||||
Flask>=2.0.3
|
Flask>=2.0.3
|
||||||
Flask-SQLAlchemy>=2.4.4
|
Flask-SQLAlchemy>=2.4.4
|
||||||
|
@@ -32,7 +32,7 @@ HTTPS_BASE_URL = os.getenv('HTTPS_BASE_URL', '')
|
|||||||
|
|
||||||
# 数据库
|
# 数据库
|
||||||
os.environ['NLS_LANG'] = 'SIMPLIFIED CHINESE_CHINA.UTF8' # oracle client 编码
|
os.environ['NLS_LANG'] = 'SIMPLIFIED CHINESE_CHINA.UTF8' # oracle client 编码
|
||||||
SQLALCHEMY_DATABASE_URI = 'mysql+mysqlconnector://root:Xxs123456@192.168.1.3:4306/material_manage?charset=utf8mb4&auth_plugin=mysql_native_password'
|
SQLALCHEMY_DATABASE_URI = 'mysql+mysqlconnector://root:XKKFB123456!@mysql:3306/material_manage?charset=utf8mb4&auth_plugin=mysql_native_password'
|
||||||
SQLALCHEMY_TRACK_MODIFICATIONS = False # 设置是否跟踪数据库的修改情况,一般不跟踪
|
SQLALCHEMY_TRACK_MODIFICATIONS = False # 设置是否跟踪数据库的修改情况,一般不跟踪
|
||||||
SQLALCHEMY_ECHO = True # 数据库操作时是否显示原始SQL语句,一般打开,后台要日志
|
SQLALCHEMY_ECHO = True # 数据库操作时是否显示原始SQL语句,一般打开,后台要日志
|
||||||
SQLALCHEMY_BINDS = {
|
SQLALCHEMY_BINDS = {
|
||||||
@@ -44,10 +44,10 @@ SQLALCHEMY_POOL_RECYCLE = 10 * 60 # 空闲该时间后回收数据库连接
|
|||||||
ES_HOSTS = os.getenv('ES_HOSTS', 'http://192.168.137.1:9200')
|
ES_HOSTS = os.getenv('ES_HOSTS', 'http://192.168.137.1:9200')
|
||||||
|
|
||||||
# Redis
|
# Redis
|
||||||
REDIS_HOST = os.getenv('REDIS_HOST', '192.168.137.1')
|
REDIS_HOST = os.getenv('REDIS_HOST', 'redis')
|
||||||
REDIS_PORT = int(os.getenv('REDIS_PORT', '6379'))
|
REDIS_PORT = int(os.getenv('REDIS_PORT', '6379'))
|
||||||
REDIS_PASSWORD = os.getenv('REDIS_PASSWORD', '')
|
REDIS_PASSWORD = os.getenv('REDIS_PASSWORD', 'Xxs123456')
|
||||||
REDIS_DB = int(os.getenv('REDIS_DATABASE', '1'))
|
REDIS_DB = int(os.getenv('REDIS_DATABASE', '4'))
|
||||||
|
|
||||||
# Celery
|
# Celery
|
||||||
CELERY_BROKER_URL = 'redis://{}{}:{}/{}'.format(
|
CELERY_BROKER_URL = 'redis://{}{}:{}/{}'.format(
|
||||||
|
Reference in New Issue
Block a user