You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.8 KiB
YAML

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

kind: pipeline
type: docker
name: venue_reservation_manage
steps:
- name: prepare
image: node:18-alpine
volumes:
- name: node-model
path: /app/model
- name: node-cache
path: /app/cache
- name: node-build
path: /app/build
commands:
- npm install -g pnpm
- pnpm config set store-dir /app/model
- pnpm config set registry https://registry.npmjs.org
# 关键修改检查并生成pnpm-lock.yaml
- |
if [ ! -f "pnpm-lock.yaml" ]; then
echo "pnpm-lock.yaml不存在正在生成..."
pnpm install --lockfile-only --no-frozen-lockfile
# 保存生成的lockfile到宿主机避免下次重新生成
cp pnpm-lock.yaml /app/build/
else
# 如果存在,检查是否有更新并保存
pnpm install --lockfile-only --no-frozen-lockfile
cp pnpm-lock.yaml /app/build/
fi
# 使用生成的lockfile进行安装
- cp /app/build/pnpm-lock.yaml .
- pnpm install --frozen-lockfile
- pnpm run build
- cp -r dist /app/build/
- cp Dockerfile /app/build/
- cp default.conf /app/build/
- cp run.sh /app/build/
- name: build
image: plugins/docker
volumes:
- name: node-build
path: /app/build
- name: docker
path: /var/run/docker.sock
settings:
dockerfile: /app/build/Dockerfile
commands:
- cd /app/build
- chmod +x run.sh
- sh run.sh
- docker ps
volumes:
- name: node-build
host:
path: /home/docker/drone/node/build
- name: node-model
host:
path: /home/docker/drone/node/model
- name: node-cache
host:
path: /home/docker/drone/node/cache
- name: docker
host:
path: /var/run/docker.sock