From a656b0467dc618830d2e4753e0cb643c5af90d2f Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Sun, 27 Apr 2025 15:47:58 +0800 Subject: [PATCH] build: Add a script execution judgment --- .github/workflows/build-and-push.yml | 2 +- installer/Dockerfile | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml index ac50d9514..e843cd592 100644 --- a/.github/workflows/build-and-push.yml +++ b/.github/workflows/build-and-push.yml @@ -38,7 +38,7 @@ jobs: - name: Prepare id: prepare run: | - DOCKER_IMAGE=${{ secrets.FIT2CLOUD_REGISTRY_HOST }}/cordys/cordys-crm + DOCKER_IMAGE=${{ secrets.FIT2CLOUD_REGISTRY_HOST }}/cordys/cordys-crm-ce DOCKER_PLATFORMS=${{ github.event.inputs.architecture }} TAG_NAME=${{ github.event.inputs.dockerImageTag }} if [[ ${TAG_NAME} == *dev* ]]; then diff --git a/installer/Dockerfile b/installer/Dockerfile index 0a57b76e5..86a502b12 100644 --- a/installer/Dockerfile +++ b/installer/Dockerfile @@ -64,4 +64,11 @@ RUN echo -n "${CRM_VERSION}" > /tmp/CRM_VERSION VOLUME [ "/opt/cordys/data", "/opt/cordys/logs", "/opt/cordys/conf" ] -ENTRYPOINT ["sh", "/shells/start-all.sh"] +#ENTRYPOINT ["sh", "/shells/start-all.sh"] + +# 添加环境变量,默认为true表示执行启动脚本 +ARG EXECUTE_START_SCRIPT=true +ENV EXECUTE_START_SCRIPT=${EXECUTE_START_SCRIPT} + +# 修改ENTRYPOINT使用条件判断 +ENTRYPOINT ["/bin/sh", "-c", "if [ \"$EXECUTE_START_SCRIPT\" = \"true\" ]; then sh /shells/start-all.sh; else echo 'Startup script execution skipped' && tail -f /dev/null; fi"] \ No newline at end of file