查看“︁编程语言/Drone/rsync”︁的源代码
来自康健生活
←
编程语言/Drone/rsync
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
== 标题文本 == <syntaxhighlight lang="javascript"> # 编译阶段 - name: build image: node:23 volumes: - name: node_modules # 挂载到容器内的路径 # 宿主机 node_modules -> 挂载到容器/drone/src/node_modules目录 path: /drone/src/node_modules # - name: pnpm-cache # path: /drone/src/.pnpm-store commands: - echo "============构建前的文件===============" - pwd - ls -alt - echo "======================================" - yarn --version || npm install -g yarn - yarn install --frozen-lockfile - yarn build - echo "============构建后的产物===============" - ls -la dist || exit 1 - name: deploy image: drillster/drone-rsync # 使用宿主机网络 network_mode: host settings: hosts: # 服务器地址 - localhost user: root key: from_secret: deploy_ssh_secret port: 22 source: dist/ target: /home/app-website # 如果在同一个服务器,可以把代码直接编译进挂载目录或者移入挂载目录 # - name: deploy # image: alpine:latest # volumes: # - name: admin-website # # 在容器内提供target目录 挂载到宿主机的host目录下 # path: /target # commands: # - apk add --no-cache rsync # # 将容器内的dist目录同步到target目录,给volumes挂载 # - rsync -av --delete /drone/src/dist/ /target/ # # 验证文件是否复制成功 # - ls -la /target/ || exit 1</syntaxhighlight>
返回
编程语言/Drone/rsync
。
导航菜单
康健生活
搜索
user-page
通知
user-interface-preferences
个人工具
登录
五一
多读书,多运动,多到远处走走,再看看不一样的世界。