diff --git a/.trustie-pipeline.yml b/.trustie-pipeline.yml index 75a6333..cec9f86 100644 --- a/.trustie-pipeline.yml +++ b/.trustie-pipeline.yml @@ -1,21 +1,35 @@ kind: pipeline -type: ssh -name: deploy-unity3d +type: docker +name: deploy platform: os: linux arch: amd64 -server: - host: deploy_ip - user: deploy_name - password: deploy_pwd +volumes: +- name: cache + host: + path: /var/lib/cache steps: - - name: cicd - commands: - - echo ======= - - nerdctl rm -f testnginx - - nerdctl run --name testnginx -d -p 58080:80 nginx - - echo ==== nginx======= - - curl 127.0.0.1:58080 - - echo ========== - - echo http://localhost:555 - +- name: deploy-to-server + image: appleboy/drone-scp + commands: + - mvn install -DskipTests=true +# 需要将软件包与部署脚本提前上传到远程主机(见文件上传模板) +# host、username、password可在参数管理中配置 +- name: 远程主机部署 + image: appleboy/drone-ssh + settings: + host: + from_secret: deploy_ip + username: + from_secret: deploy_name + password: + from_secret: deploy_pwd + port: 22 + script: + - echo ====暂停容器开始11======= + - rm -fr /opt/test + - git clone https://bdgit.educoder.net/jasder/simulation_temp.git /opt/test + - docker rm -f nginx + - echo ====开始部署======= + - docker run -d -p 58080:80 -v /opt/test:/usr/share/nginx/html:ro --name nginx nginx + - echo ====部署成功====== \ No newline at end of file