master
zhang 2 years ago
parent ab9248ef8c
commit c1f6fb958c

@ -53,19 +53,32 @@ steps:
# port: 22 # port: 22
# target: /root # target: /root
# source: /target/* # source: /target/*
- name: ssh - name: build-docker
image: appleboy/drone-ssh image: plugins/docker
volumes: # 将容器内目录挂载到宿主机仓库需要开启Trusted设置
- name: maven-build
path: /app/build # 将应用打包好的Jar和执行脚本挂载出来
- name: docker
path: /var/run/docker.sock # 挂载宿主机的docker
settings: settings:
host: 192.168.230.16 dockerfile: /app/build/Dockerfile
username: root commands: # 定义在Docker容器中执行的shell命令
password: - cd /app/build
from_secret: macro3_pas - chmod +x run.sh
port: 22 - ./run.sh
command_timeout: 5m # - name: ssh
script: # image: appleboy/drone-ssh
- cd /data/wwwroot/zabbix_back # 进入宿主机构建目录 # settings:
- chmod +x run.sh # 更改为可执行脚本 # host: 192.168.230.16
- ./run.sh # 运行脚本打包应用镜像并运行 # username: root
# password:
# from_secret: macro3_pas
# port: 22
# command_timeout: 5m
# script:
# - cd /data/wwwroot/zabbix_back # 进入宿主机构建目录
# - chmod +x run.sh # 更改为可执行脚本
# - ./run.sh # 运行脚本打包应用镜像并运行
# - name: docker # - name: docker
# image: plugins/docker # image: plugins/docker
# settings: # settings:
@ -104,6 +117,9 @@ volumes: # 定义流水线挂载目录,用于共享数据
- name: cache - name: cache
host: host:
path: "/var/lib/cache" path: "/var/lib/cache"
- name: docker
host:
path: /var/run/docker.sock
trigger: trigger:
branch: branch:
- master - master

Loading…
Cancel
Save