|
|
@@ -19,4 +19,30 @@ steps:
|
|
|
from_secret: harbor_username
|
|
|
password:
|
|
|
from_secret: harbor_password
|
|
|
-
|
|
|
+
|
|
|
+ - name: ssh-commands
|
|
|
+ pull: if-not-exists
|
|
|
+ image: appleboy/drone-ssh:1.5.7
|
|
|
+ settings:
|
|
|
+ host: test_host
|
|
|
+ username: test_user
|
|
|
+ password:
|
|
|
+ # 从drone仓库配置中秘密空间读取密码
|
|
|
+ from_secret: test_pwd
|
|
|
+ port: 22
|
|
|
+ script:
|
|
|
+ - echo =======暂停容器=======
|
|
|
+ - docker stop `docker ps -a | grep kingdee_big_screen | awk '{print $1}' `
|
|
|
+ - echo =======暂停旧容器和镜像=======
|
|
|
+ - docker rm -f `docker ps -a | grep kingdee_big_screen | awk '{print $1}' `
|
|
|
+ - docker rmi `docker images | grep harbor.sxidc.com/fs/kingdee_big_screen | awk '{print $3}' `
|
|
|
+ - echo =======开始部署应用=======
|
|
|
+ - docker run -d -p 10003:80 --name kingdee_big_screen harbor.sxidc.com/fs/kingdee_big_screen
|
|
|
+ - echo =======清理构建文件,建议保留=======
|
|
|
+ - echo =======部署成功=======
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+trigger:
|
|
|
+ branch:
|
|
|
+ - master
|