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