You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
787 B
30 lines
787 B
kind: pipeline
|
|
type: docker
|
|
name: MyJsonGen
|
|
|
|
steps:
|
|
- name: build-start
|
|
image: appleboy/drone-ssh # SSH工具镜像
|
|
settings:
|
|
host: 159.75.130.72 # 远程连接地址
|
|
username: root # 远程连接账号
|
|
# password:
|
|
# from_secret: ssh_password # 从Secret中读取SSH密码
|
|
ssh_key:
|
|
from_secret: ssh_key
|
|
port: 22 # 远程连接端口
|
|
command_timeout: 5m # 远程执行命令超时时间
|
|
script:
|
|
- cd /root/repo/ # 进入宿主机构建目录
|
|
- rm -rf json-gen
|
|
- git clone git@git.cobb.wang:cobb/json-gen.git
|
|
- cd json-gen
|
|
- docker-compose build
|
|
- docker-compose down
|
|
- docker-compose up -d
|
|
when:
|
|
branch:
|
|
- main
|
|
event:
|
|
- push
|
|
- tag
|