|
@@ -36,27 +36,46 @@ steps:
|
|
|
when:
|
|
when:
|
|
|
status:
|
|
status:
|
|
|
- success # 当前步骤成功时执行
|
|
- success # 当前步骤成功时执行
|
|
|
- - name: rsync-project
|
|
|
|
|
- image: drillster/drone-rsync
|
|
|
|
|
|
|
+ - name: scp-project
|
|
|
|
|
+ image: appleboy/drone-scp
|
|
|
pull: if-not-exists
|
|
pull: if-not-exists
|
|
|
depends_on: [build-project] # 依赖的步骤
|
|
depends_on: [build-project] # 依赖的步骤
|
|
|
volumes: # 挂载数据卷
|
|
volumes: # 挂载数据卷
|
|
|
- name: targetDir # 数据卷名称
|
|
- name: targetDir # 数据卷名称
|
|
|
path: /kxs-gateway # 容器内目录 绝对路径
|
|
path: /kxs-gateway # 容器内目录 绝对路径
|
|
|
settings:
|
|
settings:
|
|
|
- hosts:
|
|
|
|
|
|
|
+ host:
|
|
|
from_secret: host
|
|
from_secret: host
|
|
|
- user:
|
|
|
|
|
|
|
+ username:
|
|
|
from_secret: username
|
|
from_secret: username
|
|
|
- key:
|
|
|
|
|
- from_secret: key
|
|
|
|
|
|
|
+ password:
|
|
|
|
|
+ from_secret: userpwd
|
|
|
port: 22
|
|
port: 22
|
|
|
command_timeout: 2m
|
|
command_timeout: 2m
|
|
|
target: /home/ABServer/deploy-ready/
|
|
target: /home/ABServer/deploy-ready/
|
|
|
source:
|
|
source:
|
|
|
- - kxs-gateway/target/*.jar
|
|
|
|
|
- - kxs-gateway/target/lib
|
|
|
|
|
- - kxs-gateway/target/config
|
|
|
|
|
|
|
+ - echo ====开始拷贝=======
|
|
|
|
|
+ - /kxs-gateway/*.jar
|
|
|
|
|
+ - /kxs-gateway/lib
|
|
|
|
|
+ - /kxs-gateway/config
|
|
|
|
|
+ - echo ====结束拷贝=======
|
|
|
|
|
+ when:
|
|
|
|
|
+ status:
|
|
|
|
|
+ - success # 当前步骤成功时执行
|
|
|
|
|
+
|
|
|
|
|
+ - name: deploy-project
|
|
|
|
|
+ image: appleboy/drone-ssh
|
|
|
|
|
+ pull: if-not-exists
|
|
|
|
|
+ depends_on: [scp-project] # 依赖的步骤
|
|
|
|
|
+ settings:
|
|
|
|
|
+ host:
|
|
|
|
|
+ from_secret: host
|
|
|
|
|
+ username:
|
|
|
|
|
+ from_secret: username
|
|
|
|
|
+ password:
|
|
|
|
|
+ from_secret: userpwd
|
|
|
|
|
+ port: 22
|
|
|
|
|
+ command_timeout: 2m
|
|
|
script:
|
|
script:
|
|
|
- echo ====开始部署=======
|
|
- echo ====开始部署=======
|
|
|
- cd /home/ABServer/
|
|
- cd /home/ABServer/
|
|
@@ -65,57 +84,6 @@ steps:
|
|
|
# - docker restart nodeServer1
|
|
# - docker restart nodeServer1
|
|
|
- echo ====部署成功=======
|
|
- echo ====部署成功=======
|
|
|
|
|
|
|
|
- when:
|
|
|
|
|
- status:
|
|
|
|
|
- - success # 当前步骤成功时执行
|
|
|
|
|
- # - name: scp-project
|
|
|
|
|
- # image: appleboy/drone-scp
|
|
|
|
|
- # pull: if-not-exists
|
|
|
|
|
- # depends_on: [build-project] # 依赖的步骤
|
|
|
|
|
- # volumes: # 挂载数据卷
|
|
|
|
|
- # - name: targetDir # 数据卷名称
|
|
|
|
|
- # path: /kxs-gateway # 容器内目录 绝对路径
|
|
|
|
|
- # settings:
|
|
|
|
|
- # host:
|
|
|
|
|
- # from_secret: host
|
|
|
|
|
- # username:
|
|
|
|
|
- # from_secret: username
|
|
|
|
|
- # password:
|
|
|
|
|
- # from_secret: userpwd
|
|
|
|
|
- # port: 22
|
|
|
|
|
- # command_timeout: 2m
|
|
|
|
|
- # target: /home/ABServer/deploy-ready/
|
|
|
|
|
- # source:
|
|
|
|
|
- # - echo ====开始拷贝=======
|
|
|
|
|
- # - /kxs-gateway/*.jar
|
|
|
|
|
- # - /kxs-gateway/lib
|
|
|
|
|
- # - /kxs-gateway/config
|
|
|
|
|
- # - echo ====结束拷贝=======
|
|
|
|
|
- # when:
|
|
|
|
|
- # status:
|
|
|
|
|
- # - success # 当前步骤成功时执行
|
|
|
|
|
-
|
|
|
|
|
- # - name: deploy-project
|
|
|
|
|
- # image: appleboy/drone-ssh
|
|
|
|
|
- # pull: if-not-exists
|
|
|
|
|
- # depends_on: [scp-project] # 依赖的步骤
|
|
|
|
|
- # settings:
|
|
|
|
|
- # host:
|
|
|
|
|
- # from_secret: host
|
|
|
|
|
- # username:
|
|
|
|
|
- # from_secret: username
|
|
|
|
|
- # password:
|
|
|
|
|
- # from_secret: userpwd
|
|
|
|
|
- # port: 22
|
|
|
|
|
- # command_timeout: 2m
|
|
|
|
|
- # script:
|
|
|
|
|
- # - echo ====开始部署=======
|
|
|
|
|
- # - cd /home/ABServer/
|
|
|
|
|
- # - cp -r /home/ABServer/deploy-ready/kxs-gateway /home/ABServer/webroot/
|
|
|
|
|
- # - docker stop kxs-gateway && docker rm kxs-gateway && docker-compose up -d
|
|
|
|
|
- # # - docker restart nodeServer1
|
|
|
|
|
- # - echo ====部署成功=======
|
|
|
|
|
-
|
|
|
|
|
trigger:
|
|
trigger:
|
|
|
branch:
|
|
branch:
|
|
|
include:
|
|
include:
|