From 7486458d1bd209a6ae537ad251508d0ed663cf9e Mon Sep 17 00:00:00 2001 From: liuyanglinux Date: Thu, 9 May 2024 11:25:00 +0800 Subject: [PATCH 1/6] upload script --- deploy/entrypoint.sh | 4 ++++ deploy/monitor.sh | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 deploy/entrypoint.sh create mode 100644 deploy/monitor.sh diff --git a/deploy/entrypoint.sh b/deploy/entrypoint.sh new file mode 100644 index 0000000..4602342 --- /dev/null +++ b/deploy/entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +bash /etc/nginx/monitor.sh $DET_URL $DST_PATH & +nginx -g 'daemon off;' \ No newline at end of file diff --git a/deploy/monitor.sh b/deploy/monitor.sh new file mode 100644 index 0000000..ebfb6e6 --- /dev/null +++ b/deploy/monitor.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# this script is for website monitoring, +# when website is up, delete all cert file. + +HOST=$1 +DST_PATH=$2 + +delete_file() { + if [ -d $DST_PATH ]; then + echo "found $DST_PATH" > /dev/stdout + rm -rf $DST_PATH/* + else + echo "$DST_PATH not found" > /dev/stdout + fi +} + +while true; +do + sleep 20 + RET=$(curl -sIL -w "%{http_code}\n" -o /dev/null $HOST) + if [ $RET == "200" ]; then + echo "website is up!!!" > /dev/stdout + delete_file + if [ $? -eq 0 ]; then + echo "successful delete file, exit" > /dev/stdout + break + else + echo "failed to delete file" > /dev/stdout + fi + else + echo "waiting for website up, http_status: $RET" > /dev/stdout + fi +done -- Gitee From 30b93e979e92aedcbe11ef2989c3fff223b8f3c8 Mon Sep 17 00:00:00 2001 From: liuyanglinux Date: Thu, 9 May 2024 11:30:34 +0800 Subject: [PATCH 2/6] update --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 545841c..d699ae3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM swr.cn-north-4.myhuaweicloud.com/opensourceway/website/node:18.14.1 as Builder +FROM node:18.14.1 as Builder RUN mkdir -p /home/quick-isuue/web WORKDIR /home/quick-isuue/web -- Gitee From d9bb71877004dc22c99138316752cb7ef2bba42f Mon Sep 17 00:00:00 2001 From: liuyanglinux Date: Thu, 9 May 2024 11:34:45 +0800 Subject: [PATCH 3/6] update --- Dockerfile | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index d699ae3..c48a89b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,16 +12,6 @@ RUN pnpm generate FROM swr.cn-north-4.myhuaweicloud.com/opensourceway/openeuler/nginx:1.24.0-22.03-lts-sp1 as NginxBuilder -ARG DOC_BRANCH=master -ARG DOC_REPOSITORY -RUN sed -i "s|repo.openeuler.org|mirrors.pku.edu.cn/openeuler|g" /etc/yum.repos.d/openEuler.repo \ - && yum update -y \ - && yum install -y git \ - && git config --global http.postBuffer 524288000 \ - && git config --global https.postBuffer 524288000 \ - && mkdir -p /home/quick-isuue/web/ \ - && git clone ${DOC_REPOSITORY} -b $DOC_BRANCH /home/quick-isuue/web/website-docs - FROM swr.cn-north-4.myhuaweicloud.com/opensourceway/website/openeuler:22.03-lts-sp1-latest ENV PATH /usr/share/nginx/sbin:$PATH ENV NGINX_CONFIG_FILE /etc/nginx/nginx.conf -- Gitee From 58b15945e6fec7fd053f8c6aa387c79b92ac839b Mon Sep 17 00:00:00 2001 From: liuyanglinux Date: Thu, 9 May 2024 11:36:58 +0800 Subject: [PATCH 4/6] update --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c48a89b..025a66d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,7 +30,6 @@ COPY --from=NginxBuilder /etc/nginx/modules /etc/nginx/modules COPY --from=NginxBuilder /etc/nginx/geoip /etc/nginx/geoip COPY --from=NginxBuilder /etc/nginx/mime.types /etc/nginx/mime.types COPY --from=Builder /home/quick-isuue/web/packages/website/.output/public /usr/share/nginx/www/ -COPY --from=NginxBuilder /home/quick-isuue/web/website-docs/public /usr/share/nginx/www/ WORKDIR /home/quick-isuue/web RUN sed -i "s|repo.openeuler.org|mirrors.pku.edu.cn/openeuler|g" /etc/yum.repos.d/openEuler.repo \ -- Gitee From 5e2f31284b7584a26a8ce74cd47b44c8b1b559d6 Mon Sep 17 00:00:00 2001 From: liuyanglinux Date: Thu, 9 May 2024 11:39:27 +0800 Subject: [PATCH 5/6] update --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 025a66d..a659add 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ COPY . /home/quick-isuue/web RUN npm install pnpm -g RUN pnpm install -RUN pnpm generate +RUN pnpm build FROM swr.cn-north-4.myhuaweicloud.com/opensourceway/openeuler/nginx:1.24.0-22.03-lts-sp1 as NginxBuilder -- Gitee From 75251194316aa1026e4807c88bec5f2728a9bf06 Mon Sep 17 00:00:00 2001 From: liuyanglinux Date: Thu, 9 May 2024 11:46:48 +0800 Subject: [PATCH 6/6] update --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a659add..a48b756 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,7 @@ RUN npm install pnpm -g RUN pnpm install RUN pnpm build +RUN ls /home/quick-isuue/web FROM swr.cn-north-4.myhuaweicloud.com/opensourceway/openeuler/nginx:1.24.0-22.03-lts-sp1 as NginxBuilder @@ -29,7 +30,7 @@ COPY --from=NginxBuilder /usr/share/nginx/sbin/nginx /usr/share/nginx/sbin/nginx COPY --from=NginxBuilder /etc/nginx/modules /etc/nginx/modules COPY --from=NginxBuilder /etc/nginx/geoip /etc/nginx/geoip COPY --from=NginxBuilder /etc/nginx/mime.types /etc/nginx/mime.types -COPY --from=Builder /home/quick-isuue/web/packages/website/.output/public /usr/share/nginx/www/ +COPY --from=Builder /home/quick-isuue/web/dist /usr/share/nginx/www/ WORKDIR /home/quick-isuue/web RUN sed -i "s|repo.openeuler.org|mirrors.pku.edu.cn/openeuler|g" /etc/yum.repos.d/openEuler.repo \ -- Gitee