ci:优化持续集成部署流程
- 修改 .drone.yml 文件,增加删除和创建 dist 目录的步骤 - 更新 Dockerfile,将 COPY 源目录从 dist 改为 dist/dist-prod - 这些更改提高了部署的可靠性和一致性
This commit is contained in:
parent
cb9ae6bc39
commit
ff61902822
|
@ -16,7 +16,10 @@ steps:
|
|||
# - SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/ npm install node-sass
|
||||
- npm install
|
||||
- npm run build:prod
|
||||
- cp -r ./dist /home/app/web/dist
|
||||
|
||||
- rm -rf /home/app/web/dist || true # 如果存在就删除(忽略错误)
|
||||
- mkdir -p /home/app/web/dist
|
||||
- cp -r ./dist-prod /home/app/web/dist
|
||||
- cp Dockerfile /home/app/web/Dockerfile
|
||||
- cp docker.sh /home/app/web/docker.sh
|
||||
- cp nginx.conf /home/app/web/nginx.conf
|
||||
|
|
|
@ -3,7 +3,7 @@ FROM nginx:latest
|
|||
# 定义作者
|
||||
MAINTAINER chinasoft
|
||||
# 将dist文件中的内容复制到 /usr/share/nginx/html/ 这个目录下面
|
||||
COPY dist/ /usr/share/nginx/html/
|
||||
COPY dist/dist-prod /usr/share/nginx/html/
|
||||
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
|
||||
EXPOSE ${innerPort}
|
||||
ENTRYPOINT nginx -g "daemon off;"
|
||||
|
|
Loading…
Reference in New Issue