This commit is contained in:
parent
3bd85df0d2
commit
9174dae72a
59
.drone.yml
59
.drone.yml
@ -5,44 +5,23 @@ name: microservice-build
|
|||||||
clone:
|
clone:
|
||||||
disable: true
|
disable: true
|
||||||
steps:
|
steps:
|
||||||
- name: debug-env
|
- name: test-build
|
||||||
image: alpine:latest
|
|
||||||
commands:
|
|
||||||
- env
|
|
||||||
- name: build-service
|
|
||||||
image: maven:3-jdk-8
|
|
||||||
volumes:
|
|
||||||
- name: test-dir
|
|
||||||
path: /root/aaa
|
|
||||||
commands:
|
|
||||||
# - echo "Building Service: ${SERVICE}"
|
|
||||||
- mkdir -p /root/aaa
|
|
||||||
- cd /root/aaa
|
|
||||||
- touch test.txt
|
|
||||||
- |
|
|
||||||
if [ ${SERVICE} = "gateway" ]; then
|
|
||||||
echo "Building Gateway Service..."
|
|
||||||
elif [ ${SERVICE} = "system" ]; then
|
|
||||||
echo "Building System Service..."
|
|
||||||
else
|
|
||||||
echo "Building All Services..."
|
|
||||||
# 如果有其他服务,可以在这里继续添加
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: test-service
|
image: appleboy/drone-ssh # SSH工具镜像
|
||||||
image: maven:3-jdk-8
|
|
||||||
commands:
|
settings:
|
||||||
# - echo "Testing Service: ${SERVICE}"
|
|
||||||
- |
|
host: 47.118.40.3 # 远程连接地址
|
||||||
if [ "${SERVICE}" = "gateway" ]; then
|
|
||||||
echo "Testing Gateway Service..."
|
username: root # 远程连接账号
|
||||||
elif [ "${SERVICE}" = "system" ]; then
|
|
||||||
echo "Testing System Service..."
|
private_key:
|
||||||
else
|
|
||||||
echo "Testing All Services..."
|
from_secret: ssh_private_key # 从Secret中读取SSH密码
|
||||||
# 如果有其他服务,可以在这里继续添加
|
|
||||||
fi
|
port: 22 # 远程连接端口
|
||||||
volumes:
|
|
||||||
- name: test-dir
|
command_timeout: 20m # 远程执行命令超时时间
|
||||||
host:
|
|
||||||
path: /root/test-dir # 从宿主机中挂载的目录
|
script:
|
||||||
|
- ls /
|
Loading…
Reference in New Issue
Block a user