|
|
@@ -36,8 +36,8 @@ steps:
|
|
|
when:
|
|
|
status:
|
|
|
- success # 当前步骤成功时执行
|
|
|
- - name: scp-project
|
|
|
- image: appleboy/drone-scp
|
|
|
+ - name: rsync-project
|
|
|
+ image: drillster/drone-rsync
|
|
|
pull: if-not-exists
|
|
|
depends_on: [build-project] # 依赖的步骤
|
|
|
volumes: # 挂载数据卷
|
|
|
@@ -46,10 +46,10 @@ steps:
|
|
|
settings:
|
|
|
host:
|
|
|
from_secret: host
|
|
|
- username:
|
|
|
+ user:
|
|
|
from_secret: username
|
|
|
- password:
|
|
|
- from_secret: userpwd
|
|
|
+ key:
|
|
|
+ from_secret: key
|
|
|
port: 22
|
|
|
command_timeout: 2m
|
|
|
target: /home/ABServer/deploy-ready/
|
|
|
@@ -59,23 +59,6 @@ steps:
|
|
|
- /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/
|
|
|
@@ -84,6 +67,57 @@ steps:
|
|
|
# - docker restart nodeServer1
|
|
|
- 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:
|
|
|
branch:
|
|
|
include:
|