master
zhang 2 years ago
parent 544628a39e
commit 1de3ad81f3

@ -53,30 +53,22 @@ steps:
# port: 22 # port: 22
# target: /root # target: /root
# source: /target/* # source: /target/*
- name: build-docker - name: ssh
image: plugins/docker image: appleboy/drone-ssh # SSH工具镜像
volumes: # 将容器内目录挂载到宿主机仓库需要开启Trusted设置
- name: maven-build
path: /app/build # 将应用打包好的Jar和执行脚本挂载出来
settings: settings:
dockerfile: /app/build/Dockerfile host: 192.168.230.16 # 远程连接地址
commands: # 定义在Docker容器中执行的shell命令 username: root # 远程连接账号
- cd /data/wwwroot/zabbix_back password:
- chmod +x run.sh from_secret: macro3_pas # 从Secret中读取SSH密码
- ./run.sh port: 22 # 远程连接端口
# - name: ssh command_timeout: 5m # 远程执行命令超时时间
# image: appleboy/drone-ssh script:
# settings: - cd /data/wwwroot/zabbix_back # 进入宿主机构建目录
# host: 192.168.230.16 - chmod +x run.sh # 更改为可执行脚本
# username: root - ./run.sh # 运行脚本打包应用镜像并运行
# password: when:
# from_secret: macro3_pas event:
# port: 22 - promote
# 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:
@ -115,7 +107,6 @@ volumes: # 定义流水线挂载目录,用于共享数据
- name: cache - name: cache
host: host:
path: "/var/lib/cache" path: "/var/lib/cache"
trigger: trigger:
branch: branch:
- master - master

Loading…
Cancel
Save