From bea8007239075dd2de9b49e1e3fcc23b35bde7bb Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Tue, 24 Oct 2023 14:33:49 +0800 Subject: [PATCH] apphub update --- .github/workflows/build_apphub.yml | 13 +++++++++++++ docker/apphub/Dockerfile | 2 +- docker/apphub/config/entrypoint.sh | 4 ++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_apphub.yml b/.github/workflows/build_apphub.yml index e0657c68..026dea2e 100644 --- a/.github/workflows/build_apphub.yml +++ b/.github/workflows/build_apphub.yml @@ -36,3 +36,16 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} + - name: Download redoc.standalone.js + run: wget -O apphub/apidocs/redoc.standalone.js https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js + + - name: Run Docker container and get openapi.json + run: | + docker run -d --name apphub -p 8080:80 websoft9dev/apphub:${{ env.VERSION }} + sleep 10 # Wait for the container to start + wget -O apphub/apidocs/openapi.json http://localhost:8080/docs/openapi.json + docker stop apphub + + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: Upgrade apphub api docs \ No newline at end of file diff --git a/docker/apphub/Dockerfile b/docker/apphub/Dockerfile index c9751c7b..887185ae 100644 --- a/docker/apphub/Dockerfile +++ b/docker/apphub/Dockerfile @@ -1,4 +1,4 @@ -# modify time: 202310231530, you can modify here to trigger Docker Build action +# modify time: 202310241440, you can modify here to trigger Docker Build action FROM python:3.10-bullseye AS buildstage LABEL maintainer="Websoft9" diff --git a/docker/apphub/config/entrypoint.sh b/docker/apphub/config/entrypoint.sh index ff4ef6ca..02709937 100644 --- a/docker/apphub/config/entrypoint.sh +++ b/docker/apphub/config/entrypoint.sh @@ -43,10 +43,10 @@ fi create_apikey() { # 容器第一次启动时,不管apikey是否为空,调用apphub genkey - if [ ! -f /websoft9/first_run ]; then + if [ ! -f /websoft9/apphub/src/config/first_run ]; then echo "Create new apikey" apphub genkey - touch /websoft9/first_run + touch /websoft9/apphub/src/config/first_run fi # apphub getkey 为空时,创建新的apikey if [ -z "$(apphub getkey)" ]; then