Browse Source

更新 '.drone.yml'

rentianliang 1 year ago
parent
commit
6a03f099d4
1 changed files with 9 additions and 19 deletions
  1. 9 19
      .drone.yml

+ 9 - 19
.drone.yml

@@ -22,27 +22,17 @@ steps:
       password:
         from_secret: harbor_password
 
-  - name: ssh-commands
+  # 使用ssh访问主机制作镜像并运行
+  - name: 集群部署
     pull: if-not-exists
-    image: appleboy/drone-ssh:1.5.7
+    image: bh90210/dron8s:latest
     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/${DRONE_REPO_NAME//_/-}:${DRONE_COMMIT_BRANCH/master/latest}
-        - echo =======清理构建文件,建议保留=======
-        - echo =======部署成功=======
-
+      repo_namespace: ywzx
+      repo_name: ${DRONE_REPO_NAME//_/-}
+      yaml: ./deployment-app.yaml
+      image_addr: harbor.sxidc.com/ywzx/${DRONE_REPO_NAME//_/-}:${DRONE_COMMIT_BRANCH/master/latest}
+      kubeconfig:
+        from_secret: test_kubeconfig
       
       
 trigger: