Compare commits
No commits in common. "e3c08332887e839cd79978b96e5481758ff2c8ad" and "ae883235e4c8f4eb068aa0cad126e37120b9e40b" have entirely different histories.
e3c0833288
...
ae883235e4
35
.drone.yml
35
.drone.yml
@ -23,27 +23,15 @@ steps:
|
||||
# 如果需要运行测试:
|
||||
# - mvn clean test
|
||||
# - mvn package
|
||||
# - name: debug-docker-pull
|
||||
# image: docker:cli
|
||||
# commands:
|
||||
# - docker --version
|
||||
# - docker pull registry.zczx.com/ibm-semeru-runtimes:open-21-jre
|
||||
# when:
|
||||
# branch: main
|
||||
- name: build-and-publish-to-private-registry
|
||||
image: plugins/docker
|
||||
settings:
|
||||
debug: true
|
||||
repo: registry.zczx.com/dronedemo
|
||||
tags:
|
||||
- latest
|
||||
- ${DRONE_COMMIT_SHA:0:7}
|
||||
dockerfile: Dockerfile
|
||||
context: .
|
||||
registry: registry.zczx.com
|
||||
insecure: true
|
||||
environment:
|
||||
DOCKER_BUILDKIT: '0'
|
||||
when:
|
||||
branch:
|
||||
- main
|
||||
@ -51,18 +39,17 @@ steps:
|
||||
- push
|
||||
|
||||
- name: deploy-to-server
|
||||
image: registry.zczx.com/appleboy/drone-ssh
|
||||
image: appleboy/drone-ssh # 使用 SSH 插件
|
||||
settings:
|
||||
host: 10.0.0.210
|
||||
username: root
|
||||
password:
|
||||
from_secret: ssh_password
|
||||
host:
|
||||
from_secret: 10.0.0.210
|
||||
username:
|
||||
from_secret: root
|
||||
key:
|
||||
from_secret: ssh_private_key # SSH 私钥内容
|
||||
port: 22 # SSH 端口,默认为 22
|
||||
# passhprase: from_secret: ssh_passphrase # 如果你的 SSH key 有密码
|
||||
script:
|
||||
- echo "Stopping old container..."
|
||||
- export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||
- export DOCKER_HOST=unix:///var/run/docker.sock
|
||||
- cd /root/deploy/dronedemo # 进入应用部署目录
|
||||
- echo "Pulling latest image..."
|
||||
- docker-compose pull
|
||||
@ -76,4 +63,10 @@ steps:
|
||||
branch:
|
||||
- main
|
||||
event:
|
||||
- push
|
||||
- push
|
||||
|
||||
# (可选) 定义卷用于缓存,例如 Maven 依赖
|
||||
# volumes:
|
||||
# - name: maven-cache
|
||||
# host:
|
||||
# path: /tmp/cache/maven # 将 Runner 主机上的目录挂载到构建步骤中
|
||||
Loading…
x
Reference in New Issue
Block a user