This commit is contained in:
gongwenxin
2025-06-16 14:49:49 +08:00
parent adc1a0053f
commit df90a5377f
210 changed files with 323584 additions and 12804 deletions
+18 -6
View File
@@ -3,9 +3,11 @@
# build:
# pyinstaller --name ddms_compliance_tool --onefile run_api_tests.py
db:
flask init-db
flask init-db
run:
python run_api_tests.py --base-url http://127.0.0.1:4523/m1/6389742-6086420-default --yapi assets/doc/井筒API示例_simple.json --custom-test-cases-dir ./custom_testcases --verbose --output test_report.json >log.txt 2>&1
run_stages:
python run_api_tests.py \
--base-url http://127.0.0.1:4523/m1/6389742-6086420-default \
@@ -15,6 +17,18 @@ run_stages:
-v \
-o ./test_reports/ >log_stage.txt 2>&1
# 构建Docker镜像,只需要在依赖变化时执行一次
build_docker_image:
docker build -t compliance-builder:latest .
# 使用预构建的镜像打包flask应用
docker_build_flask: build_docker_image
docker run --platform linux/amd64 --rm -v "$(pwd)":/build compliance-builder:latest
# 旧的构建方式(保留作为参考)
docker_build_flask_old:
docker run --platform linux/amd64 --rm -v "$(pwd)":/app -w /app registry.access.redhat.com/ubi8/python-39 sh -c "pip3 install --no-cache-dir -r requirements.txt || true && pip3 install --no-cache-dir pyinstaller && pyinstaller --onefile --noconfirm flask_app.py -n flask_https"
docker_build_redhat:
docker run --platform linux/amd64 --rm -v "$(pwd)":/app -w /app registry.access.redhat.com/ubi8/python-39 sh -c "pip3 install --no-cache-dir -r requirements.txt || true && pip3 install --no-cache-dir pyinstaller && pyinstaller --onefile --noconfirm run_api_tests.py && ./dist/run_api_tests --base-url http://host.docker.internal:4523 > ./dist/output.txt 2>&1 && chown -R $(id -u):$(id -g) dist build run_api_tests.spec || true"
@@ -25,8 +39,6 @@ docker_build_redhat:
# sh -c "dnf install -y epel-release && \
# dnf config-manager --set-enabled powertools || dnf config-manager --set-enabled PowerTools || true && \
# dnf install -y python39 python39-pip python39-devel binutils gcc make && \
# pip3.9 install --no-cache-dir -r requirements.txt || true && \
# pip3.9 install --no-cache-dir pyinstaller && \
# pyinstaller --onefile --noconfirm run_api_tests.py && \
# ./dist/run_api_tests --base-url http://host.docker.internal:4523 > ./dist/output.txt 2>&1 && \
# chown -R $(id -u):$(id -g) dist build run_api_tests.spec || true"
# pip3 install --no-cache-dir -r requirements.txt || true && \
# pip3 install --no-cache-dir pyinstaller && \
# pyinstaller --onefile --noconfirm flask_app.py "